Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/engines/x11


Modified Files:
        ewl_engine_x11.c 


Log Message:
- do this fully and completely.
- need to handle the keyboard case
- need to reset the internal pointer on ungrab

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/engines/x11/ewl_engine_x11.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -3 -r1.46 -r1.47
--- ewl_engine_x11.c    7 Mar 2007 09:13:50 -0000       1.46
+++ ewl_engine_x11.c    7 Mar 2007 09:19:24 -0000       1.47
@@ -5,7 +5,8 @@
 #include "ewl_macros.h"
 #include "ewl_debug.h"
 
-static Ewl_Window *ee_current_grab_window = NULL;
+static Ewl_Window *ee_current_pointer_grab_window = NULL;
+static Ewl_Window *ee_current_key_grab_window = NULL;
 
 /*
  * In general all of the X event handlers should find their matching window
@@ -669,9 +670,15 @@
        DCHECK_TYPE_RET("win", win, EWL_WINDOW_TYPE, FALSE);
 
        if ((!!(win->flags & EWL_WINDOW_GRAB_KEYBOARD)))
+       {
                ret = ecore_x_keyboard_grab((Ecore_X_Window)win->window);
-       else
+               ee_current_key_grab_window = win;
+       }
+       else if (ee_current_key_grab_window == win)
+       {
                ecore_x_keyboard_ungrab();
+               ee_current_key_grab_window = NULL;
+       }
 
        DRETURN_INT(ret, DLEVEL_STABLE);
 }
@@ -684,7 +691,8 @@
        DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
 
        ecore_x_keyboard_ungrab();
-       
+       ee_current_key_grab_window = NULL;
+
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
@@ -700,10 +708,13 @@
        if ((!!(win->flags & EWL_WINDOW_GRAB_POINTER)))
        {
                ret = ecore_x_pointer_grab((Ecore_X_Window)win->window);
-               ee_current_grab_window = win;
+               ee_current_pointer_grab_window = win;
        }
-       else if (ee_current_grab_window == win)
+       else if (ee_current_pointer_grab_window == win)
+       {
                ecore_x_pointer_ungrab();
+               ee_current_pointer_grab_window = NULL;
+       }
 
        DRETURN_INT(ret, DLEVEL_STABLE);
 }
@@ -716,7 +727,8 @@
        DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
 
        ecore_x_pointer_ungrab();
-       
+       ee_current_pointer_grab_window = NULL;
+
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to