[epiphany] Change ephy-window to DzlApplicationWindow



commit 0753bddb914cae23f7846d80e7b7b59df27e85fe
Author: Jan-Michael Brummer <jan brummer tabos org>
Date:   Mon Jul 2 22:09:13 2018 +0200

    Change ephy-window to DzlApplicationWindow
    
    Change from GtkApplicationWindow to DzlApplicationWindow comes with the benefit of showing header bar 
within fullscreen on mouse moving.
    
    Fixes: https://gitlab.gnome.org/GNOME/epiphany/issues/28

 meson.build                |  2 +-
 src/ephy-window.c          | 22 ++++++++++++++--------
 src/ephy-window.h          |  2 +-
 subprojects/libdazzle.wrap |  4 ++++
 4 files changed, 20 insertions(+), 10 deletions(-)
---
diff --git a/meson.build b/meson.build
index 6c75b2534..2be7ce39f 100644
--- a/meson.build
+++ b/meson.build
@@ -70,7 +70,7 @@ nettle_requirement = '>= 3.2'
 webkitgtk_requirement = '>= 2.21.92'
 
 cairo_dep = dependency('cairo', version: '>= 1.2')
-dazzle_dep = dependency('libdazzle-1.0', version: '>= 3.28.0')
+dazzle_dep = dependency('libdazzle-1.0', version: '>= 3.29.4', fallback : ['libdazzle', 'libdazzle_dep'])
 gcr_dep = dependency('gcr-3', version: '>= 3.5.5')
 gdk_dep = dependency('gdk-3.0', version: gtk_requirement)
 gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0', version: '>= 2.36.5')
diff --git a/src/ephy-window.c b/src/ephy-window.c
index e1a6402b8..1e60a5ac5 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -136,7 +136,7 @@ const struct {
 #define SETTINGS_CONNECTION_DATA_KEY    "EphyWindowSettings"
 
 struct _EphyWindow {
-  GtkApplicationWindow parent_instance;
+  DzlApplicationWindow parent_instance;
 
   GtkWidget *header_bar;
   EphyBookmarksManager *bookmarks_manager;
@@ -392,7 +392,7 @@ ephy_window_link_iface_init (EphyLinkInterface *iface)
   iface->open_link = ephy_window_open_link;
 }
 
-G_DEFINE_TYPE_WITH_CODE (EphyWindow, ephy_window, GTK_TYPE_APPLICATION_WINDOW,
+G_DEFINE_TYPE_WITH_CODE (EphyWindow, ephy_window, DZL_TYPE_APPLICATION_WINDOW,
                          G_IMPLEMENT_INTERFACE (EPHY_TYPE_LINK,
                                                 ephy_window_link_iface_init)
                          G_IMPLEMENT_INTERFACE (EPHY_TYPE_EMBED_CONTAINER,
@@ -490,7 +490,6 @@ ephy_window_fullscreen (EphyWindow *window)
   sync_tab_security (ephy_embed_get_web_view (embed), NULL, window);
 
   sync_chromes_visibility (window);
-  gtk_widget_hide (window->header_bar);
   ephy_embed_entering_fullscreen (embed);
 }
 
@@ -499,7 +498,6 @@ ephy_window_unfullscreen (EphyWindow *window)
 {
   window->is_fullscreen = FALSE;
 
-  gtk_widget_show (window->header_bar);
   sync_chromes_visibility (window);
   ephy_embed_leaving_fullscreen (window->active_embed);
 }
@@ -2837,6 +2835,7 @@ ephy_window_state_event (GtkWidget           *widget,
     } else {
       ephy_window_unfullscreen (window);
     }
+    dzl_application_window_set_fullscreen (DZL_APPLICATION_WINDOW (window), fullscreen);
 
     action_group = gtk_widget_get_action_group (GTK_WIDGET (window), "win");
     action = g_action_map_lookup_action (G_ACTION_MAP (action_group), "fullscreen");
@@ -3002,9 +3001,16 @@ sync_user_input_cb (EphyLocationController *action,
 static void
 update_new_tab_button_visibility (EphyWindow *window)
 {
-  gboolean visible = !gtk_notebook_get_show_tabs (window->notebook);
-  EphyActionBarEnd *header_bar_end = ephy_header_bar_get_action_bar_end (EPHY_HEADER_BAR 
(window->header_bar));
-  EphyActionBarEnd *action_bar_end = ephy_action_bar_get_action_bar_end (EPHY_ACTION_BAR 
(window->action_bar));
+  EphyActionBarEnd *header_bar_end;
+  EphyActionBarEnd *action_bar_end;
+  gboolean visible;
+
+  if (!gtk_widget_get_mapped (GTK_WIDGET (window)))
+    return;
+
+  visible = !gtk_notebook_get_show_tabs (window->notebook);
+  header_bar_end = ephy_header_bar_get_action_bar_end (EPHY_HEADER_BAR (window->header_bar));
+  action_bar_end = ephy_action_bar_get_action_bar_end (EPHY_ACTION_BAR (window->action_bar));
 
   if (visible) {
     ephy_action_bar_end_set_show_new_tab_button (header_bar_end, TRUE);
@@ -3067,7 +3073,7 @@ setup_header_bar (EphyWindow *window)
   EphyTitleWidget *title_widget;
 
   header_bar = ephy_header_bar_new (window);
-  gtk_window_set_titlebar (GTK_WINDOW (window), header_bar);
+  dzl_application_window_set_titlebar (DZL_APPLICATION_WINDOW (window), header_bar);
   gtk_widget_show (header_bar);
 
   app_mode = ephy_embed_shell_get_mode (ephy_embed_shell_get_default ());
diff --git a/src/ephy-window.h b/src/ephy-window.h
index 1a6feab4d..db9fa5cdd 100644
--- a/src/ephy-window.h
+++ b/src/ephy-window.h
@@ -31,7 +31,7 @@ G_BEGIN_DECLS
 
 #define EPHY_TYPE_WINDOW (ephy_window_get_type ())
 
-G_DECLARE_FINAL_TYPE (EphyWindow, ephy_window, EPHY, WINDOW, GtkApplicationWindow)
+G_DECLARE_FINAL_TYPE (EphyWindow, ephy_window, EPHY, WINDOW, DzlApplicationWindow)
 
 typedef enum
 {
diff --git a/subprojects/libdazzle.wrap b/subprojects/libdazzle.wrap
new file mode 100644
index 000000000..a4736f3ca
--- /dev/null
+++ b/subprojects/libdazzle.wrap
@@ -0,0 +1,4 @@
+[wrap-git]
+directory=libdazzle
+url=https://gitlab.gnome.org/GNOME/libdazzle.git
+revision=2f3ad0f1c5c1a0a28c4b211f2a1bc5179eed4eb7


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