summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2012-11-04 23:05:18 +0000
committerJon TURNEY <jon.turney@dronecode.org.uk>2012-11-30 14:26:46 +0000
commit0a8cc98a445f38b5bf9da95d833b035249618eb2 (patch)
treeb8edf3aecece002222291bc69782142ba6a71fc9
parent0b955a04d1a639c1971cba4dba06ea47d6a36e38 (diff)
Use new XCWM_EVENT_WINDOW_APPEARANCE event to update window appearance
-rw-r--r--src/main.c4
-rw-r--r--src/wndproc.c9
-rw-r--r--src/wndproc.h1
3 files changed, 10 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 2cfe8f3..b3a1245 100644
--- a/src/main.c
+++ b/src/main.c
@@ -70,6 +70,10 @@ eventHandler(const xcwm_event_t *event)
case XCWM_EVENT_WINDOW_EXPOSE: // I don't think this event could ever be needed and is a mistake
break;
+
+ case XCWM_EVENT_WINDOW_APPEARANCE:
+ UpdateStyle(window);
+ break;
}
free((void *)event);
diff --git a/src/wndproc.c b/src/wndproc.c
index 315ef5d..58e040e 100644
--- a/src/wndproc.c
+++ b/src/wndproc.c
@@ -560,17 +560,20 @@ winApplyStyle(xcwm_window_t *window)
/*
* Updates the style of a HWND according to its X style properties
*/
-static void
+void
UpdateStyle(xcwm_window_t *window)
{
-#if 0
HWND hWnd = xcwm_window_get_local_data(window);
+#if 0
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);
#if 0
/*
@@ -1294,8 +1297,6 @@ winCreateWindowsWindow(xcwm_window_t *window)
if (attr->_class != XCB_WINDOW_CLASS_INPUT_ONLY)
#endif
{
- BYTE bAlpha = xcwm_window_get_opacity(window) >> 24;
- SetLayeredWindowAttributes(hWnd, RGB(0,0,0), bAlpha, LWA_ALPHA);
ShowWindow(hWnd, SW_SHOWNOACTIVATE);
}
}
diff --git a/src/wndproc.h b/src/wndproc.h
index 6d10de7..8c60d58 100644
--- a/src/wndproc.h
+++ b/src/wndproc.h
@@ -24,6 +24,7 @@
void UpdateName(xcwm_window_t *window);
void UpdateImage(xcwm_window_t *window);
+void UpdateStyle(xcwm_window_t *window);
void winCreateWindowsWindow(xcwm_window_t *window);
void winDestroyWindowsWindow(xcwm_window_t *window);