summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@freedesktop.org>2009-04-09 18:51:22 -0700
committerJeremy Huddleston <jeremyhu@freedesktop.org>2009-04-10 00:47:40 -0700
commitdfb0d7aefbbdfc0db966e3a84d52f638135d9138 (patch)
tree3e204917d732c0a10ccf7bba3ed4735fed2ec2d4
parentd5ef88d7543ed787093099ab18db766c446b47d1 (diff)
XQuartz: Update window levels when changing rootless state
(cherry picked from commit 1359ded5bfc14a80fb998b01a54ecacb96c4ff88)
-rw-r--r--hw/xquartz/xpr/xprFrame.c34
-rw-r--r--miext/rootless/rootless.h1
-rw-r--r--miext/rootless/rootlessWindow.c1
3 files changed, 24 insertions, 12 deletions
diff --git a/hw/xquartz/xpr/xprFrame.c b/hw/xquartz/xpr/xprFrame.c
index ba697ac62..6635f08d8 100644
--- a/hw/xquartz/xpr/xprFrame.c
+++ b/hw/xquartz/xpr/xprFrame.c
@@ -162,10 +162,12 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
mask |= XP_SHAPE;
}
+ pFrame->level = !IsRoot (pWin) ? AppleWMWindowLevelNormal : AppleWMNumWindowLevels;
+
if(quartzEnableRootless)
- wc.window_level = normal_window_levels[!IsRoot (pWin) ? AppleWMWindowLevelNormal : AppleWMNumWindowLevels];
+ wc.window_level = normal_window_levels[pFrame->level];
else
- wc.window_level = rooted_window_levels[!IsRoot (pWin) ? AppleWMWindowLevelNormal : AppleWMNumWindowLevels];
+ wc.window_level = rooted_window_levels[pFrame->level];
mask |= XP_WINDOW_LEVEL;
err = xp_create_window(mask, &wc, (xp_window_id *) &pFrame->wid);
@@ -252,28 +254,36 @@ xprResizeFrame(RootlessFrameID wid, ScreenPtr pScreen,
/*
* Change frame stacking.
*/
-static void
-xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
-{
+static void xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) {
xp_window_changes wc;
+ unsigned int mask = XP_STACKING;
TA_SERVER();
- /* Stack frame below nextWid it if it exists, or raise
+ /* Stack frame below nextWid it if it exists, or raise
frame above everything otherwise. */
- if (nextWid == NULL)
- {
+ if(nextWid == NULL) {
wc.stack_mode = XP_MAPPED_ABOVE;
wc.sibling = 0;
- }
- else
- {
+ } else {
wc.stack_mode = XP_MAPPED_BELOW;
wc.sibling = x_cvt_vptr_to_uint(nextWid);
}
- xprConfigureWindow(x_cvt_vptr_to_uint(wid), XP_STACKING, &wc);
+ if(window_hash) {
+ RootlessWindowRec *winRec = x_hash_table_lookup(window_hash, x_cvt_uint_to_vptr((xp_window_id)wid), NULL);
+
+ if(winRec) {
+ if(quartzEnableRootless)
+ wc.window_level = normal_window_levels[winRec->level];
+ else
+ wc.window_level = rooted_window_levels[winRec->level];
+ mask |= XP_WINDOW_LEVEL;
+ }
+ }
+
+ xprConfigureWindow(x_cvt_vptr_to_uint(wid), mask, &wc);
}
diff --git a/miext/rootless/rootless.h b/miext/rootless/rootless.h
index 5224dca2b..bde4cff52 100644
--- a/miext/rootless/rootless.h
+++ b/miext/rootless/rootless.h
@@ -57,6 +57,7 @@ typedef struct _RootlessWindowRec {
int x, y;
unsigned int width, height;
unsigned int borderWidth;
+ int level;
RootlessFrameID wid; // implementation specific frame id
WindowPtr win; // underlying X window
diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index 7bd7f18bb..b173cef70 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -478,6 +478,7 @@ RootlessEnsureFrame(WindowPtr pWin)
winRec->is_reorder_pending = FALSE;
winRec->pixmap = NULL;
winRec->wid = NULL;
+ winRec->level = 0;
SETWINREC(pWin, winRec);