From 11d4fe7dfddf5dc43991ad9373cf6c7a436bfd11 Mon Sep 17 00:00:00 2001 From: cysp74 Date: Thu, 8 Feb 2024 21:19:22 +0100 Subject: [PATCH] In `auth_x11.c`, the `CreateOrUpdatePerMonitorWindow` function has been modified: When the updated window is smaller in size (which can be caused by, eg. changing the keyboard layout) than the previous one, artifacts (parts of the previous window) may remain on the screen. To avoid this, `XClearWindow` is now called before `UpdatePerMonitorWindows`. --- helpers/auth_x11.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/helpers/auth_x11.c b/helpers/auth_x11.c index 58a1913..67f5671 100644 --- a/helpers/auth_x11.c +++ b/helpers/auth_x11.c @@ -919,6 +919,10 @@ void DisplayMessage(const char *title, const char *str, int is_warning) { } } + for (size_t i = 0; i < num_windows; ++i) { + XClearWindow(display, windows[i]); + } + UpdatePerMonitorWindows(per_monitor_windows_dirty, region_w, region_h, x_offset, y_offset); per_monitor_windows_dirty = 0; @@ -928,7 +932,8 @@ void DisplayMessage(const char *title, const char *str, int is_warning) { int cy = region_h / 2; int y = cy + to - box_h / 2; - XClearWindow(display, windows[i]); + //Moved out from here, calling XClearWindow after UpdatePerMonitorWindows can leave artifacts on screen + //XClearWindow(display, windows[i]); #ifdef DRAW_BORDER XDrawRectangle(display, windows[i], gcs[i], //