Mercurial > emacs
comparison src/xmenu.c @ 9619:1c985426ad84
(xdialog_show, xmenu_show): Use grabbed field instead of x_mouse_grabbed.
(xmenu_show): Use the screen in FRAME_X_DISPLAY_INFO,
not the display's default screen.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 20 Oct 1994 06:39:00 +0000 |
parents | 1a85137cb257 |
children | 910da93766c8 |
comparison
equal
deleted
inserted
replaced
9618:9fe4987e4896 | 9619:1c985426ad84 |
---|---|
1504 TITLE is the specified menu title. | 1504 TITLE is the specified menu title. |
1505 ERROR is a place to store an error message string in case of failure. | 1505 ERROR is a place to store an error message string in case of failure. |
1506 (We return nil on failure, but the value doesn't actually matter.) */ | 1506 (We return nil on failure, but the value doesn't actually matter.) */ |
1507 | 1507 |
1508 #ifdef USE_X_TOOLKIT | 1508 #ifdef USE_X_TOOLKIT |
1509 | |
1510 extern unsigned int x_mouse_grabbed; | |
1511 | 1509 |
1512 /* We need a unique id for each widget handled by the Lucid Widget | 1510 /* We need a unique id for each widget handled by the Lucid Widget |
1513 library. This includes the frame main windows, popup menu and | 1511 library. This includes the frame main windows, popup menu and |
1514 dialog box. */ | 1512 dialog box. */ |
1515 LWLIB_ID widget_id_tick; | 1513 LWLIB_ID widget_id_tick; |
1986 #ifdef HAVE_X_WINDOWS | 1984 #ifdef HAVE_X_WINDOWS |
1987 /* State that no mouse buttons are now held. | 1985 /* State that no mouse buttons are now held. |
1988 That is not necessarily true, but the fiction leads to reasonable | 1986 That is not necessarily true, but the fiction leads to reasonable |
1989 results, and it is a pain to ask which are actually held now | 1987 results, and it is a pain to ask which are actually held now |
1990 or track this in the loop above. */ | 1988 or track this in the loop above. */ |
1991 x_mouse_grabbed = 0; | 1989 FRAME_X_DISPLAY_INFO (f)->grabbed = 0; |
1992 #endif | 1990 #endif |
1993 | 1991 |
1994 /* Unread any events that we got but did not handle. */ | 1992 /* Unread any events that we got but did not handle. */ |
1995 while (queue != NULL) | 1993 while (queue != NULL) |
1996 { | 1994 { |
2222 } | 2220 } |
2223 | 2221 |
2224 /* All set and ready to fly. */ | 2222 /* All set and ready to fly. */ |
2225 XMenuRecompute (FRAME_X_DISPLAY (f), menu); | 2223 XMenuRecompute (FRAME_X_DISPLAY (f), menu); |
2226 dispwidth = DisplayWidth (FRAME_X_DISPLAY (f), | 2224 dispwidth = DisplayWidth (FRAME_X_DISPLAY (f), |
2227 XDefaultScreen (FRAME_X_DISPLAY (f))); | 2225 FRAME_X_DISPLAY_INFO (f)->screen); |
2228 dispheight = DisplayHeight (FRAME_X_DISPLAY (f), | 2226 dispheight = DisplayHeight (FRAME_X_DISPLAY (f), |
2229 XDefaultScreen (FRAME_X_DISPLAY (f))); | 2227 FRAME_X_DISPLAY_INFO (f)->screen); |
2230 x = min (x, dispwidth); | 2228 x = min (x, dispwidth); |
2231 y = min (y, dispheight); | 2229 y = min (y, dispheight); |
2232 x = max (x, 1); | 2230 x = max (x, 1); |
2233 y = max (y, 1); | 2231 y = max (y, 1); |
2234 XMenuLocate (FRAME_X_DISPLAY (f), menu, 0, 0, x, y, | 2232 XMenuLocate (FRAME_X_DISPLAY (f), menu, 0, 0, x, y, |
2306 #ifdef HAVE_X_WINDOWS | 2304 #ifdef HAVE_X_WINDOWS |
2307 /* State that no mouse buttons are now held. | 2305 /* State that no mouse buttons are now held. |
2308 (The oldXMenu code doesn't track this info for us.) | 2306 (The oldXMenu code doesn't track this info for us.) |
2309 That is not necessarily true, but the fiction leads to reasonable | 2307 That is not necessarily true, but the fiction leads to reasonable |
2310 results, and it is a pain to ask which are actually held now. */ | 2308 results, and it is a pain to ask which are actually held now. */ |
2311 x_mouse_grabbed = 0; | 2309 FRAME_X_DISPLAY_INFO (f)->grabbed = 0; |
2312 #endif | 2310 #endif |
2313 | 2311 |
2314 return entry; | 2312 return entry; |
2315 } | 2313 } |
2316 | 2314 |