diff options
author | mor <empty> | 1994-08-25 20:52:11 +0000 |
---|---|---|
committer | mor <empty> | 1994-08-25 20:52:11 +0000 |
commit | a3b0a38ed5631e01576ca39b309f29a42d9dbff1 (patch) | |
tree | c553d8b8997354fa13155fce175bc1095a89cd5b /xc/programs/twm | |
parent | 03accc6c4a2b1787d96dee6afb623196586728ee (diff) |
must save icon position, even if not currently iconified
Diffstat (limited to 'xc/programs/twm')
-rw-r--r-- | xc/programs/twm/add_window.c | 25 | ||||
-rw-r--r-- | xc/programs/twm/session.c | 25 | ||||
-rw-r--r-- | xc/programs/twm/twm.h | 5 |
3 files changed, 38 insertions, 17 deletions
diff --git a/xc/programs/twm/add_window.c b/xc/programs/twm/add_window.c index 8f13db971..5e223a634 100644 --- a/xc/programs/twm/add_window.c +++ b/xc/programs/twm/add_window.c @@ -53,7 +53,7 @@ in this Software without prior written authorization from the X Consortium. /********************************************************************** * - * $XConsortium: add_window.c,v 1.159 94/08/10 19:52:12 mor Exp mor $ + * $XConsortium: add_window.c,v 1.160 94/08/25 20:13:30 mor Exp mor $ * * Add a new window, put the titlbar and other stuff around * the window @@ -172,6 +172,7 @@ IconMgr *iconp; unsigned short saved_x, saved_y, saved_width, saved_height; unsigned short restore_icon_x, restore_icon_y; Bool restore_iconified = 0; + Bool restore_icon_info_present = 0; int restoredFromPrevSession; #ifdef DEBUG @@ -204,7 +205,8 @@ IconMgr *iconp; if (GetWindowConfig (tmp_win, &saved_x, &saved_y, &saved_width, &saved_height, - &restore_iconified, &restore_icon_x, &restore_icon_y)) + &restore_iconified, &restore_icon_info_present, + &restore_icon_x, &restore_icon_y)) { tmp_win->attr.x = saved_x; tmp_win->attr.y = saved_y; @@ -228,13 +230,20 @@ IconMgr *iconp; tmp_win->wmhints = XGetWMHints(dpy, tmp_win->w); - if (tmp_win->wmhints && restore_iconified) + if (tmp_win->wmhints) { - tmp_win->wmhints->initial_state = IconicState; - tmp_win->wmhints->flags |= StateHint; - tmp_win->wmhints->icon_x = restore_icon_x; - tmp_win->wmhints->icon_y = restore_icon_y; - tmp_win->wmhints->flags |= IconPositionHint; + if (restore_iconified) + { + tmp_win->wmhints->initial_state = IconicState; + tmp_win->wmhints->flags |= StateHint; + } + + if (restore_icon_info_present) + { + tmp_win->wmhints->icon_x = restore_icon_x; + tmp_win->wmhints->icon_y = restore_icon_y; + tmp_win->wmhints->flags |= IconPositionHint; + } } if (tmp_win->wmhints && (tmp_win->wmhints->flags & WindowGroupHint)) diff --git a/xc/programs/twm/session.c b/xc/programs/twm/session.c index d0c9d930e..3ff94f921 100644 --- a/xc/programs/twm/session.c +++ b/xc/programs/twm/session.c @@ -1,4 +1,4 @@ -/* $XConsortium: session.c,v 1.10 94/08/10 19:51:21 mor Exp mor $ */ +/* $XConsortium: session.c,v 1.11 94/08/25 20:18:02 mor Exp mor $ */ /****************************************************************************** Copyright (c) 1994 X Consortium @@ -246,8 +246,9 @@ char **stringp; * arg LIST of bytes * * Iconified bool 1 + * Icon info present bool 1 * - * if iconified + * if icon info present * icon x 2 * icon y 2 * @@ -318,10 +319,13 @@ char *windowRole; } } - if (!write_byte (configFile, theWindow->icon ? 1 : 0)) + if (!write_byte (configFile, theWindow->icon ? 1 : 0)) /* iconified */ return 0; - if (theWindow->icon) + if (!write_byte (configFile, theWindow->icon_w ? 1 : 0)) /* icon exists */ + return 0; + + if (theWindow->icon_w) { int icon_x, icon_y; @@ -411,7 +415,11 @@ TWMWinConfigEntry **pentry; goto give_up; entry->iconified = byte; - if (entry->iconified) + if (!read_byte (configFile, &byte)) + goto give_up; + entry->icon_info_present = byte; + + if (entry->icon_info_present) { if (!read_short (configFile, &entry->icon_x)) goto give_up; @@ -496,11 +504,13 @@ char *filename; int -GetWindowConfig (theWindow, x, y, width, height, iconified, icon_x, icon_y) +GetWindowConfig (theWindow, x, y, width, height, + iconified, icon_info_present, icon_x, icon_y) TwmWindow *theWindow; unsigned short *x, *y, *width, *height; Bool *iconified; +Bool *icon_info_present; unsigned short *icon_x, *icon_y; { @@ -602,7 +612,8 @@ unsigned short *icon_x, *icon_y; *width = ptr->width; *height = ptr->height; *iconified = ptr->iconified; - if (*iconified) + *icon_info_present = ptr->icon_info_present; + if (*icon_info_present) { *icon_x = ptr->icon_x; *icon_y = ptr->icon_y; diff --git a/xc/programs/twm/twm.h b/xc/programs/twm/twm.h index b115c09c7..10da33e46 100644 --- a/xc/programs/twm/twm.h +++ b/xc/programs/twm/twm.h @@ -55,7 +55,7 @@ from the X Consortium. /*********************************************************************** * - * $XConsortium: twm.h,v 1.80 94/07/21 17:45:45 mor Exp mor $ + * $XConsortium: twm.h,v 1.81 94/08/25 20:10:31 mor Exp mor $ * * twm include file * @@ -321,8 +321,9 @@ typedef struct TWMWinConfigEntry char *wm_name; int wm_command_count; char **wm_command; - int iconified; unsigned short x, y, width, height; + Bool iconified; + Bool icon_info_present; unsigned short icon_x, icon_y; } TWMWinConfigEntry; |