summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@freedesktop.org>2009-04-09 17:47:41 -0700
committerJeremy Huddleston <jeremyhu@freedesktop.org>2009-04-09 17:47:41 -0700
commitbdf9286d1cbfeaaf8eaf03d28091e91ee587ee25 (patch)
tree9af4eac23b160234e8a10be2563d13d0b787c0e2
parent970f100ca3c5fc0662ae7658d49d118fbd9de943 (diff)
XQuartz: Properly set the window level for the root window
-rw-r--r--hw/xquartz/xpr/xpr.h13
-rw-r--r--hw/xquartz/xpr/xprAppleWM.c13
-rw-r--r--hw/xquartz/xpr/xprFrame.c7
-rw-r--r--miext/rootless/rootlessWindow.c8
4 files changed, 21 insertions, 20 deletions
diff --git a/hw/xquartz/xpr/xpr.h b/hw/xquartz/xpr/xpr.h
index ab79a42cd..a93b83753 100644
--- a/hw/xquartz/xpr/xpr.h
+++ b/hw/xquartz/xpr/xpr.h
@@ -47,4 +47,17 @@ Bool QuartzInitCursor(ScreenPtr pScreen);
void QuartzSuspendXCursor(ScreenPtr pScreen);
void QuartzResumeXCursor(ScreenPtr pScreen, int x, int y);
+/* This lookup table came straight from the Tiger X11 source. I tried to figure
+ * it out based on CGWindowLevel.h, but I dunno... -JH
+ */
+
+#define _APPLEWM_SERVER_
+#include <X11/extensions/applewm.h>
+static const int normal_window_levels[AppleWMNumWindowLevels+1] = {
+0, 3, 4, 5, INT_MIN + 30, INT_MIN + 29,
+};
+static const int rooted_window_levels[AppleWMNumWindowLevels+1] = {
+202, 203, 204, 205, 201, 200
+};
+
#endif /* XPR_H */
diff --git a/hw/xquartz/xpr/xprAppleWM.c b/hw/xquartz/xpr/xprAppleWM.c
index fb506986c..b13db0637 100644
--- a/hw/xquartz/xpr/xprAppleWM.c
+++ b/hw/xquartz/xpr/xprAppleWM.c
@@ -43,16 +43,6 @@
#include "quartz.h"
#include "x-hash.h"
-/* This lookup table came straight from the Tiger X11 source. I tried to figure
- * it out based on CGWindowLevel.h, but I dunno... -JH
- */
-static const int normal_window_levels[AppleWMNumWindowLevels+1] = {
-0, 3, 4, 5, INT_MIN + 30, INT_MIN + 29,
-};
-static const int rooted_window_levels[AppleWMNumWindowLevels+1] = {
-202, 203, 204, 205, 201, 200
-};
-
static int xprSetWindowLevel(
WindowPtr pWin,
int level)
@@ -66,8 +56,7 @@ static int xprSetWindowLevel(
RootlessStopDrawing (pWin, FALSE);
- //if (WINREC(WindowTable[pWin->drawable.pScreen->myNum]) == NULL)
- if (quartzHasRoot)
+ if(quartzEnableRootless)
wc.window_level = normal_window_levels[level];
else
wc.window_level = rooted_window_levels[level];
diff --git a/hw/xquartz/xpr/xprFrame.c b/hw/xquartz/xpr/xprFrame.c
index c7cb31491..ac982b374 100644
--- a/hw/xquartz/xpr/xprFrame.c
+++ b/hw/xquartz/xpr/xprFrame.c
@@ -42,6 +42,7 @@
#include "dix.h"
#include <X11/Xatom.h>
#include "windowstr.h"
+#include "quartz.h"
#include "threadSafety.h"
@@ -161,6 +162,12 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
mask |= XP_SHAPE;
}
+ if(quartzEnableRootless)
+ wc.window_level = normal_window_levels[!IsRoot (pWin) ? AppleWMWindowLevelNormal : AppleWMNumWindowLevels];
+ else
+ wc.window_level = rooted_window_levels[!IsRoot (pWin) ? AppleWMWindowLevelNormal : AppleWMNumWindowLevels];
+ mask |= XP_WINDOW_LEVEL;
+
err = xp_create_window(mask, &wc, (xp_window_id *) &pFrame->wid);
if (err != Success)
diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index da02fe04a..7d2ced5a0 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -48,8 +48,6 @@ extern int darwinMainScreenX, darwinMainScreenY;
#endif
#include "fb.h"
-#define AppleWMNumWindowLevels 5
-
#include "rootlessCommon.h"
#include "rootlessWindow.h"
@@ -105,12 +103,6 @@ current_time_in_seconds (void)
return t;
} */
-static inline Bool
-rootlessHasRoot (ScreenPtr pScreen)
-{
- return WINREC (WindowTable[pScreen->myNum]) != NULL;
-}
-
void
RootlessNativeWindowStateChanged (WindowPtr pWin, unsigned int state)
{