From 78694c7db7ff2ec297f70a258934932322c35a08 Mon Sep 17 00:00:00 2001 From: koekeishiya Date: Tue, 10 Oct 2023 19:51:36 +0200 Subject: [PATCH] #1887 rework window layer system --- src/misc/extern.h | 2 ++ src/window_manager.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/misc/extern.h b/src/misc/extern.h index 7f6cd6a0..695d0474 100644 --- a/src/misc/extern.h +++ b/src/misc/extern.h @@ -8,6 +8,7 @@ extern CGError SLSReleaseConnection(int cid); extern CGError SLSRegisterConnectionNotifyProc(int cid, connection_callback *handler, uint32_t event, void *context); extern CGError SLSGetWindowBounds(int cid, uint32_t wid, CGRect *frame); extern CGError SLSGetWindowLevel(int cid, uint32_t wid, int *level); +extern int SLSGetWindowSubLevel(int cid, uint32_t wid); extern CGError SLSGetWindowAlpha(int cid, uint32_t wid, float *alpha); extern CGError SLSSetWindowAlpha(int cid, uint32_t wid, float alpha); extern CGError SLSSetWindowResolution(int cid, uint32_t wid, double resolution); @@ -27,6 +28,7 @@ extern CGError SLSSetWindowBackgroundBlurRadiusStyle(int cid, uint32_t wid, int extern CGError SLSOrderWindow(int cid, uint32_t wid, int mode, uint32_t rel_wid); extern CGError SLSWindowIsOrderedIn(int cid, uint32_t wid, uint8_t *value); extern CGError SLSSetWindowLevel(int cid, uint32_t wid, int level); +extern CGError SLSSetWindowSubLevel(int cid, uint32_t wid, int sub_level); extern CGContextRef SLWindowContextCreate(int cid, uint32_t wid, CFDictionaryRef options); extern CGError CGSNewRegionWithRect(CGRect *rect, CFTypeRef *region); extern CFUUIDRef CGDisplayCreateUUIDFromDisplayID(uint32_t did); diff --git a/src/window_manager.c b/src/window_manager.c index 245c54e9..67a4cde8 100644 --- a/src/window_manager.c +++ b/src/window_manager.c @@ -540,14 +540,14 @@ static void window_manager_create_window_proxy(int animation_connection, struct SLSSetWindowOpacity(animation_connection, proxy->id, 0); SLSSetWindowResolution(animation_connection, proxy->id, 2.0f); SLSSetWindowAlpha(animation_connection, proxy->id, 1.0f); - SLSSetWindowLevel(animation_connection, proxy->id, proxy->level); + SLSSetWindowLevel(animation_connection, proxy->id, g_layer_normal_window_level); + SLSSetWindowSubLevel(animation_connection, proxy->id, proxy->level); proxy->context = SLWindowContextCreate(animation_connection, proxy->id, 0); CGRect frame = { {0, 0}, proxy->frame.size }; CGContextClearRect(proxy->context, frame); CGContextDrawImage(proxy->context, frame, (CGImageRef) CFArrayGetValueAtIndex(proxy->image, 0)); CGContextFlush(proxy->context); - CFRelease(frame_region); }