emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/oldXMenu/Activate.c


From: Jan Djärv
Subject: [Emacs-diffs] Changes to emacs/oldXMenu/Activate.c
Date: Mon, 22 Apr 2002 14:27:03 -0400

Index: emacs/oldXMenu/Activate.c
diff -c emacs/oldXMenu/Activate.c:1.3 emacs/oldXMenu/Activate.c:1.4
*** emacs/oldXMenu/Activate.c:1.3       Fri Jul 21 10:36:24 2000
--- emacs/oldXMenu/Activate.c   Mon Apr 22 14:27:03 2002
***************
*** 1,4 ****
! /* $Header: /cvsroot/emacs/emacs/oldXMenu/Activate.c,v 1.3 2000/07/21 
14:36:24 gerd Exp $ */
  /* Copyright    Massachusetts Institute of Technology    1985 */
  
  #include "copyright.h"
--- 1,4 ----
! /* $Header: /cvsroot/emacs/emacs/oldXMenu/Activate.c,v 1.4 2002/04/22 
18:27:03 jhd Exp $ */
  /* Copyright    Massachusetts Institute of Technology    1985 */
  
  #include "copyright.h"
***************
*** 83,88 ****
--- 83,91 ----
  #include <config.h>
  #include "XMenuInt.h"
  
+ /* For debug, set this to 0 to not grab the keyboard on menu popup */
+ int x_menu_grab_keyboard = 1;
+ 
  int
  XMenuActivate(display, menu, p_num, s_num, x_pos, y_pos, event_mask, data,
              help_callback)
***************
*** 225,230 ****
--- 228,245 ----
                          menu->mouse_cursor,
                          CurrentTime
                          );
+     if (status == Success && x_menu_grab_keyboard)
+       {
+         status = XGrabKeyboard (display,
+                                 menu->parent,
+                                 False,
+                                 GrabModeAsync,
+                                 GrabModeAsync,
+                                 CurrentTime);
+         if (status != Success)
+           XUngrabPointer(display, CurrentTime);
+       }
+     
      if (status == _X_FAILURE) {
        _XMErrorCode = XME_GRAB_MOUSE;
        return(XM_FAILURE);
***************
*** 465,470 ****
--- 480,486 ----
       * Ungrab the mouse.
       */
      XUngrabPointer(display, CurrentTime);
+     XUngrabKeyboard(display, CurrentTime);
  
      /* 
       * Restore bits under where the menu was if we managed



reply via email to

[Prev in Thread] Current Thread [Next in Thread]