Title in-world mouse-position not updated closing dialog window
Priority release-blocker Status resolved
Assigned To fluzz Keywords
Linked issues Watchers fluzz

Submitted on 2013-10-02 18h38 by matthiaskrgr, last changed by fluzz.

Author: matthiaskrgr Date: 2013-10-02   18h38
how to reproduce:
click on a npc to start dialog
click the node that ends the dialog, and click a few times directly afterwards
=> the dialog will reopen, altough the cursor does NOT hover the npc anymore.

Right after closing the dialog window, the npc is still highlighted (altough not
covered by cursor), so when you click again, the dialog is started again.
As soon as the npc moves a bit or the mouse is moved a bit, the highlight is gone.

I guess we can fix this by adding some kind of mouse-cursor-position-update
trigger after closing any kind of window.

@ 76a0326846ccb59306f96199902d41ff56ae997c
Author: greg Date: 2014-04-11   19h26
the exact way to reproduce this annoying bug is to
click on a npc to start dialog
click the node that ends the dialog
and when asked to click anywhere to continue, click twice without moving the
mouse (and with the npc still at the same place)

like the input_mouse_button is not executed, only the input_mouse_motion can
update the input_axis.x and input_axis.y which are used to know what's under the
cursor in mouse_cursor_is_on_that_image via GetLivingDroidBelowMouseCursor so if
you don't move the mouse, the mouse position before entering the dialog will be

the input_mouse_button is not executed because MouseLeftPressed, like others
similar functions, are pumping the event loop via SDL_PumpEvents. When they do
that, they become aware of a click that the function input_handle isn't.
Except that the call of SDL_PumpEvents is useless because SDL_PollEvent
implicitly call SDL_PumpEvents in input_handle every game loop iteration. This
is problematic to refresh the input after input_handle because the data set in
input_handle will then become false (like the mouse position in this case).

There're calls to KeyPressed's function which requires the call of SDL_PumpEvents.
they follow this pattern : while (!KeyPressed()) ;
or this one which I think is much better : while (!KeyPressed()) \n SDL_Delay(1);
Author: fluzz Date: 2014-09-10   17h36
The patched proposed on should fix it.
Author: fluzz Date: 2014-09-11   18h56
Fixed in commit d748d17f6bec.

But the interaction code needs lot of love !!! So that's only a temporarily fix.
Date User Action Args
2014-09-11 18:56:02fluzzsetstatus: open -> resolved
messages: + msg2894
2014-09-10 17:36:28fluzzsetmessages: + msg2892
2014-09-08 16:27:34fluzzsetassignedto: fluzz
nosy: + fluzz
2014-08-01 10:32:01Xenuxsetpriority: bug -> release-blocker
2014-04-11 19:26:59gregsetmessages: + msg2755
2013-10-02 18:38:00matthiaskrgrcreate