aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-05-21 05:36:07 +0000
committerRichard M. Stallman1994-05-21 05:36:07 +0000
commit546e6d5b17ff84f69dc76e78567b032ea846a999 (patch)
tree66f875663ad7ceb4e667a205522ff7af53c6135c /src
parent574efc83870d19cb039342fae76543a2652d8aa8 (diff)
downloademacs-546e6d5b17ff84f69dc76e78567b032ea846a999.tar.gz
emacs-546e6d5b17ff84f69dc76e78567b032ea846a999.zip
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
(x_iconify_frame) [USE_X_TOOLKIT]: New code for invisible window case. (XtNinitialState) [USE_X_TOOLKIT]: New #define. (x_make_frame_invisible): Mostly combine toolkit/non-toolkit cases, in the process fixing a dumb bug. (x_iconify_frame): Fix error messages.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c60
1 files changed, 37 insertions, 23 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 0b604dba749..dd8c0cf5446 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -96,6 +96,12 @@ extern void _XEditResCheckMessages ();
96#define x_top_window_to_frame x_window_to_frame 96#define x_top_window_to_frame x_window_to_frame
97#endif 97#endif
98 98
99#ifdef USE_X_TOOLKIT
100#ifndef XtNinitialState
101#define XtNinitialState "initialState"
102#endif
103#endif
104
99#ifdef HAVE_X11 105#ifdef HAVE_X11
100#define XMapWindow XMapRaised /* Raise them when mapping. */ 106#define XMapWindow XMapRaised /* Raise them when mapping. */
101#else /* ! defined (HAVE_X11) */ 107#else /* ! defined (HAVE_X11) */
@@ -5505,6 +5511,14 @@ x_make_frame_invisible (f)
5505 struct frame *f; 5511 struct frame *f;
5506{ 5512{
5507 int mask; 5513 int mask;
5514 Window window;
5515
5516#ifdef USE_X_TOOLKIT
5517 /* Use the frame's outermost window, not the one we normally draw on. */
5518 window = XtWindow (f->display.x->widget);
5519#else /* not USE_X_TOOLKIT */
5520 window = FRAME_X_WINDOW (f);
5521#endif /* not USE_X_TOOLKIT */
5508 5522
5509 /* Don't keep the highlight on an invisible frame. */ 5523 /* Don't keep the highlight on an invisible frame. */
5510 if (x_highlight_frame == f) 5524 if (x_highlight_frame == f)
@@ -5526,18 +5540,12 @@ x_make_frame_invisible (f)
5526 5540
5527#ifdef HAVE_X11R4 5541#ifdef HAVE_X11R4
5528 5542
5529#ifdef USE_X_TOOLKIT 5543 if (! XWithdrawWindow (x_current_display, window,
5530 if (! XWithdrawWindow (x_current_display, XtWindow (f->display.x->widget),
5531 DefaultScreen (x_current_display)))
5532#else /* not USE_X_TOOLKIT */
5533 if (! XWithdrawWindow (x_current_display, FRAME_X_WINDOW (f),
5534 DefaultScreen (x_current_display))) 5544 DefaultScreen (x_current_display)))
5535 { 5545 {
5536 UNBLOCK_INPUT_RESIGNAL; 5546 UNBLOCK_INPUT_RESIGNAL;
5537 error ("can't notify window manager of window withdrawal"); 5547 error ("Can't notify window manager of window withdrawal");
5538 } 5548 }
5539#endif /* not USE_X_TOOLKIT */
5540
5541#else /* ! defined (HAVE_X11R4) */ 5549#else /* ! defined (HAVE_X11R4) */
5542#ifdef HAVE_X11 5550#ifdef HAVE_X11
5543 5551
@@ -5547,11 +5555,7 @@ x_make_frame_invisible (f)
5547 XEvent unmap; 5555 XEvent unmap;
5548 5556
5549 unmap.xunmap.type = UnmapNotify; 5557 unmap.xunmap.type = UnmapNotify;
5550#ifdef USE_X_TOOLKIT 5558 unmap.xunmap.window = window;
5551 unmap.xunmap.window = XtWindow (f->display.x->widget);
5552#else /* not USE_X_TOOLKIT */
5553 unmap.xunmap.window = FRAME_X_WINDOW (f);
5554#endif /* not USE_X_TOOLKIT */
5555 unmap.xunmap.event = DefaultRootWindow (x_current_display); 5559 unmap.xunmap.event = DefaultRootWindow (x_current_display);
5556 unmap.xunmap.from_configure = False; 5560 unmap.xunmap.from_configure = False;
5557 if (! XSendEvent (x_current_display, 5561 if (! XSendEvent (x_current_display,
@@ -5561,16 +5565,12 @@ x_make_frame_invisible (f)
5561 &unmap)) 5565 &unmap))
5562 { 5566 {
5563 UNBLOCK_INPUT_RESIGNAL; 5567 UNBLOCK_INPUT_RESIGNAL;
5564 error ("can't notify window manager of withdrawal"); 5568 error ("Can't notify window manager of withdrawal");
5565 } 5569 }
5566 } 5570 }
5567 5571
5568 /* Unmap the window ourselves. Cheeky! */ 5572 /* Unmap the window ourselves. Cheeky! */
5569#ifdef USE_X_TOOLKIT 5573 XUnmapWindow (x_current_display, window);
5570 XUnmapWindow (x_current_display, XtWindow (f->display.x->widget));
5571#else /* not USE_X_TOOLKIT */
5572 XUnmapWindow (x_current_display, FRAME_X_WINDOW (f));
5573#endif /* not USE_X_TOOLKIT */
5574#else /* ! defined (HAVE_X11) */ 5574#else /* ! defined (HAVE_X11) */
5575 5575
5576 XUnmapWindow (FRAME_X_WINDOW (f)); 5576 XUnmapWindow (FRAME_X_WINDOW (f));
@@ -5612,13 +5612,24 @@ x_iconify_frame (f)
5612 5612
5613#ifdef USE_X_TOOLKIT 5613#ifdef USE_X_TOOLKIT
5614 BLOCK_INPUT; 5614 BLOCK_INPUT;
5615
5616 if (! FRAME_VISIBLE_P (f))
5617 {
5618 if (! EQ (Vx_no_window_manager, Qt))
5619 x_wm_set_window_state (f, IconicState);
5620 /* This was XtPopup, but that did nothing for an iconified frame. */
5621 XtMapWidget (f->display.x->widget);
5622 UNBLOCK_INPUT;
5623 return;
5624 }
5625
5615 result = XIconifyWindow (x_current_display, 5626 result = XIconifyWindow (x_current_display,
5616 XtWindow (f->display.x->widget), 5627 XtWindow (f->display.x->widget),
5617 DefaultScreen (x_current_display)); 5628 DefaultScreen (x_current_display));
5618 UNBLOCK_INPUT; 5629 UNBLOCK_INPUT;
5619 5630
5620 if (!result) 5631 if (!result)
5621 error ("Can't notify window manager of iconification."); 5632 error ("Can't notify window manager of iconification");
5622 5633
5623 f->async_iconified = 1; 5634 f->async_iconified = 1;
5624 5635
@@ -5651,7 +5662,7 @@ x_iconify_frame (f)
5651 &message)) 5662 &message))
5652 { 5663 {
5653 UNBLOCK_INPUT_RESIGNAL; 5664 UNBLOCK_INPUT_RESIGNAL;
5654 error ("Can't notify window manager of iconification."); 5665 error ("Can't notify window manager of iconification");
5655 } 5666 }
5656 } 5667 }
5657 5668
@@ -5927,15 +5938,18 @@ x_wm_set_window_state (f, state)
5927 int state; 5938 int state;
5928{ 5939{
5929#ifdef USE_X_TOOLKIT 5940#ifdef USE_X_TOOLKIT
5930 Window window = XtWindow (f->display.x->widget); 5941 Arg al[1];
5942
5943 XtSetArg (al[0], XtNinitialState, state);
5944 XtSetValues (f->display.x->widget, al, 1);
5931#else /* not USE_X_TOOLKIT */ 5945#else /* not USE_X_TOOLKIT */
5932 Window window = FRAME_X_WINDOW (f); 5946 Window window = FRAME_X_WINDOW (f);
5933#endif /* not USE_X_TOOLKIT */
5934 5947
5935 f->display.x->wm_hints.flags |= StateHint; 5948 f->display.x->wm_hints.flags |= StateHint;
5936 f->display.x->wm_hints.initial_state = state; 5949 f->display.x->wm_hints.initial_state = state;
5937 5950
5938 XSetWMHints (x_current_display, window, &f->display.x->wm_hints); 5951 XSetWMHints (x_current_display, window, &f->display.x->wm_hints);
5952#endif /* not USE_X_TOOLKIT */
5939} 5953}
5940 5954
5941x_wm_set_icon_pixmap (f, icon_pixmap) 5955x_wm_set_icon_pixmap (f, icon_pixmap)