Skip to content

Commit

Permalink
#1887 rework window layer system
Browse files Browse the repository at this point in the history
  • Loading branch information
koekeishiya committed Oct 10, 2023
1 parent 015d704 commit 78694c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/misc/extern.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/window_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 78694c7

Please sign in to comment.