summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2012-11-07 13:08:06 +0000
committerJon TURNEY <jon.turney@dronecode.org.uk>2012-11-30 14:26:48 +0000
commit05d2da4169ec7951d8ee18917b5aa34e8ccc3519 (patch)
tree76cde55d7f664d05978869cb4c0f34f8babbe485
parent17aaeb6c8895a6a6fe118b9f8d204e12d039e4d5 (diff)
Fixes for override-redirect windows
-rw-r--r--src/wndproc.c46
1 files changed, 27 insertions, 19 deletions
diff --git a/src/wndproc.c b/src/wndproc.c
index f5bda06..f50fde0 100644
--- a/src/wndproc.c
+++ b/src/wndproc.c
@@ -589,29 +589,38 @@ UpdateStyle(xcwm_window_t *window)
bool onTaskbar;
#endif
- /* Determine the Window style */
- winApplyStyle(window);
- /* Update window opacity */
- BYTE bAlpha = xcwm_window_get_opacity(window) >> 24;
- SetLayeredWindowAttributes(hWnd, RGB(0,0,0), bAlpha, LWA_ALPHA);
+ /* override redirect windows never get any decoration */
+ if (!xcwm_window_is_override_redirect(window))
+ {
+ /* Determine the Window style */
+ winApplyStyle(window);
#if 0
- /*
- Use the WS_EX_TOOLWINDOW style to remove window from Alt-Tab window switcher
+ /*
+ Use the WS_EX_TOOLWINDOW style to remove window from Alt-Tab window switcher
- According to MSDN, this is supposed to remove the window from the taskbar as well,
- if we SW_HIDE before changing the style followed by SW_SHOW afterwards.
+ According to MSDN, this is supposed to remove the window from the taskbar as well,
+ if we SW_HIDE before changing the style followed by SW_SHOW afterwards.
- But that doesn't seem to work reliably, so also use iTaskbarList interface to
- tell the taskbar to show or hide this window.
- */
- onTaskbar = GetWindowLongPtr(hWnd, GWL_EXSTYLE) & WS_EX_APPWINDOW;
- wintaskbar(hWnd, onTaskbar);
+ But that doesn't seem to work reliably, so also use iTaskbarList interface to
+ tell the taskbar to show or hide this window.
+ */
+ onTaskbar = GetWindowLongPtr(hWnd, GWL_EXSTYLE) & WS_EX_APPWINDOW;
+ wintaskbar(hWnd, onTaskbar);
- /* Check urgency hint */
- winApplyUrgency(pWMInfo->pDisplay, iWindow, hWnd);
+ /* Check urgency hint */
+ winApplyUrgency(pWMInfo->pDisplay, iWindow, hWnd);
#endif
+ }
+
+ /*
+ ... but we must SetLayeredWindowAttribute() on all WS_EX_LAYERED style windows
+ to cause them to become visible
+ */
+ /* Update window opacity */
+ BYTE bAlpha = xcwm_window_get_opacity(window) >> 24;
+ SetLayeredWindowAttributes(hWnd, RGB(0,0,0), bAlpha, LWA_ALPHA);
}
/* Don't allow window decoration to disappear off to top-left */
@@ -1302,14 +1311,13 @@ winCreateWindowsWindow(xcwm_window_t *window)
else
{
/* override-redirect window, remains un-decorated, but put it on top of all other X windows */
- /* zstyle = SWP_TOPMOST; */
+ SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
}
/* Apply all properties which effect the window appearance or behaviour */
UpdateName(window);
/* UpdateIcon(); */
- if (!xcwm_window_is_override_redirect(window))
- UpdateStyle(window);
+ UpdateStyle(window);
BumpWindowPosition(hWnd);