Mercurial > emacs
comparison src/xmenu.c @ 15839:e66ccb471d26
(xmenu_show): Set dummy.state.
Set dummy.button appropriately.
(popup_get_selection) [USE_MOTIF]: Set event.xbutton.button.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 08 Aug 1996 17:12:46 +0000 |
parents | 508ec69917b1 |
children | afb0bb1cdbe6 |
comparison
equal
deleted
inserted
replaced
15838:8c89a87a6341 | 15839:e66ccb471d26 |
---|---|
1113 else if (event.type == ButtonRelease | 1113 else if (event.type == ButtonRelease |
1114 && dpyinfo->display == event.xbutton.display) | 1114 && dpyinfo->display == event.xbutton.display) |
1115 { | 1115 { |
1116 dpyinfo->grabbed &= ~(1 << event.xbutton.button); | 1116 dpyinfo->grabbed &= ~(1 << event.xbutton.button); |
1117 popup_activated_flag = 0; | 1117 popup_activated_flag = 0; |
1118 #ifdef USE_MOTIF /* Pretending that the event came from a | |
1119 Btn1Down seems the only way to convince Motif to | |
1120 activate its callbacks; setting the XmNmenuPost | |
1121 isn't working. --marcus@sysc.pdx.edu. */ | |
1122 event.xbutton.button = 1; | |
1123 #endif | |
1118 } | 1124 } |
1119 /* If the user presses a key, deactivate the menu. | 1125 /* If the user presses a key, deactivate the menu. |
1120 The user is likely to do that if we get wedged. */ | 1126 The user is likely to do that if we get wedged. */ |
1121 else if (event.type == KeyPress | 1127 else if (event.type == KeyPress |
1122 && dpyinfo->display == event.xbutton.display) | 1128 && dpyinfo->display == event.xbutton.display) |
1871 Both assume input is blocked by the caller. */ | 1877 Both assume input is blocked by the caller. */ |
1872 | 1878 |
1873 /* F is the frame the menu is for. | 1879 /* F is the frame the menu is for. |
1874 X and Y are the frame-relative specified position, | 1880 X and Y are the frame-relative specified position, |
1875 relative to the inside upper left corner of the frame F. | 1881 relative to the inside upper left corner of the frame F. |
1876 FOR_CLICK if this menu was invoked for a mouse click. | 1882 FOR_CLICK is nonzero if this menu was invoked for a mouse click. |
1877 KEYMAPS is 1 if this menu was specified with keymaps; | 1883 KEYMAPS is 1 if this menu was specified with keymaps; |
1878 in that case, we return a list containing the chosen item's value | 1884 in that case, we return a list containing the chosen item's value |
1879 and perhaps also the pane's prefix. | 1885 and perhaps also the pane's prefix. |
1880 TITLE is the specified menu title. | 1886 TITLE is the specified menu title. |
1881 ERROR is a place to store an error message string in case of failure. | 1887 ERROR is a place to store an error message string in case of failure. |
2108 dummy.type = ButtonPress; | 2114 dummy.type = ButtonPress; |
2109 dummy.serial = 0; | 2115 dummy.serial = 0; |
2110 dummy.send_event = 0; | 2116 dummy.send_event = 0; |
2111 dummy.display = FRAME_X_DISPLAY (f); | 2117 dummy.display = FRAME_X_DISPLAY (f); |
2112 dummy.time = CurrentTime; | 2118 dummy.time = CurrentTime; |
2113 dummy.button = 0; | |
2114 dummy.root = FRAME_X_DISPLAY_INFO (f)->root_window; | 2119 dummy.root = FRAME_X_DISPLAY_INFO (f)->root_window; |
2115 dummy.window = dummy.root; | 2120 dummy.window = dummy.root; |
2116 dummy.subwindow = dummy.root; | 2121 dummy.subwindow = dummy.root; |
2117 dummy.x_root = x; | 2122 dummy.x_root = x; |
2118 dummy.y_root = y; | 2123 dummy.y_root = y; |
2119 dummy.x = x; | 2124 dummy.x = x; |
2120 dummy.y = y; | 2125 dummy.y = y; |
2126 dummy.state = (FRAME_X_DISPLAY_INFO (f)->grabbed >> 1) * Button1Mask; | |
2127 dummy.button = 0; | |
2128 for (i = 0; i < 5; i++) | |
2129 if (FRAME_X_DISPLAY_INFO (f)->grabbed & (1 << i)) | |
2130 dummy.button = i; | |
2121 | 2131 |
2122 /* Don't allow any geometry request from the user. */ | 2132 /* Don't allow any geometry request from the user. */ |
2123 XtSetArg (av[ac], XtNgeometry, 0); ac++; | 2133 XtSetArg (av[ac], XtNgeometry, 0); ac++; |
2124 XtSetValues (menu, av, ac); | 2134 XtSetValues (menu, av, ac); |
2125 | 2135 |