summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Michael Brummer <jan.brummer@tabos.org>2021-07-10 21:53:09 +0200
committerAlexander Mikhaylenko <alexm@gnome.org>2021-07-10 20:35:09 +0000
commit70730e4dd17081b7b02c8a1c447d2bd935d48ca1 (patch)
tree1efd8ae8e7b473857a23b7488155742b8ede5639
parent32d5014152a02f2a76fc6a8b67559d03b2e8d494 (diff)
downloadepiphany-70730e4dd17081b7b02c8a1c447d2bd935d48ca1.tar.gz
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>
-rw-r--r--src/ephy-window.c7
1 files changed, 7 insertions, 0 deletions
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);