diff options
| author | Jan Djärv | 2011-12-26 19:00:38 +0100 |
|---|---|---|
| committer | Jan Djärv | 2011-12-26 19:00:38 +0100 |
| commit | 93d5ca1fbb1a5244483816a1a92f8934a30e589f (patch) | |
| tree | 187283dda31358260e5c2fbbd26a65aa957e711c /src | |
| parent | c40a7de7814a0b1d0c98e1d58513ec1e47230e1b (diff) | |
| download | emacs-93d5ca1fbb1a5244483816a1a92f8934a30e589f.tar.gz emacs-93d5ca1fbb1a5244483816a1a92f8934a30e589f.zip | |
* 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.
Fixes: debbugs:10361
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/xmenu.c | 23 |
2 files changed, 28 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index a1210e08424..2c3644f14fa 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2011-12-26 Jan Djärv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus | ||
| 4 | can scroll. | ||
| 5 | (create_and_show_popup_menu): Always use menu_position_func for | ||
| 6 | Gtk3 (Bug#10361). | ||
| 7 | |||
| 1 | 2011-12-24 Andreas Schwab <schwab@linux-m68k.org> | 8 | 2011-12-24 Andreas Schwab <schwab@linux-m68k.org> |
| 2 | 9 | ||
| 3 | * callint.c (Fcall_interactively): Don't truncate prompt string. | 10 | * callint.c (Fcall_interactively): Don't truncate prompt string. |
diff --git a/src/xmenu.c b/src/xmenu.c index 4b7bbfd73dc..ba99b8ac1e3 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -102,6 +102,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 102 | 102 | ||
| 103 | #ifdef USE_GTK | 103 | #ifdef USE_GTK |
| 104 | #include "gtkutil.h" | 104 | #include "gtkutil.h" |
| 105 | #ifdef HAVE_GTK3 | ||
| 106 | #include "xgselect.h" | ||
| 107 | #endif | ||
| 105 | #endif | 108 | #endif |
| 106 | 109 | ||
| 107 | #include "menu.h" | 110 | #include "menu.h" |
| @@ -408,7 +411,15 @@ x_menu_wait_for_event (void *data) | |||
| 408 | else | 411 | else |
| 409 | ntp = &next_time; | 412 | ntp = &next_time; |
| 410 | 413 | ||
| 414 | #ifdef HAVE_GTK3 | ||
| 415 | /* Gtk3 have arrows on menus when they don't fit. When the pointer is | ||
| 416 | over an arrow, a timeout scrolls it a bit. Use xg_select so that | ||
| 417 | timeout gets triggered. */ | ||
| 418 | |||
| 419 | xg_select (n + 1, &read_fds, (SELECT_TYPE *)0, (SELECT_TYPE *)0, ntp); | ||
| 420 | #else | ||
| 411 | select (n + 1, &read_fds, (SELECT_TYPE *)0, (SELECT_TYPE *)0, ntp); | 421 | select (n + 1, &read_fds, (SELECT_TYPE *)0, (SELECT_TYPE *)0, ntp); |
| 422 | #endif | ||
| 412 | } | 423 | } |
| 413 | } | 424 | } |
| 414 | #endif /* ! MSDOS */ | 425 | #endif /* ! MSDOS */ |
| @@ -1435,6 +1446,13 @@ create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, int x, int y, | |||
| 1435 | GtkMenuPositionFunc pos_func = 0; /* Pop up at pointer. */ | 1446 | GtkMenuPositionFunc pos_func = 0; /* Pop up at pointer. */ |
| 1436 | struct next_popup_x_y popup_x_y; | 1447 | struct next_popup_x_y popup_x_y; |
| 1437 | int specpdl_count = SPECPDL_INDEX (); | 1448 | int specpdl_count = SPECPDL_INDEX (); |
| 1449 | int use_pos_func = ! for_click; | ||
| 1450 | |||
| 1451 | #ifdef HAVE_GTK3 | ||
| 1452 | /* Always use position function for Gtk3. Otherwise menus may become | ||
| 1453 | too small to show anything. */ | ||
| 1454 | use_pos_func = 1; | ||
| 1455 | #endif | ||
| 1438 | 1456 | ||
| 1439 | if (! FRAME_X_P (f)) | 1457 | if (! FRAME_X_P (f)) |
| 1440 | abort (); | 1458 | abort (); |
| @@ -1446,7 +1464,7 @@ create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, int x, int y, | |||
| 1446 | G_CALLBACK (menu_highlight_callback)); | 1464 | G_CALLBACK (menu_highlight_callback)); |
| 1447 | xg_crazy_callback_abort = 0; | 1465 | xg_crazy_callback_abort = 0; |
| 1448 | 1466 | ||
| 1449 | if (! for_click) | 1467 | if (use_pos_func) |
| 1450 | { | 1468 | { |
| 1451 | /* Not invoked by a click. pop up at x/y. */ | 1469 | /* Not invoked by a click. pop up at x/y. */ |
| 1452 | pos_func = menu_position_func; | 1470 | pos_func = menu_position_func; |
| @@ -1461,7 +1479,8 @@ create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, int x, int y, | |||
| 1461 | 1479 | ||
| 1462 | i = 0; /* gtk_menu_popup needs this to be 0 for a non-button popup. */ | 1480 | i = 0; /* gtk_menu_popup needs this to be 0 for a non-button popup. */ |
| 1463 | } | 1481 | } |
| 1464 | else | 1482 | |
| 1483 | if (for_click) | ||
| 1465 | { | 1484 | { |
| 1466 | for (i = 0; i < 5; i++) | 1485 | for (i = 0; i < 5; i++) |
| 1467 | if (FRAME_X_DISPLAY_INFO (f)->grabbed & (1 << i)) | 1486 | if (FRAME_X_DISPLAY_INFO (f)->grabbed & (1 << i)) |