From 4d8e691608e9f17f2fa9ccd98322c11096145dd2 Mon Sep 17 00:00:00 2001 From: richard Date: Fri, 9 Feb 2001 15:56:52 +0000 Subject: [PATCH] Make window stacking level changes to match GNUstep. --- ChangeLog | 2 ++ WINGs/WINGs/WINGs.h | 32 ++++++++++++++++++++++++-------- src/GNUstep.h | 27 +++++++++++++++++++++------ src/WindowMaker.h | 27 +++++++++++++++++++-------- src/window.c | 26 ++++++-------------------- wmlib/WMaker.h | 39 +++++++++++++++++++++++++++++---------- 6 files changed, 101 insertions(+), 52 deletions(-) diff --git a/ChangeLog b/ChangeLog index a8d00714..d20a50f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,8 @@ Changes since version 0.63.1: - integrated the 'no polling' patch from Jim Knoble . - new wsetfont script (Anton Zinoviev ) - lots of i18n fixes (Jan Tomka/judas@hell ) +- window levels changed to match GNUstep ... src/GNUstep.h + src/WindowMaker.h src/window.c wmlib/WMaker.h WINGs/WINGs/WINGs.h Changes since version 0.63.0: diff --git a/WINGs/WINGs/WINGs.h b/WINGs/WINGs/WINGs.h index 52d329d4..cf2f3d40 100644 --- a/WINGs/WINGs/WINGs.h +++ b/WINGs/WINGs/WINGs.h @@ -42,25 +42,41 @@ typedef struct { #define ClientMessageMask (1L<<30) -/* window stacking level */ +/* + * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h) + * NSDesktopWindowLevel intended to be the level at which things + * on the desktop sit ... so you should be able + * to put a desktop background just below it. + * + * Applications are actually permitted to use any value in the + * range INT_MIN+1 to INT_MAX + */ enum { - WMNormalWindowLevel = 0, - WMFloatingWindowLevel = 3, - WMDockWindowLevel = 5, - WMSubmenuWindowLevel = 10, - WMMainMenuWindowLevel = 20 + WMDesktopWindowLevel = -1000, /* GNUstep addition */ + WMNormalWindowLevel = 0, + WMFloatingWindowLevel = 3, + WMSubmenuWindowLevel = 3, + WMTornOffMenuWindowLevel = 3, + WMMainMenuWindowLevel = 20, + WMDockWindowLevel = 21, /* Deprecated - use NSStatusWindowLevel */ + WMStatusWindowLevel = 21, + WMModalPanelWindowLevel = 100, + WMPopUpMenuWindowLevel = 101, + WMScreenSaverWindowLevel = 1000 }; + /* window attributes */ enum { WMBorderlessWindowMask = 0, WMTitledWindowMask = 1, WMClosableWindowMask = 2, WMMiniaturizableWindowMask = 4, - WMResizableWindowMask = 8 + WMResizableWindowMask = 8, + WMIconWindowMask = 64, + WMMiniWindowMask = 128 }; - /* button types */ typedef enum { /* 0 is reserved for internal use */ diff --git a/src/GNUstep.h b/src/GNUstep.h index 52d1e8df..2529fc90 100644 --- a/src/GNUstep.h +++ b/src/GNUstep.h @@ -54,15 +54,30 @@ enum { }; #ifndef _WINGS_H_ -/* window stacking level */ +/* + * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h) + * NSDesktopWindowLevel intended to be the level at which things + * on the desktop sit ... so you should be able + * to put a desktop background just below it. + * + * Applications are actually permitted to use any value in the + * range INT_MIN+1 to INT_MAX + */ enum { - WMNormalWindowLevel = 0, - WMFloatingWindowLevel = 3, - WMDockWindowLevel = 5, - WMSubmenuWindowLevel = 10, - WMMainMenuWindowLevel = 20 + WMDesktopWindowLevel = -1000, /* GNUstep addition */ + WMNormalWindowLevel = 0, + WMFloatingWindowLevel = 3, + WMSubmenuWindowLevel = 3, + WMTornOffMenuWindowLevel = 3, + WMMainMenuWindowLevel = 20, + WMDockWindowLevel = 21, /* Deprecated - use NSStatusWindowLevel */ + WMStatusWindowLevel = 21, + WMModalPanelWindowLevel = 100, + WMPopUpMenuWindowLevel = 101, + WMScreenSaverWindowLevel = 1000 }; + /* window attributes */ enum { WMBorderlessWindowMask = 0, diff --git a/src/WindowMaker.h b/src/WindowMaker.h index de600d17..ca89941b 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -25,6 +25,7 @@ #include "wconfig.h" #include +#include #include @@ -53,16 +54,26 @@ typedef enum { } WClassType; -/* generic window levels (a superset of the N*XTSTEP ones) */ +/* + * generic window levels (a superset of the N*XTSTEP ones) + * Applications should use levels between WMDesktopLevel and + * WMScreensaverLevel anything boyond that range is allowed, + * but discouraged. + */ enum { - WMDesktopLevel = 0, - WMSunkenLevel = 1, - WMNormalLevel = 2, + WMBackLevel = INT_MIN+1, /* Very lowest level */ + WMDesktopLevel = -1000, /* Lowest level of normal use */ + WMSunkenLevel = -1, + WMNormalLevel = 0, WMFloatingLevel = 3, - WMDockLevel = 4, - WMSubmenuLevel = 5, - WMMainMenuLevel = 6, - WMOuterSpaceLevel = 7 + WMDockLevel = 5, + WMSubmenuLevel = 6, + WMMainMenuLevel = 20, + WMStatusLevel = 21, + WMModalLevel = 100, + WMPopUpLevel = 101, + WMScreensaverLevel = 1000, + WMOuterSpaceLevel = INT_MAX }; /* diff --git a/src/window.c b/src/window.c index 202c262e..eb02e17b 100644 --- a/src/window.c +++ b/src/window.c @@ -396,26 +396,12 @@ wWindowSetupInitialAttributes(WWindow *wwin, int *level, int *workspace) if (wwin->wm_gnustep_attr->flags & GSWindowLevelAttr) { - switch (wwin->wm_gnustep_attr->window_level) { - case WMNormalWindowLevel: - *level = WMNormalLevel; - break; - case WMFloatingWindowLevel: - *level = WMFloatingLevel; - break; - case WMDockWindowLevel: - *level = WMDockLevel; - break; - case WMSubmenuWindowLevel: - *level = WMSubmenuLevel; - break; - case WMMainMenuWindowLevel: - *level = WMMainMenuLevel; - break; - default: - *level = WMNormalLevel; - break; - } + *level = wwin->wm_gnustep_attr->window_level; + /* + * INT_MIN is the only illegal window level. + */ + if (*level == INT_MIN) + *level = INT_MIN + 1; } else { /* setup defaults */ *level = WMNormalLevel; diff --git a/wmlib/WMaker.h b/wmlib/WMaker.h index 9e4009e0..8a45e006 100644 --- a/wmlib/WMaker.h +++ b/wmlib/WMaker.h @@ -69,20 +69,39 @@ typedef struct { #if !defined(_NSWindow_h_) && !defined(_GNUstep_H_GUITypes) +/* + * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h) + * NSDesktopWindowLevel intended to be the level at which things + * on the desktop sit ... so you should be able + * to put a desktop background just below it. + * + * Applications are actually permitted to use any value in the + * range INT_MIN+1 to INT_MAX + */ enum { - NSNormalWindowLevel = 0, - NSFloatingWindowLevel = 3, - NSDockWindowLevel = 5, - NSSubmenuWindowLevel = 10, - NSMainMenuWindowLevel = 20 + WMDesktopWindowLevel = -1000, /* GNUstep addition */ + WMNormalWindowLevel = 0, + WMFloatingWindowLevel = 3, + WMSubmenuWindowLevel = 3, + WMTornOffMenuWindowLevel = 3, + WMMainMenuWindowLevel = 20, + WMDockWindowLevel = 21, /* Deprecated - use NSStatusWindowLevel */ + WMStatusWindowLevel = 21, + WMModalPanelWindowLevel = 100, + WMPopUpMenuWindowLevel = 101, + WMScreenSaverWindowLevel = 1000 }; + +/* window attributes */ enum { - NSBorderlessWindowMask = 0, - NSTitledWindowMask = 1, - NSClosableWindowMask = 2, - NSMiniaturizableWindowMask = 4, - NSResizableWindowMask = 8 + WMBorderlessWindowMask = 0, + WMTitledWindowMask = 1, + WMClosableWindowMask = 2, + WMMiniaturizableWindowMask = 4, + WMResizableWindowMask = 8, + WMIconWindowMask = 64, + WMMiniWindowMask = 128 }; #endif -- 2.11.4.GIT