[Bf-blender-cvs] [c2c41fb14ce] blender-v3.4-release: Fix missing title-bar redrawing with Wayland & libdecor
Campbell Barton
noreply at git.blender.org
Wed Nov 16 02:33:16 CET 2022
Commit: c2c41fb14ce780ec7b97bde1c4e8ccf75942f3ce
Author: Campbell Barton
Date: Wed Nov 16 11:25:34 2022 +1100
Branches: blender-v3.4-release
https://developer.blender.org/rBc2c41fb14ce780ec7b97bde1c4e8ccf75942f3ce
Fix missing title-bar redrawing with Wayland & libdecor
Regression in [0], changing active/inactive missed redrawing the
title-bar,
[0]: 37b256e26feb454d9febd84dac1b1ce8b8d84d90
===================================================================
M intern/ghost/intern/GHOST_WindowWayland.cpp
===================================================================
diff --git a/intern/ghost/intern/GHOST_WindowWayland.cpp b/intern/ghost/intern/GHOST_WindowWayland.cpp
index 07fbbc12d31..ba7df56a34c 100644
--- a/intern/ghost/intern/GHOST_WindowWayland.cpp
+++ b/intern/ghost/intern/GHOST_WindowWayland.cpp
@@ -355,6 +355,8 @@ static void gwl_window_frame_update_from_pending_lockfree(GWL_Window *win)
#endif
+ bool do_redraw = false;
+
if (win->frame_pending.size[0] != 0 && win->frame_pending.size[1] != 0) {
if ((win->frame.size[0] != win->frame_pending.size[0]) ||
(win->frame.size[1] != win->frame_pending.size[1])) {
@@ -362,6 +364,9 @@ static void gwl_window_frame_update_from_pending_lockfree(GWL_Window *win)
}
}
+ bool is_active_ghost = (win->ghost_window ==
+ win->ghost_system->getWindowManager()->getActiveWindow());
+
if (win->frame_pending.is_active) {
win->ghost_window->activate();
}
@@ -369,6 +374,10 @@ static void gwl_window_frame_update_from_pending_lockfree(GWL_Window *win)
win->ghost_window->deactivate();
}
+ if (is_active_ghost != win->frame_pending.is_active) {
+ do_redraw = true;
+ }
+
win->frame_pending.size[0] = win->frame.size[0];
win->frame_pending.size[1] = win->frame.size[1];
@@ -377,6 +386,15 @@ static void gwl_window_frame_update_from_pending_lockfree(GWL_Window *win)
/* Signal not to apply the scale unless it's configured. */
win->frame_pending.size[0] = 0;
win->frame_pending.size[1] = 0;
+
+ if (do_redraw) {
+#ifdef USE_EVENT_BACKGROUND_THREAD
+ /* Could swap buffers, use pending to a redundant call in some cases. */
+ gwl_window_pending_actions_tag(win, PENDING_SWAP_BUFFERS);
+#else
+ win->ghost_window->swapBuffers();
+#endif
+ }
}
static void gwl_window_frame_update_from_pending(GWL_Window *win)
More information about the Bf-blender-cvs
mailing list