From 4d978af5c71430f0043b1272f8dc6344b8f03f12 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Wed, 15 Oct 2008 21:26:58 -0700 Subject: [PATCH] XQuartz: Fixed window levels. (cherry picked from commit ef4d37c73f31048dd74efee2c63fa08b92608f87) --- hw/xquartz/xpr/xprAppleWM.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/hw/xquartz/xpr/xprAppleWM.c b/hw/xquartz/xpr/xprAppleWM.c index aa5f29159..64802620a 100644 --- a/hw/xquartz/xpr/xprAppleWM.c +++ b/hw/xquartz/xpr/xprAppleWM.c @@ -32,10 +32,25 @@ #endif #include "xpr.h" + +#define _APPLEWM_SERVER_ +#include + #include "applewmExt.h" #include "rootless.h" #include #include +#include "quartz.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, LONG_MIN + 30, LONG_MIN + 29, +}; +static const int rooted_window_levels[AppleWMNumWindowLevels+1] = { +202, 203, 204, 205, 201, 200 +}; static int xprSetWindowLevel( WindowPtr pWin, @@ -50,7 +65,12 @@ static int xprSetWindowLevel( RootlessStopDrawing (pWin, FALSE); - wc.window_level = level; + //if (WINREC(WindowTable[pWin->drawable.pScreen->myNum]) == NULL) + if (quartzHasRoot) + wc.window_level = normal_window_levels[level]; + else + wc.window_level = rooted_window_levels[level]; + if (xp_configure_window (wid, XP_WINDOW_LEVEL, &wc) != Success) { return BadValue; }