Author: alink
Date: Sat May 26 21:46:10 2007
New Revision: 17873

URL: http://svn.gna.org/viewcvs/wesnoth?rev=17873&view=rev
Log:
change the context menu behavior: when right clicking outside of it, close it 
and don't send the right click to the backround
(which in this case cause the opening of an other context menu)
I also need this for the future general outside-right-click-close-dialog

Modified:
    trunk/src/show_dialog.cpp

Modified: trunk/src/show_dialog.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/show_dialog.cpp?rev=17873&r1=17872&r2=17873&view=diff
==============================================================================
--- trunk/src/show_dialog.cpp (original)
+++ trunk/src/show_dialog.cpp Sat May 26 21:46:10 2007
@@ -68,7 +68,7 @@
 {
        is_in_dialog = reset_to;
        int mousex, mousey;
-       int mouse_flags = SDL_GetMouseState(&mousex, &mousey);
+       SDL_GetMouseState(&mousex, &mousey);
        SDL_Event pb_event;
        pb_event.type = SDL_MOUSEMOTION;
        pb_event.motion.state = 0;
@@ -76,15 +76,6 @@
        pb_event.motion.y = mousey;
        pb_event.motion.xrel = 0;
        pb_event.motion.yrel = 0;
-       SDL_PushEvent(&pb_event);
-       if (!(mouse_flags & SDL_BUTTON_RMASK) || is_in_dialog)
-               return;
-       // based on krom's idea; remove if you don't like the "responsiveness"
-       pb_event.type = SDL_MOUSEBUTTONDOWN;
-       pb_event.button.button = SDL_BUTTON_RIGHT;
-       pb_event.button.state = SDL_PRESSED;
-       pb_event.button.x = mousex;
-       pb_event.button.y = mousey;
        SDL_PushEvent(&pb_event);
 }
 


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to