[epiphany/gnome-40] Only update adaptive mode state on change
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/gnome-40] Only update adaptive mode state on change
- Date: Sun, 11 Jul 2021 18:44:52 +0000 (UTC)
commit ee465162176e21d8ae116ac7959ba62f0968703d
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>
(cherry picked from commit 70730e4dd17081b7b02c8a1c447d2bd935d48ca1)
src/ephy-window.c | 7 +++++++
1 file changed, 7 insertions(+)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 857ac81fb..6db530ec8 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -170,6 +170,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;
@@ -548,6 +549,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]