mirror of
https://github.com/FelixKratz/SketchyBar
synced 2025-02-16 12:38:26 +00:00
flush window content region after redraw
This commit is contained in:
parent
dd8b7cd124
commit
4aa602ac71
5 changed files with 13 additions and 1 deletions
|
@ -215,10 +215,14 @@ void bar_draw(struct bar* bar, bool forced, bool threaded) {
|
|||
CGContextClearRect(window->context, window->frame);
|
||||
bar_item_draw(bar_item, window->context);
|
||||
CGContextFlush(window->context);
|
||||
window_flush(window);
|
||||
}
|
||||
}
|
||||
|
||||
if (g_bar_manager.bar_needs_update) CGContextFlush(bar->window.context);
|
||||
if (g_bar_manager.bar_needs_update) {
|
||||
CGContextFlush(bar->window.context);
|
||||
window_flush(&bar->window);
|
||||
}
|
||||
}
|
||||
|
||||
static void bar_calculate_bounds_top_bottom(struct bar* bar) {
|
||||
|
|
|
@ -711,6 +711,7 @@ void* draw_item_proc(void* context) {
|
|||
CGContextClearRect(info->window->context, info->window->frame);
|
||||
bar_item_draw(&info->bar_item, info->window->context);
|
||||
CGContextFlush(info->window->context);
|
||||
window_flush(info->window);
|
||||
free(context);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -345,6 +345,7 @@ void popup_draw(struct popup* popup) {
|
|||
popup->background.shadow.enabled = shadow;
|
||||
|
||||
CGContextFlush(popup->window.context);
|
||||
window_flush(&popup->window);
|
||||
|
||||
if (popup->needs_ordering) {
|
||||
popup_order_windows(popup);
|
||||
|
|
|
@ -93,6 +93,10 @@ void window_clear(struct window* window) {
|
|||
window->needs_resize = false;
|
||||
}
|
||||
|
||||
void window_flush(struct window* window) {
|
||||
SLSFlushWindowContentRegion(g_connection, window->id, NULL);
|
||||
}
|
||||
|
||||
void windows_freeze() {
|
||||
if (g_transaction) return;
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
#include "misc/helpers.h"
|
||||
|
||||
extern CGError SLSFlushWindowContentRegion(int cid, uint32_t wid, void* dirty);
|
||||
extern CFTypeRef SLSTransactionCreate(int cid);
|
||||
extern CGError SLSTransactionOrderWindow(CFTypeRef transaction, uint32_t wid, int mode, uint32_t relativeToWID);
|
||||
extern CGError SLSTransactionSetWindowLevel(CFTypeRef transaction, uint32_t wid, int level);
|
||||
|
@ -85,6 +86,7 @@ void window_init(struct window* window);
|
|||
void window_create(struct window* window, CGRect frame);
|
||||
void window_close(struct window* window);
|
||||
void window_clear(struct window* window);
|
||||
void window_flush(struct window* window);
|
||||
|
||||
void window_move(struct window* window, CGPoint point);
|
||||
void window_set_frame(struct window* window, CGRect frame);
|
||||
|
|
Loading…
Add table
Reference in a new issue