Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix strange behavior when dragging&dropping from MTG creative inventory #14656

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sfence
Copy link
Contributor

@sfence sfence commented May 14, 2024

Add compact, short information about your PR for easier understanding:

To do

Ready for Review.

How to test

See #13961

@sfence
Copy link
Contributor Author

sfence commented May 14, 2024

Is it safe to remove these commented lines:

void GUIFormSpecMenu::updateSelectedItem()
{
	// Don't update when dragging an item
	//if (m_selected_item && (m_selected_dragging || m_left_dragging))
	//	return;

https://github.com/sfence/minetest/blob/297434ca80ba7ea94fd9286a537c0584d4c6a69a/src/gui/guiFormSpecMenu.cpp#L3802-L3804
?

I am not able to judge if it can cause any problems in other situations.

@sfence sfence changed the title Fix #13961. Fix strange behavior when dragging&dropping from MTG creative inventory May 14, 2024
@Zughy Zughy added this to the 5.9.0 milestone May 14, 2024
@grorp
Copy link
Member

grorp commented May 14, 2024

I haven't (yet?) looked or tested closely, but I've already found a bug: Your changes cause crashes when using the "left-drag to distribute evenly" feature introduced by #13146.

SIGSEGV

#0  InventoryList::changeItem (this=0x0, i=2, newitem=...)
    at /mt/src/inventory.cpp:600
#1  0x000000000058d954 in GUIFormSpecMenu::OnEvent (this=0x33ff690, event=...)
    at /mt/src/gui/guiFormSpecMenu.cpp:4740
#2  0x00000000008b05e7 in irr::gui::CGUIEnvironment::postEventFromUser (this=0xebc9e0, event=...)
    at /mt/irr/src/CGUIEnvironment.cpp:533
#3  0x00000000008ada76 in irr::CIrrDeviceStub::postEventFromUser (this=0xb0cb70, event=...)
    at /mt/irr/src/CIrrDeviceStub.cpp:168
#4  0x00000000008aa088 in irr::CIrrDeviceSDL::run (this=0xb0cb70)
    at /mt/irr/src/CIrrDeviceSDL.cpp:857
#5  0x000000000047c380 in RenderingEngine::run (this=<optimized out>)
    at /mt/src/client/renderingengine.h:152
#6  Game::run (this=this@entry=0x7fffffffd018) at /mt/src/client/game.cpp:1159
#7  0x000000000048d5c5 in the_game (kill=0xac3540 <porting::g_killed>, input=0x14b8b80, rendering_engine=0xbe06e0, 
    start_data=..., error_message="", chat_backend=..., reconnect_requested=<optimized out>)
    at /mt/src/client/game.cpp:4566
#8  0x000000000043cfda in ClientLauncher::run (this=0x7fffffffd6a0, start_data=..., cmd_args=...)
    at /mt/src/client/clientlauncher.cpp:209
#9  0x00000000007dfe13 in main (argc=1, argv=0x7fffffffde68) at /mt/src/main.cpp:263

@sfence
Copy link
Contributor Author

sfence commented May 15, 2024

@grorp
Caused by the mentioned commented lines.

I use more complex condition. I do not see SIGSEG now.

@JosiahWI JosiahWI mentioned this pull request May 21, 2024
5 tasks
@appgurueu
Copy link
Contributor

(Ignore the linked PR, that was probably a typo.)

This doesn't seem to fix the issue in its current state (7d8361b): If I hold down the left mouse button (drag), there's still the strange behavior.

Screencast.from.24-05-24.23.35.02.webm

Am I missing something?

@sfence
Copy link
Contributor Author

sfence commented May 25, 2024

@appgurueu Looks like a special situation. I did not test it with one item in the inventory.

@sfence
Copy link
Contributor Author

sfence commented May 27, 2024

@appgurueu Video situation should be fixed now.

Works also with pickup and left_dragging items.

I suggest testing with all inventory features which cams with #13146.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Strange behavior when dragging&dropping from MTG creative inventory (since #13146)
5 participants