[epiphany] Only update adaptive mode state on change



commit 70730e4dd17081b7b02c8a1c447d2bd935d48ca1
Author: Jan-Michael Brummer <jan brummer tabos org>
Date:   Sat Jul 10 21:53:09 2021 +0200

    Only update adaptive mode state on change
    
    Currently we update the adaptive mode state from top to bottom for every state change
    even when there hasn't been a change. Change it and only do it once.
    
    Fixes: https://gitlab.gnome.org/GNOME/epiphany/-/issues/1560
    Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/985>

 src/ephy-window.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 60bf7ef15..695dd5a84 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -171,6 +171,7 @@ struct _EphyWindow {
   guint modified_forms_timeout_id;
   EphyMouseGestureController *mouse_gesture_controller;
   EphyEmbed *last_opened_embed;
+  EphyAdaptiveMode adaptive_mode;
   int last_opened_pos;
   gboolean show_fullscreen_header_bar;
 
@@ -549,6 +550,12 @@ update_adaptive_mode (EphyWindow *window)
   adaptive_mode = (is_narrow || is_mobile_landscape) && !is_desktop_pantheon () ?
                   EPHY_ADAPTIVE_MODE_NARROW :
                   EPHY_ADAPTIVE_MODE_NORMAL;
+
+  if (window->adaptive_mode == adaptive_mode)
+    return;
+
+  window->adaptive_mode = adaptive_mode;
+
   ephy_header_bar_set_adaptive_mode (header_bar, adaptive_mode);
   ephy_action_bar_set_adaptive_mode (action_bar, adaptive_mode);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]