diff options
author | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2009-04-09 18:51:22 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2009-04-09 18:51:22 -0700 |
commit | 1359ded5bfc14a80fb998b01a54ecacb96c4ff88 (patch) | |
tree | 1ba69794978bf010f5c9ab685f3d5dd72d8a549a | |
parent | 80759a4186bf0335edc85aecea2faf11fe09f491 (diff) |
XQuartz: Update window levels when changing rootless state
-rw-r--r-- | hw/xquartz/xpr/xprFrame.c | 34 | ||||
-rw-r--r-- | miext/rootless/rootless.h | 1 | ||||
-rw-r--r-- | miext/rootless/rootlessWindow.c | 1 |
3 files changed, 24 insertions, 12 deletions
diff --git a/hw/xquartz/xpr/xprFrame.c b/hw/xquartz/xpr/xprFrame.c index ac982b374..1f1b97dac 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 7d2ced5a0..7a9d9bf21 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; WINREC(pWin) = winRec; |