comparison src/frame-x.c @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents 2f8bb876ab1d
children da8ed4261e83
comparison
equal deleted inserted replaced
411:12e008d41344 412:697ef44129c6
48 #include "events.h" 48 #include "events.h"
49 #include "extents.h" 49 #include "extents.h"
50 #include "faces.h" 50 #include "faces.h"
51 #include "frame.h" 51 #include "frame.h"
52 #include "window.h" 52 #include "window.h"
53 #include "gutter.h"
54 53
55 #ifdef HAVE_DRAGNDROP 54 #ifdef HAVE_DRAGNDROP
56 #include "dragdrop.h" 55 #include "dragdrop.h"
57 #endif 56 #endif
58 57
102 /* Like x_window_to_frame but also compares the window with the widget's 101 /* Like x_window_to_frame but also compares the window with the widget's
103 windows */ 102 windows */
104 struct frame * 103 struct frame *
105 x_any_window_to_frame (struct device *d, Window wdesc) 104 x_any_window_to_frame (struct device *d, Window wdesc)
106 { 105 {
107 Widget w;
108 assert (DEVICE_X_P (d));
109
110 w = XtWindowToWidget (DEVICE_X_DISPLAY (d), wdesc);
111
112 if (!w)
113 return 0;
114
115 /* We used to map over all frames here and then map over all widgets
116 belonging to that frame. However it turns out that this was very fragile
117 as it requires our display stuctures to be in sync _and_ that the
118 loop is told about every new widget somebody adds. Therefore we
119 now let Xt find it for us (which does a bottom-up search which
120 could even be faster) */
121 return x_any_widget_or_parent_to_frame (d, w);
122 }
123
124 static struct frame *
125 x_find_frame_for_window (struct device *d, Window wdesc)
126 {
127 Lisp_Object tail, frame; 106 Lisp_Object tail, frame;
128 struct frame *f; 107 struct frame *f;
108
109 assert (DEVICE_X_P (d));
110
129 /* This function was previously written to accept only a window argument 111 /* This function was previously written to accept only a window argument
130 (and to loop over all devices looking for a matching window), but 112 (and to loop over all devices looking for a matching window), but
131 that is incorrect because window ID's are not unique across displays. */ 113 that is incorrect because window ID's are not unique across displays. */
132 114
133 for (tail = DEVICE_FRAME_LIST (d); CONSP (tail); tail = XCDR (tail)) 115 for (tail = DEVICE_FRAME_LIST (d); CONSP (tail); tail = XCDR (tail))
134 { 116 {
117 int i;
118
135 frame = XCAR (tail); 119 frame = XCAR (tail);
136 f = XFRAME (frame); 120 f = XFRAME (frame);
137 /* This frame matches if the window is any of its widgets. */ 121 /* This frame matches if the window is any of its widgets. */
138 if (wdesc == XtWindow (FRAME_X_SHELL_WIDGET (f)) || 122 if (wdesc == XtWindow (FRAME_X_SHELL_WIDGET (f)) ||
139 wdesc == XtWindow (FRAME_X_CONTAINER_WIDGET (f)) || 123 wdesc == XtWindow (FRAME_X_CONTAINER_WIDGET (f)) ||
152 for this statement is that, in the old (broken) event loop, where 136 for this statement is that, in the old (broken) event loop, where
153 not all events went through XtDispatchEvent(), psheet events 137 not all events went through XtDispatchEvent(), psheet events
154 would incorrectly get sucked away by Emacs if this function matched 138 would incorrectly get sucked away by Emacs if this function matched
155 on psheet widgets. */ 139 on psheet widgets. */
156 140
157 /* Note: that this called only from 141 for (i = 0; i < FRAME_X_NUM_TOP_WIDGETS (f); i++)
158 x_any_widget_or_parent_to_frame it is unnecessary to iterate 142 {
159 over the top level widgets. */ 143 Widget wid = FRAME_X_TOP_WIDGETS (f)[i];
160 144 if (wid && XtIsManaged (wid) && wdesc == XtWindow (wid))
161 /* Note: we use to special case scrollbars but this turns out to be a bad idea 145 return f;
162 because 146 }
163 1. We sometimes get events for _unmapped_ scrollbars and our 147
164 callers don't want us to fail. 148 #ifdef HAVE_SCROLLBARS
165 2. Starting with the 21.2 widget stuff there are now loads of 149 /* Match if the window is one of this frame's scrollbars. */
166 widgets to check and it is easy to forget adding them in a loop here. 150 if (x_window_is_scrollbar (f, wdesc))
167 See x_any_window_to_frame 151 return f;
168 3. We pick up all widgets now anyway. */ 152 #endif
169 } 153 }
170 154
171 return 0; 155 return 0;
172 } 156 }
173 157
174 struct frame * 158 struct frame *
175 x_any_widget_or_parent_to_frame (struct device *d, Widget widget) 159 x_any_widget_or_parent_to_frame (struct device *d, Widget widget)
176 { 160 {
177 while (widget) 161 while (widget)
178 { 162 {
179 struct frame *f = x_find_frame_for_window (d, XtWindow (widget)); 163 struct frame *f = x_any_window_to_frame (d, XtWindow (widget));
180 if (f) 164 if (f)
181 return f; 165 return f;
182 widget = XtParent (widget); 166 widget = XtParent (widget);
183 } 167 }
184 168
342 classhint.res_name = frame_name; 326 classhint.res_name = frame_name;
343 classhint.res_class = app_class; 327 classhint.res_class = app_class;
344 XSetClassHint (dpy, XtWindow (shell), &classhint); 328 XSetClassHint (dpy, XtWindow (shell), &classhint);
345 } 329 }
346 330
347 #ifndef HAVE_WMCOMMAND 331 #ifndef HAVE_SESSION
348 static void 332 static void
349 x_wm_maybe_store_wm_command (struct frame *f) 333 x_wm_maybe_store_wm_command (struct frame *f)
350 { 334 {
351 Widget w = FRAME_X_SHELL_WIDGET (f); 335 Widget w = FRAME_X_SHELL_WIDGET (f);
352 struct device *d = XDEVICE (FRAME_DEVICE (f)); 336 struct device *d = XDEVICE (FRAME_DEVICE (f));
393 377
394 x_wm_maybe_store_wm_command (f); 378 x_wm_maybe_store_wm_command (f);
395 379
396 } 380 }
397 } 381 }
398 #endif /* !HAVE_WMCOMMAND */ 382 #endif /* !HAVE_SESSION */
399 383
400 static int 384 static int
401 x_frame_iconified_p (struct frame *f) 385 x_frame_iconified_p (struct frame *f)
402 { 386 {
403 Atom actual_type; 387 Atom actual_type;
435 419
436 static void 420 static void
437 init_x_prop_symbols (void) 421 init_x_prop_symbols (void)
438 { 422 {
439 #define def(sym, rsrc) \ 423 #define def(sym, rsrc) \
440 Fput (sym, Qx_resource_name, build_string (rsrc)) 424 pure_put (sym, Qx_resource_name, build_string (rsrc))
441 #define defi(sym,rsrc) \ 425 #define defi(sym,rsrc) \
442 def (sym, rsrc); Fput (sym, Qintegerp, Qt) 426 def (sym, rsrc); pure_put (sym, Qintegerp, Qt)
443 427
444 #if 0 /* this interferes with things. #### fix this right */ 428 #if 0 /* this interferes with things. #### fix this right */
445 def (Qminibuffer, XtNminibuffer); 429 def (Qminibuffer, XtNminibuffer);
446 def (Qunsplittable, XtNunsplittable); 430 def (Qunsplittable, XtNunsplittable);
447 #endif 431 #endif
658 Bufbyte *ptr; 642 Bufbyte *ptr;
659 /* Optimize for common ASCII case */ 643 /* Optimize for common ASCII case */
660 for (ptr = value; *ptr; ptr++) 644 for (ptr = value; *ptr; ptr++)
661 if (!BYTE_ASCII_P (*ptr)) 645 if (!BYTE_ASCII_P (*ptr))
662 { 646 {
663 const char * tmp; 647 CONST char * tmp;
664 encoding = DEVICE_XATOM_COMPOUND_TEXT (XDEVICE (FRAME_DEVICE (f))); 648 encoding = DEVICE_XATOM_COMPOUND_TEXT (XDEVICE (FRAME_DEVICE (f)));
665 TO_EXTERNAL_FORMAT (C_STRING, value, 649 GET_C_CHARPTR_EXT_CTEXT_DATA_ALLOCA ((CONST char *) value, tmp);
666 C_STRING_ALLOCA, tmp,
667 Qctext);
668 new_XtValue = (String) tmp; 650 new_XtValue = (String) tmp;
669 break; 651 break;
670 } 652 }
671 #endif /* MULE */ 653 #endif /* MULE */
672 654
673 /* #### Caching is device-independent - belongs in update_frame_title. */ 655 /* ### Caching is device-independent - belongs in update_frame_title. */
674 Xt_GET_VALUE (FRAME_X_SHELL_WIDGET (f), Xt_resource_name, &old_XtValue); 656 Xt_GET_VALUE (FRAME_X_SHELL_WIDGET (f), Xt_resource_name, &old_XtValue);
675 if (!old_XtValue || strcmp (new_XtValue, old_XtValue)) 657 if (!old_XtValue || strcmp (new_XtValue, old_XtValue))
676 { 658 {
677 Arg al[2]; 659 Arg al[2];
678 XtSetArg (al[0], Xt_resource_name, new_XtValue); 660 XtSetArg (al[0], Xt_resource_name, new_XtValue);
759 Lisp_Object prop = Fcar (tail); 741 Lisp_Object prop = Fcar (tail);
760 Lisp_Object val = Fcar (Fcdr (tail)); 742 Lisp_Object val = Fcar (Fcdr (tail));
761 743
762 if (STRINGP (prop)) 744 if (STRINGP (prop))
763 { 745 {
764 const char *extprop; 746 CONST char *extprop;
765 747
766 if (XSTRING_LENGTH (prop) == 0) 748 if (XSTRING_LENGTH (prop) == 0)
767 continue; 749 continue;
768 750
769 TO_EXTERNAL_FORMAT (LISP_STRING, prop, 751 GET_C_STRING_CTEXT_DATA_ALLOCA (prop, extprop);
770 C_STRING_ALLOCA, extprop,
771 Qctext);
772 if (STRINGP (val)) 752 if (STRINGP (val))
773 { 753 {
774 const Extbyte *extval; 754 CONST Extbyte *extval;
775 Extcount extvallen; 755 Extcount extvallen;
776 756
777 TO_EXTERNAL_FORMAT (LISP_STRING, val, 757 GET_STRING_CTEXT_DATA_ALLOCA (val, extval, extvallen);
778 ALLOCA, (extval, extvallen),
779 Qctext);
780 XtVaSetValues (w, XtVaTypedArg, extprop, 758 XtVaSetValues (w, XtVaTypedArg, extprop,
781 XtRString, extval, extvallen + 1, 759 XtRString, extval, extvallen + 1,
782 (XtArgVal) NULL); 760 (XtArgVal) NULL);
783 } 761 }
784 else 762 else
1108 struct x_device *xd = DEVICE_X_DATA (d); 1086 struct x_device *xd = DEVICE_X_DATA (d);
1109 XWindowAttributes win_attrib; 1087 XWindowAttributes win_attrib;
1110 unsigned int modifier = 0, state = 0; 1088 unsigned int modifier = 0, state = 0;
1111 char *Ctext; 1089 char *Ctext;
1112 int numItems = 0, textlen = 0, pos = 0; 1090 int numItems = 0, textlen = 0, pos = 0;
1113 Lisp_Event *lisp_event = XEVENT (event); 1091 struct Lisp_Event *lisp_event = XEVENT(event);
1114 Lisp_Object item = Qnil; 1092 Lisp_Object item = Qnil;
1115 struct gcpro gcpro1; 1093 struct gcpro gcpro1;
1116 1094
1117 /* only drag if this is really a press */ 1095 /* only drag if this is really a press */
1118 if (EVENT_TYPE(lisp_event) != button_press_event 1096 if (EVENT_TYPE(lisp_event) != button_press_event
1145 { 1123 {
1146 x_event.xbutton.x_root = lisp_event->event.button.x; /* this is wrong */ 1124 x_event.xbutton.x_root = lisp_event->event.button.x; /* this is wrong */
1147 x_event.xbutton.y_root = lisp_event->event.button.y; 1125 x_event.xbutton.y_root = lisp_event->event.button.y;
1148 } 1126 }
1149 modifier = lisp_event->event.button.modifiers; 1127 modifier = lisp_event->event.button.modifiers;
1150 if (modifier & XEMACS_MOD_SHIFT) state |= ShiftMask; 1128 if (modifier & MOD_SHIFT) state |= ShiftMask;
1151 if (modifier & XEMACS_MOD_CONTROL) state |= ControlMask; 1129 if (modifier & MOD_CONTROL) state |= ControlMask;
1152 if (modifier & XEMACS_MOD_META) state |= xd->MetaMask; 1130 if (modifier & MOD_META) state |= xd->MetaMask;
1153 if (modifier & XEMACS_MOD_SUPER) state |= xd->SuperMask; 1131 if (modifier & MOD_SUPER) state |= xd->SuperMask;
1154 if (modifier & XEMACS_MOD_HYPER) state |= xd->HyperMask; 1132 if (modifier & MOD_HYPER) state |= xd->HyperMask;
1155 if (modifier & XEMACS_MOD_ALT) state |= xd->AltMask; 1133 if (modifier & MOD_ALT) state |= xd->AltMask;
1156 state |= Button1Mask << (lisp_event->event.button.button-1); 1134 state |= Button1Mask << (lisp_event->event.button.button-1);
1157 1135
1158 x_event.xbutton.state = state; 1136 x_event.xbutton.state = state;
1159 x_event.xbutton.button = lisp_event->event.button.button; 1137 x_event.xbutton.button = lisp_event->event.button.button;
1160 x_event.xkey.same_screen = True; 1138 x_event.xkey.same_screen = True;
1190 numItems=0; 1168 numItems=0;
1191 xfree(Ctext); 1169 xfree(Ctext);
1192 Ctext=NULL; 1170 Ctext=NULL;
1193 break; 1171 break;
1194 } 1172 }
1195 strcpy (Ctext+pos, (const char *)XSTRING_DATA (XCAR (item))); 1173 strcpy (Ctext+pos, (CONST char *)XSTRING_DATA (XCAR (item)));
1196 pos += XSTRING_LENGTH (XCAR (item)) + 1; 1174 pos += XSTRING_LENGTH (XCAR (item)) + 1;
1197 item = XCDR (item); 1175 item = XCDR (item);
1198 } 1176 }
1199 Ctext[pos] = 0; 1177 Ctext[pos] = 0;
1200 1178
1260 1238
1261 for (ii = 0; ii < transferInfo->dropData->numItems; ii++) 1239 for (ii = 0; ii < transferInfo->dropData->numItems; ii++)
1262 { 1240 {
1263 filePath = transferInfo->dropData->data.files[ii]; 1241 filePath = transferInfo->dropData->data.files[ii];
1264 hurl = dnd_url_hexify_string ((char *)filePath, "file:"); 1242 hurl = dnd_url_hexify_string ((char *)filePath, "file:");
1265 /* #### Mule-izing required */ 1243 /* ### Mule-izing required */
1266 l_data = Fcons (make_string ((Bufbyte* )hurl, 1244 l_data = Fcons (make_string ((Bufbyte* )hurl,
1267 strlen (hurl)), 1245 strlen (hurl)),
1268 l_data); 1246 l_data);
1269 xfree (hurl); 1247 xfree (hurl);
1270 } 1248 }
1335 XWindowAttributes win_attrib; 1313 XWindowAttributes win_attrib;
1336 unsigned int modifier = 0, state = 0; 1314 unsigned int modifier = 0, state = 0;
1337 char *dnd_data = NULL; 1315 char *dnd_data = NULL;
1338 unsigned long dnd_len = 0; 1316 unsigned long dnd_len = 0;
1339 int dnd_typ = DndText, dnd_dealloc = 0; 1317 int dnd_typ = DndText, dnd_dealloc = 0;
1340 Lisp_Event *lisp_event = XEVENT (event); 1318 struct Lisp_Event *lisp_event = XEVENT(event);
1341 1319
1342 /* only drag if this is really a press */ 1320 /* only drag if this is really a press */
1343 if (EVENT_TYPE(lisp_event) != button_press_event) 1321 if (EVENT_TYPE(lisp_event) != button_press_event)
1344 return Qnil; 1322 return Qnil;
1345 1323
1366 xfree (dnd_data); 1344 xfree (dnd_data);
1367 return Qnil; 1345 return Qnil;
1368 } 1346 }
1369 len = XSTRING_LENGTH (XCAR (run)) + 1; 1347 len = XSTRING_LENGTH (XCAR (run)) + 1;
1370 dnd_data = (char *) xrealloc (dnd_data, dnd_len + len); 1348 dnd_data = (char *) xrealloc (dnd_data, dnd_len + len);
1371 strcpy (dnd_data + dnd_len - 1, (const char *)XSTRING_DATA (XCAR (run))); 1349 strcpy (dnd_data + dnd_len - 1, (CONST char *)XSTRING_DATA (XCAR (run)));
1372 dnd_len += len; 1350 dnd_len += len;
1373 run = XCDR (run); 1351 run = XCDR (run);
1374 } 1352 }
1375 1353
1376 dnd_data[dnd_len - 1] = 0; /* the list-ending zero */ 1354 dnd_data[dnd_len - 1] = 0; /* the list-ending zero */
1411 x_event.xbutton.x_root = lisp_event->event.button.x; /* this is wrong */ 1389 x_event.xbutton.x_root = lisp_event->event.button.x; /* this is wrong */
1412 x_event.xbutton.y_root = lisp_event->event.button.y; 1390 x_event.xbutton.y_root = lisp_event->event.button.y;
1413 } 1391 }
1414 1392
1415 modifier = lisp_event->event.button.modifiers; 1393 modifier = lisp_event->event.button.modifiers;
1416 if (modifier & XEMACS_MOD_SHIFT) state |= ShiftMask; 1394 if (modifier & MOD_SHIFT) state |= ShiftMask;
1417 if (modifier & XEMACS_MOD_CONTROL) state |= ControlMask; 1395 if (modifier & MOD_CONTROL) state |= ControlMask;
1418 if (modifier & XEMACS_MOD_META) state |= xd->MetaMask; 1396 if (modifier & MOD_META) state |= xd->MetaMask;
1419 if (modifier & XEMACS_MOD_SUPER) state |= xd->SuperMask; 1397 if (modifier & MOD_SUPER) state |= xd->SuperMask;
1420 if (modifier & XEMACS_MOD_HYPER) state |= xd->HyperMask; 1398 if (modifier & MOD_HYPER) state |= xd->HyperMask;
1421 if (modifier & XEMACS_MOD_ALT) state |= xd->AltMask; 1399 if (modifier & MOD_ALT) state |= xd->AltMask;
1422 state |= Button1Mask << (lisp_event->event.button.button-1); 1400 state |= Button1Mask << (lisp_event->event.button.button-1);
1423 1401
1424 x_event.xbutton.state = state; 1402 x_event.xbutton.state = state;
1425 x_event.xbutton.button = lisp_event->event.button.button; 1403 x_event.xbutton.button = lisp_event->event.button.button;
1426 x_event.xkey.same_screen = True; 1404 x_event.xkey.same_screen = True;
1549 /* set the position of the frame's root window now. When the 1527 /* set the position of the frame's root window now. When the
1550 frame was created, the position was initialized to (0,0). */ 1528 frame was created, the position was initialized to (0,0). */
1551 { 1529 {
1552 struct window *win = XWINDOW (f->root_window); 1530 struct window *win = XWINDOW (f->root_window);
1553 1531
1554 WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f) 1532 WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f);
1555 + FRAME_LEFT_GUTTER_BOUNDS (f); 1533 WINDOW_TOP (win) = FRAME_TOP_BORDER_END (f);
1556 WINDOW_TOP (win) = FRAME_TOP_BORDER_END (f)
1557 + FRAME_TOP_GUTTER_BOUNDS (f);
1558 1534
1559 if (!NILP (f->minibuffer_window)) 1535 if (!NILP (f->minibuffer_window))
1560 { 1536 {
1561 win = XWINDOW (f->minibuffer_window); 1537 win = XWINDOW (f->minibuffer_window);
1562 WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f) 1538 WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f);
1563 + FRAME_LEFT_GUTTER_BOUNDS (f);
1564 } 1539 }
1565 } 1540 }
1566 1541
1567 #ifdef EXTERNAL_WIDGET 1542 #ifdef EXTERNAL_WIDGET
1568 /* If we're an external widget, then the size of the frame is predetermined 1543 /* If we're an external widget, then the size of the frame is predetermined
1863 int depth = DEVICE_X_DEPTH (d); 1838 int depth = DEVICE_X_DEPTH (d);
1864 Colormap cmap = DEVICE_X_COLORMAP (d); 1839 Colormap cmap = DEVICE_X_COLORMAP (d);
1865 #ifdef EXTERNAL_WIDGET 1840 #ifdef EXTERNAL_WIDGET
1866 Window window_id = 0; 1841 Window window_id = 0;
1867 #endif 1842 #endif
1868 const char *name; 1843 CONST char *name;
1869 Arg al [25]; 1844 Arg al [25];
1870 int ac = 0; 1845 int ac = 0;
1871 Widget text, container, shell; 1846 Widget text, container, shell;
1872 Widget parentwid = 0; 1847 Widget parentwid = 0;
1873 #ifdef HAVE_MENUBARS 1848 #ifdef HAVE_MENUBARS
1874 int menubar_visible; 1849 int menubar_visible;
1875 Widget menubar; 1850 Widget menubar;
1876 #endif 1851 #endif
1877 1852
1878 if (STRINGP (f->name)) 1853 if (STRINGP (f->name))
1879 TO_EXTERNAL_FORMAT (LISP_STRING, f->name, 1854 GET_C_STRING_CTEXT_DATA_ALLOCA (f->name, name);
1880 C_STRING_ALLOCA, name,
1881 Qctext);
1882 else 1855 else
1883 name = "emacs"; 1856 name = "emacs";
1884 1857
1885 /* The widget hierarchy is 1858 /* The widget hierarchy is
1886 1859
1905 if (!NILP (lisp_window_id)) 1878 if (!NILP (lisp_window_id))
1906 { 1879 {
1907 char *string; 1880 char *string;
1908 1881
1909 CHECK_STRING (lisp_window_id); 1882 CHECK_STRING (lisp_window_id);
1910 string = (char *) XSTRING_DATA (lisp_window_id); 1883 string = (char *) (XSTRING_DATA (lisp_window_id));
1911 if (string[0] == '0' && (string[1] == 'x' || string[1] == 'X')) 1884 if (string[0] == '0' && (string[1] == 'x' || string[1] == 'X'))
1912 sscanf (string+2, "%lxu", &window_id); 1885 sscanf (string+2, "%lxu", &window_id);
1913 #if 0 1886 #if 0
1914 else if (string[0] == 'w') 1887 else if (string[0] == 'w')
1915 { 1888 {
2084 if (FRAME_X_TOP_LEVEL_FRAME_P (f)) 2057 if (FRAME_X_TOP_LEVEL_FRAME_P (f))
2085 { 2058 {
2086 /* tell the window manager about us. */ 2059 /* tell the window manager about us. */
2087 x_wm_store_class_hints (shell_widget, XtName (frame_widget)); 2060 x_wm_store_class_hints (shell_widget, XtName (frame_widget));
2088 2061
2089 #ifndef HAVE_WMCOMMAND 2062 #ifndef HAVE_SESSION
2090 x_wm_maybe_store_wm_command (f); 2063 x_wm_maybe_store_wm_command (f);
2091 #endif /* HAVE_WMCOMMAND */ 2064 #endif /* HAVE_SESSION */
2092 2065
2093 x_wm_hack_wm_protocols (shell_widget); 2066 x_wm_hack_wm_protocols (shell_widget);
2094 } 2067 }
2095 2068
2096 #ifdef HAVE_XIM 2069 #ifdef HAVE_XIM
2215 2188
2216 x_popup_frame (f); 2189 x_popup_frame (f);
2217 } 2190 }
2218 2191
2219 static void 2192 static void
2220 x_mark_frame (struct frame *f) 2193 x_mark_frame (struct frame *f, void (*markobj) (Lisp_Object))
2221 { 2194 {
2222 mark_object (FRAME_X_ICON_PIXMAP (f)); 2195 markobj (FRAME_X_ICON_PIXMAP (f));
2223 mark_object (FRAME_X_ICON_PIXMAP_MASK (f)); 2196 markobj (FRAME_X_ICON_PIXMAP_MASK (f));
2224 } 2197 }
2225 2198
2226 static void 2199 static void
2227 x_set_frame_icon (struct frame *f) 2200 x_set_frame_icon (struct frame *f)
2228 { 2201 {
2650 static void 2623 static void
2651 x_delete_frame (struct frame *f) 2624 x_delete_frame (struct frame *f)
2652 { 2625 {
2653 Display *dpy; 2626 Display *dpy;
2654 2627
2655 #ifndef HAVE_WMCOMMAND 2628 #ifndef HAVE_SESSION
2656 if (FRAME_X_TOP_LEVEL_FRAME_P (f)) 2629 if (FRAME_X_TOP_LEVEL_FRAME_P (f))
2657 x_wm_maybe_move_wm_command (f); 2630 x_wm_maybe_move_wm_command (f);
2658 #endif /* HAVE_WMCOMMAND */ 2631 #endif /* HAVE_SESSION */
2659 2632
2660 #ifdef HAVE_CDE 2633 #ifdef HAVE_CDE
2661 DtDndDropUnregister (FRAME_X_TEXT_WIDGET (f)); 2634 DtDndDropUnregister (FRAME_X_TEXT_WIDGET (f));
2662 #endif /* HAVE_CDE */ 2635 #endif /* HAVE_CDE */
2663 2636
2674 XtDestroyWidget (FRAME_X_SHELL_WIDGET (f)); 2647 XtDestroyWidget (FRAME_X_SHELL_WIDGET (f));
2675 x_error_occurred_p (XtDisplay (FRAME_X_SHELL_WIDGET (f))); 2648 x_error_occurred_p (XtDisplay (FRAME_X_SHELL_WIDGET (f)));
2676 #else 2649 #else
2677 XtDestroyWidget (FRAME_X_SHELL_WIDGET (f)); 2650 XtDestroyWidget (FRAME_X_SHELL_WIDGET (f));
2678 /* make sure the windows are really gone! */ 2651 /* make sure the windows are really gone! */
2679 /* #### Is this REALLY necessary? */ 2652 /* ### Is this REALLY necessary? */
2680 XFlush (dpy); 2653 XFlush (dpy);
2681 #endif /* EXTERNAL_WIDGET */ 2654 #endif /* EXTERNAL_WIDGET */
2682 2655
2683 FRAME_X_SHELL_WIDGET (f) = 0; 2656 FRAME_X_SHELL_WIDGET (f) = 0;
2684 2657