comparison src/xmenu.c @ 9572:b36d5e88cccc

*** empty log message ***
author Morten Welinder <terra@diku.dk>
date Mon, 17 Oct 1994 08:42:36 +0000
parents c5a0a84a76a7
children 1a85137cb257
comparison
equal deleted inserted replaced
9571:b37425ecb3f0 9572:b36d5e88cccc
40 #include "window.h" 40 #include "window.h"
41 #include "keyboard.h" 41 #include "keyboard.h"
42 #include "blockinput.h" 42 #include "blockinput.h"
43 #include "puresize.h" 43 #include "puresize.h"
44 44
45 #ifdef HAVE_X_WINDOWS
45 /* This may include sys/types.h, and that somehow loses 46 /* This may include sys/types.h, and that somehow loses
46 if this is not done before the other system files. */ 47 if this is not done before the other system files. */
47 #include "xterm.h" 48 #include "xterm.h"
49 #endif
48 50
49 /* Load sys/types.h if not already loaded. 51 /* Load sys/types.h if not already loaded.
50 In some systems loading it twice is suicidal. */ 52 In some systems loading it twice is suicidal. */
51 #ifndef makedev 53 #ifndef makedev
52 #include <sys/types.h> 54 #include <sys/types.h>
53 #endif 55 #endif
54 56
55 #include "dispextern.h" 57 #include "dispextern.h"
56 58
59 #ifdef HAVE_X_WINDOWS
57 #include "../oldXMenu/XMenu.h" 60 #include "../oldXMenu/XMenu.h"
61 #endif
58 62
59 #ifdef USE_X_TOOLKIT 63 #ifdef USE_X_TOOLKIT
60 #include <X11/Xlib.h> 64 #include <X11/Xlib.h>
61 #include <X11/IntrinsicP.h> 65 #include <X11/IntrinsicP.h>
62 #include <X11/CoreP.h> 66 #include <X11/CoreP.h>
757 /* Decode where to put the menu. */ 761 /* Decode where to put the menu. */
758 762
759 if (FRAMEP (window)) 763 if (FRAMEP (window))
760 { 764 {
761 f = XFRAME (window); 765 f = XFRAME (window);
762
763 xpos = 0; 766 xpos = 0;
764 ypos = 0; 767 ypos = 0;
765 } 768 }
766 else if (WINDOWP (window)) 769 else if (WINDOWP (window))
767 { 770 {
1967 } 1970 }
1968 } 1971 }
1969 } 1972 }
1970 pop_down: 1973 pop_down:
1971 1974
1975 #ifdef HAVE_X_WINDOWS
1972 /* State that no mouse buttons are now held. 1976 /* State that no mouse buttons are now held.
1973 That is not necessarily true, but the fiction leads to reasonable 1977 That is not necessarily true, but the fiction leads to reasonable
1974 results, and it is a pain to ask which are actually held now 1978 results, and it is a pain to ask which are actually held now
1975 or track this in the loop above. */ 1979 or track this in the loop above. */
1976 x_mouse_grabbed = 0; 1980 x_mouse_grabbed = 0;
1981 #endif
1977 1982
1978 /* Unread any events that we got but did not handle. */ 1983 /* Unread any events that we got but did not handle. */
1979 while (queue != NULL) 1984 while (queue != NULL)
1980 { 1985 {
1981 queue_tmp = queue; 1986 queue_tmp = queue;
2069 { 2074 {
2070 *error = "Can't create menu"; 2075 *error = "Can't create menu";
2071 return Qnil; 2076 return Qnil;
2072 } 2077 }
2073 2078
2079 #ifdef HAVE_X_WINDOWS
2074 /* Adjust coordinates to relative to the outer (window manager) window. */ 2080 /* Adjust coordinates to relative to the outer (window manager) window. */
2075 { 2081 {
2076 Window child; 2082 Window child;
2077 int win_x = 0, win_y = 0; 2083 int win_x = 0, win_y = 0;
2078 2084
2095 UNBLOCK_INPUT; 2101 UNBLOCK_INPUT;
2096 x += win_x; 2102 x += win_x;
2097 y += win_y; 2103 y += win_y;
2098 } 2104 }
2099 } 2105 }
2106 #endif /* HAVE_X_WINDOWS */
2100 2107
2101 /* Adjust coordinates to be root-window-relative. */ 2108 /* Adjust coordinates to be root-window-relative. */
2102 x += f->display.x->left_pos; 2109 x += f->display.x->left_pos;
2103 y += f->display.x->top_pos; 2110 y += f->display.x->top_pos;
2104 2111
2280 entry = Qnil; 2287 entry = Qnil;
2281 break; 2288 break;
2282 } 2289 }
2283 XMenuDestroy (XDISPLAY menu); 2290 XMenuDestroy (XDISPLAY menu);
2284 2291
2292 #ifdef HAVE_X_WINDOWS
2285 /* State that no mouse buttons are now held. 2293 /* State that no mouse buttons are now held.
2286 (The oldXMenu code doesn't track this info for us.) 2294 (The oldXMenu code doesn't track this info for us.)
2287 That is not necessarily true, but the fiction leads to reasonable 2295 That is not necessarily true, but the fiction leads to reasonable
2288 results, and it is a pain to ask which are actually held now. */ 2296 results, and it is a pain to ask which are actually held now. */
2289 x_mouse_grabbed = 0; 2297 x_mouse_grabbed = 0;
2298 #endif
2290 2299
2291 return entry; 2300 return entry;
2292 } 2301 }
2293 2302
2294 #endif /* not USE_X_TOOLKIT */ 2303 #endif /* not USE_X_TOOLKIT */