diff --git a/src/window.c b/src/window.c index 1f525f1..58a8ee7 100644 --- a/src/window.c +++ b/src/window.c @@ -119,8 +119,6 @@ bool window_apply_frame(struct window* window) { } SLSSetWindowShape(g_connection, window->id, 0, 0, frame_region); - CFRelease(frame_region); - window_move(window, window->origin); if (window->parent) { CGContextClearRect(window->context, window->frame); @@ -131,6 +129,9 @@ bool window_apply_frame(struct window* window) { } } + CFRelease(frame_region); + window_move(window, window->origin); + window->needs_move = false; window->needs_resize = false; return true; diff --git a/src/window.h b/src/window.h index a7fa040..8ae97ea 100644 --- a/src/window.h +++ b/src/window.h @@ -1,12 +1,16 @@ #pragma once #include "misc/helpers.h" -// CFTypeRef SLSTransactionCreate(int cid); -// extern CGError SLSTransactionSetWindowShape(CFTypeRef transaction, uint32_t wid, float x_offset, float y_offset, CFTypeRef region); -// extern CGError SLSTransactionOrderWindow(CFTypeRef transaction, uint32_t wid, int mode, uint32_t relativeToWID); -// extern CGError SLSTransactionSetWindowLevel(CFTypeRef transaction, uint32_t wid, int level); -// extern CGError SLSTransactionCommitUsingMethod(CFTypeRef transaction, uint32_t method); -// extern CGError SLSTransactionCommit(CFTypeRef transaction, uint32_t async); +CFTypeRef SLSTransactionCreate(int cid); +extern CGError SLSTransactionSetWindowShape(CFTypeRef transaction, uint32_t wid, float x_offset, float y_offset, CFTypeRef region); +extern CGError SLSTransactionOrderWindow(CFTypeRef transaction, uint32_t wid, int mode, uint32_t relativeToWID); +extern CGError SLSTransactionSetWindowLevel(CFTypeRef transaction, uint32_t wid, int level); +extern CGError SLSTransactionSetWindowShape(CFTypeRef transaction, uint32_t wid, float x_offset, float y_offset, CFTypeRef shape); +extern CGError SLSTransactionMoveWindowWithGroup(CFTypeRef transaction, uint32_t wid, CGPoint* point); +extern CGError SLSTransactionAddWindowToWindowOrderingGroup(CFTypeRef transaction, uint32_t parent_wid, uint32_t child_wid, int order); +extern CGError SLSTransactionClearWindowOrderingGroup(CFTypeRef transaction, uint32_t wid); +extern CGError SLSTransactionCommitUsingMethod(CFTypeRef transaction, uint32_t method); +extern CGError SLSTransactionCommit(CFTypeRef transaction, uint32_t async); extern CGError SLSDisableUpdate(int cid); extern CGError SLSReenableUpdate(int cid); @@ -28,12 +32,12 @@ extern CGError SLSAddActivationRegion(uint32_t cid, uint32_t wid, CFTypeRef regi extern CGError SLSAddTrackingRect(uint32_t cid, uint32_t wid, CGRect rect); extern CGError SLSClearActivationRegion(uint32_t cid, uint32_t wid); extern CGError SLSRemoveAllTrackingAreas(uint32_t cid, uint32_t wid); -extern CGError SLSMoveWindow(int cid, uint32_t wid, CGPoint *point); +extern CGError SLSMoveWindow(int cid, uint32_t wid, CGPoint* point); extern CGError SLSWindowSetShadowProperties(uint32_t wid, CFDictionaryRef properties); extern CGError SLSAddWindowToWindowOrderingGroup(int cid, uint32_t parent_wid, uint32_t child_wid, int order); extern CGError SLSRemoveFromOrderingGroup(int cid, uint32_t wid); extern CGError SLSReassociateWindowsSpacesByGeometry(int cid, CFArrayRef wids); -extern void SLSMoveWindowsToManagedSpace(int cid, CFArrayRef window_list, uint64_t sid); +extern CGError SLSMoveWindowsToManagedSpace(int cid, CFArrayRef window_list, uint64_t sid); extern void SLSCaptureWindowsContentsToRectWithOptions(uint32_t cid, uint64_t* wid, bool meh, CGRect bounds, uint32_t flags, CGImageRef* image); extern int SLSGetScreenRectForWindow(uint32_t cid, uint32_t wid, CGRect* out);