From cede73e0e710b96e2da09f149bceab4ce2bdeac9 Mon Sep 17 00:00:00 2001 From: Felix Kratz Date: Wed, 14 Aug 2024 15:39:16 +0200 Subject: [PATCH] explicitly mark all windows as unmanaged --- src/window.c | 27 +++++++++++++++++---------- src/window.h | 2 ++ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/window.c b/src/window.c index b90f25b..ae05069 100644 --- a/src/window.c +++ b/src/window.c @@ -30,20 +30,27 @@ void window_create(struct window* window, CGRect frame) { window->origin = frame.origin; window->frame.origin = CGPointZero; window->frame.size = frame.size; - frame.origin = CGPointZero; - CFTypeRef frame_region = window_create_region(window, frame); - uint64_t id; - SLSNewWindow(g_connection, - kCGBackingStoreBuffered, - window->origin.x, - window->origin.y, - frame_region, - &id ); - window->id = (uint32_t)id; + uint32_t id; + CFTypeRef frame_region = window_create_region(window, frame); + CFTypeRef empty_region = CGRegionCreateEmptyRegion(); + SLSNewWindowWithOpaqueShapeAndContext(g_connection, + kCGBackingStoreBuffered, + frame_region, + empty_region, + 13 | (1 << 18), + &set_tags, + window->origin.x, + window->origin.y, + 64, + &id, + NULL ); + CFRelease(empty_region); CFRelease(frame_region); + window->id = id; + SLSSetWindowResolution(g_connection, window->id, 2.0f); SLSSetWindowTags(g_connection, window->id, &set_tags, 64); SLSClearWindowTags(g_connection, window->id, &clear_tags, 64); diff --git a/src/window.h b/src/window.h index fce307c..f8887fc 100644 --- a/src/window.h +++ b/src/window.h @@ -10,8 +10,10 @@ extern CGError SLSTransactionMoveWindowWithGroup(CFTypeRef transaction, uint32_t extern CGError SLSTransactionCommitUsingMethod(CFTypeRef transaction, uint32_t method); extern CGError SLSTransactionCommit(CFTypeRef transaction, uint32_t async); +extern CFTypeRef CGRegionCreateEmptyRegion(void); extern CGError SLSDisableUpdate(int cid); extern CGError SLSReenableUpdate(int cid); +extern CGError SLSNewWindowWithOpaqueShapeAndContext(int cid, int type, CFTypeRef region, CFTypeRef opaque_shape, int options, uint64_t *tags, float x, float y, int tag_size, uint32_t *wid, void *context); extern CGError SLSNewWindow(int cid, int type, float x, float y, CFTypeRef region, uint64_t *wid); extern CGError SLSReleaseWindow(int cid, uint32_t wid); extern CGError SLSSetWindowTags(int cid, uint32_t wid, uint64_t* tags, int tag_size);