emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r106735: * xmenu.c (x_menu_wait_for_e


From: Jan D.
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106735: * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
Date: Mon, 26 Dec 2011 19:00:38 +0100
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106735
fixes bug(s): http://debbugs.gnu.org/10361
committer: Jan D. <address@hidden>
branch nick: trunk
timestamp: Mon 2011-12-26 19:00:38 +0100
message:
  * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
  can scroll.
  (create_and_show_popup_menu): Always use menu_position_func for
  Gtk3.
modified:
  src/ChangeLog
  src/xmenu.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-12-25 09:06:42 +0000
+++ b/src/ChangeLog     2011-12-26 18:00:38 +0000
@@ -1,3 +1,10 @@
+2011-12-26  Jan Djärv  <address@hidden>
+
+       * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
+       can scroll.
+       (create_and_show_popup_menu): Always use menu_position_func for
+       Gtk3 (Bug#10361).
+
 2011-12-24  Andreas Schwab  <address@hidden>
 
        * callint.c (Fcall_interactively): Don't truncate prompt string.

=== modified file 'src/xmenu.c'
--- a/src/xmenu.c       2011-11-19 09:18:31 +0000
+++ b/src/xmenu.c       2011-12-26 18:00:38 +0000
@@ -102,6 +102,9 @@
 
 #ifdef USE_GTK
 #include "gtkutil.h"
+#ifdef HAVE_GTK3
+#include "xgselect.h"
+#endif
 #endif
 
 #include "menu.h"
@@ -408,7 +411,15 @@
       else
         ntp = &next_time;
 
+#ifdef HAVE_GTK3
+      /* Gtk3 have arrows on menus when they don't fit.  When the pointer is
+         over an arrow, a timeout scrolls it a bit.  Use xg_select so that
+         timeout gets triggered.  */
+
+      xg_select (n + 1, &read_fds, (SELECT_TYPE *)0, (SELECT_TYPE *)0, ntp);
+#else
       select (n + 1, &read_fds, (SELECT_TYPE *)0, (SELECT_TYPE *)0, ntp);
+#endif
     }
 }
 #endif /* ! MSDOS */
@@ -1435,6 +1446,13 @@
   GtkMenuPositionFunc pos_func = 0;  /* Pop up at pointer.  */
   struct next_popup_x_y popup_x_y;
   int specpdl_count = SPECPDL_INDEX ();
+  int use_pos_func = ! for_click;
+
+#ifdef HAVE_GTK3
+  /* Always use position function for Gtk3.  Otherwise menus may become
+     too small to show anything.  */
+  use_pos_func = 1;
+#endif
 
   if (! FRAME_X_P (f))
     abort ();
@@ -1446,7 +1464,7 @@
                            G_CALLBACK (menu_highlight_callback));
   xg_crazy_callback_abort = 0;
 
-  if (! for_click)
+  if (use_pos_func)
     {
       /* Not invoked by a click.  pop up at x/y.  */
       pos_func = menu_position_func;
@@ -1461,7 +1479,8 @@
 
       i = 0;  /* gtk_menu_popup needs this to be 0 for a non-button popup.  */
     }
-  else
+
+  if (for_click)
     {
       for (i = 0; i < 5; i++)
         if (FRAME_X_DISPLAY_INFO (f)->grabbed & (1 << i))


reply via email to

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