Fix visual select window sometimes showing stale window titles
This commit is contained in:
parent
846c774ac2
commit
79ec8b60b9
@ -562,8 +562,8 @@ render_window_title(OSWindow *os_window, Screen *screen UNUSED, GLfloat xstart,
|
||||
unsigned bar_width = (unsigned)ceilf(right - left);
|
||||
if (!window->title_bar_data.buf || window->title_bar_data.width != bar_width || window->title_bar_data.height != bar_height) {
|
||||
free(window->title_bar_data.buf);
|
||||
Py_CLEAR(window->title_bar_data.last_drawn_title_object_id);
|
||||
window->title_bar_data.buf = malloc((size_t)4 * bar_width * bar_height);
|
||||
window->title_bar_data.last_drawn_title_object_id = NULL;
|
||||
if (!window->title_bar_data.buf) return 0;
|
||||
window->title_bar_data.height = bar_height;
|
||||
window->title_bar_data.width = bar_width;
|
||||
@ -575,6 +575,7 @@ render_window_title(OSWindow *os_window, Screen *screen UNUSED, GLfloat xstart,
|
||||
if (!draw_window_title(os_window, title, RGBCOL(highlight_fg, default_fg), RGBCOL(highlight_bg, default_bg), window->title_bar_data.buf, bar_width, bar_height)) return 0;
|
||||
#undef RGBCOL
|
||||
window->title_bar_data.last_drawn_title_object_id = window->title;
|
||||
Py_INCREF(window->title_bar_data.last_drawn_title_object_id);
|
||||
}
|
||||
static ImageRenderData data = {.group_count=1};
|
||||
xstart = clamp_position_to_nearest_pixel(xstart, os_window->viewport_width);
|
||||
|
||||
@ -311,6 +311,7 @@ update_os_window_title(OSWindow *os_window) {
|
||||
static void
|
||||
destroy_window(Window *w) {
|
||||
Py_CLEAR(w->render_data.screen); Py_CLEAR(w->title);
|
||||
Py_CLEAR(w->title_bar_data.last_drawn_title_object_id);
|
||||
free(w->title_bar_data.buf); w->title_bar_data.buf = NULL;
|
||||
release_gpu_resources_for_window(w);
|
||||
if (w->window_logo.id) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user