Skip to content

Commit

Permalink
#148 #1430 improve window borders
Browse files Browse the repository at this point in the history
  • Loading branch information
koekeishiya committed Sep 20, 2022
1 parent a125bdb commit b97df17
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/border.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,21 @@ void border_resize(struct window *window, CGRect frame)
uint8_t is_ordered_in = false;
SLSWindowIsOrderedIn(g_connection, window->border.id, &is_ordered_in);

SLSDisableUpdate(g_connection);
if (is_ordered_in) SLSOrderWindow(g_connection, window->border.id, 0, 0);
if (is_ordered_in) {
SLSDisableUpdate(g_connection);
SLSOrderWindow(g_connection, window->border.id, 0, 0);
}

SLSSetWindowShape(g_connection, window->border.id, 0.0f, 0.0f, window->border.region);
CGContextClearRect(window->border.context, window->border.frame);
CGContextAddPath(window->border.context, window->border.path_ref);
CGContextDrawPath(window->border.context, kCGPathFillStroke);
CGContextFlush(window->border.context);
if (is_ordered_in) SLSOrderWindow(g_connection, window->border.id, -1, window->id);
SLSReenableUpdate(g_connection);

if (is_ordered_in) {
SLSOrderWindow(g_connection, window->border.id, -1, window->id);
SLSReenableUpdate(g_connection);
}
}

void border_move(struct window *window, CGRect frame)
Expand Down

0 comments on commit b97df17

Please sign in to comment.