Skip to content

Commit cede73e

Browse files
committed
explicitly mark all windows as unmanaged
1 parent fb59232 commit cede73e

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

src/window.c

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,27 @@ void window_create(struct window* window, CGRect frame) {
3030
window->origin = frame.origin;
3131
window->frame.origin = CGPointZero;
3232
window->frame.size = frame.size;
33-
3433
frame.origin = CGPointZero;
34+
35+
uint32_t id;
3536
CFTypeRef frame_region = window_create_region(window, frame);
36-
uint64_t id;
37-
SLSNewWindow(g_connection,
38-
kCGBackingStoreBuffered,
39-
window->origin.x,
40-
window->origin.y,
41-
frame_region,
42-
&id );
43-
44-
window->id = (uint32_t)id;
37+
CFTypeRef empty_region = CGRegionCreateEmptyRegion();
38+
SLSNewWindowWithOpaqueShapeAndContext(g_connection,
39+
kCGBackingStoreBuffered,
40+
frame_region,
41+
empty_region,
42+
13 | (1 << 18),
43+
&set_tags,
44+
window->origin.x,
45+
window->origin.y,
46+
64,
47+
&id,
48+
NULL );
49+
CFRelease(empty_region);
4550
CFRelease(frame_region);
4651

52+
window->id = id;
53+
4754
SLSSetWindowResolution(g_connection, window->id, 2.0f);
4855
SLSSetWindowTags(g_connection, window->id, &set_tags, 64);
4956
SLSClearWindowTags(g_connection, window->id, &clear_tags, 64);

src/window.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ extern CGError SLSTransactionMoveWindowWithGroup(CFTypeRef transaction, uint32_t
1010
extern CGError SLSTransactionCommitUsingMethod(CFTypeRef transaction, uint32_t method);
1111
extern CGError SLSTransactionCommit(CFTypeRef transaction, uint32_t async);
1212

13+
extern CFTypeRef CGRegionCreateEmptyRegion(void);
1314
extern CGError SLSDisableUpdate(int cid);
1415
extern CGError SLSReenableUpdate(int cid);
16+
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);
1517
extern CGError SLSNewWindow(int cid, int type, float x, float y, CFTypeRef region, uint64_t *wid);
1618
extern CGError SLSReleaseWindow(int cid, uint32_t wid);
1719
extern CGError SLSSetWindowTags(int cid, uint32_t wid, uint64_t* tags, int tag_size);

0 commit comments

Comments
 (0)