[epiphany/gnome-3-38] Only update adaptive mode state on change
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/gnome-3-38] Only update adaptive mode state on change
- Date: Sun, 11 Jul 2021 18:45:07 +0000 (UTC)
commit 132b33a8c1b1754136268a448ad43a6a50a5dee3
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 d49bb5cd9..ea827c810 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -165,6 +165,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;
@@ -543,6 +544,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);
ephy_notebook_set_adaptive_mode (notebook, adaptive_mode);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]