[Bf-blender-cvs] [bc3f5c7e146] blender-v3.4-release: GHOST/Wayland: skip resizing the EGL surface unnecessarily

Campbell Barton noreply at git.blender.org
Sat Nov 12 06:39:32 CET 2022


Commit: bc3f5c7e146c080cbfb17c7af75574b13c287fcb
Author: Campbell Barton
Date:   Sat Nov 12 16:38:11 2022 +1100
Branches: blender-v3.4-release
https://developer.blender.org/rBbc3f5c7e146c080cbfb17c7af75574b13c287fcb

GHOST/Wayland: skip resizing the EGL surface unnecessarily

wl_egl_window_resize ran when the window became active/inactive for e.g.

===================================================================

M	intern/ghost/intern/GHOST_WindowWayland.cpp

===================================================================

diff --git a/intern/ghost/intern/GHOST_WindowWayland.cpp b/intern/ghost/intern/GHOST_WindowWayland.cpp
index 58c6025f24c..d395888f600 100644
--- a/intern/ghost/intern/GHOST_WindowWayland.cpp
+++ b/intern/ghost/intern/GHOST_WindowWayland.cpp
@@ -370,11 +370,16 @@ static void frame_handle_configure(struct libdecor_frame *frame,
     size_next[1] = win->size[1] / win->scale;
   }
 
+  const int size_prev[2] = {UNPACK2(win->size)};
   win->size[0] = win->scale * size_next[0];
   win->size[1] = win->scale * size_next[1];
 
-  wl_egl_window_resize(win->egl_window, UNPACK2(win->size), 0, 0);
-  win->ghost_window->notify_size();
+  const bool do_resize = (size_prev[0] != win->size[0]) || (size_prev[1] != win->size[1]);
+
+  if (do_resize) {
+    wl_egl_window_resize(win->egl_window, UNPACK2(win->size), 0, 0);
+    win->ghost_window->notify_size();
+  }
 
   if (!libdecor_configuration_get_window_state(configuration, &window_state)) {
     window_state = LIBDECOR_WINDOW_STATE_NONE;



More information about the Bf-blender-cvs mailing list