File hide-header-bar.patch of Package ptyxis

diff --git a/src/org.gnome.Ptyxis.gschema.xml.in b/src/org.gnome.Ptyxis.gschema.xml.in
index 90fb0b9..dbd0caa 100644
--- a/src/org.gnome.Ptyxis.gschema.xml.in
+++ b/src/org.gnome.Ptyxis.gschema.xml.in
@@ -455,6 +455,12 @@
       <description>The shortcut to toggle fullscreen</description>
     </key>
 
+    <key name="toggle-hideheaderbar" type="s">
+      <default>'F12'</default>
+      <summary>Toggle Hide Header Bar</summary>
+      <description>The shortcut to toggle hide header bar</description>
+    </key>
+
     <key name="reset" type="s">
       <default>''</default>
       <summary>Reset Terminal</summary>
diff --git a/src/ptyxis-shortcuts.defs b/src/ptyxis-shortcuts.defs
index dfcf85e..e3f3930 100644
--- a/src/ptyxis-shortcuts.defs
+++ b/src/ptyxis-shortcuts.defs
@@ -31,8 +31,9 @@ PTYXIS_SHORTCUT_DEFINE(SELECT_ALL, "select-all")
 PTYXIS_SHORTCUT_DEFINE(SELECT_NONE, "select-none")
 PTYXIS_SHORTCUT_DEFINE(TAB_OVERVIEW, "tab-overview")
 PTYXIS_SHORTCUT_DEFINE(TOGGLE_FULLSCREEN, "toggle-fullscreen")
+PTYXIS_SHORTCUT_DEFINE(TOGGLE_HIDEHEADERBAR, "toggle-hideheaderbar")
 PTYXIS_SHORTCUT_DEFINE(UNDO_CLOSE_TAB, "undo-close-tab")
 PTYXIS_SHORTCUT_DEFINE(ZOOM_IN, "zoom-in")
 PTYXIS_SHORTCUT_DEFINE(ZOOM_ONE, "zoom-one")
 PTYXIS_SHORTCUT_DEFINE(ZOOM_OUT, "zoom-out")
-PTYXIS_SHORTCUT_DEFINE(SET_TITLE, "set-title")
\ No newline at end of file
+PTYXIS_SHORTCUT_DEFINE(SET_TITLE, "set-title")
diff --git a/src/ptyxis-window.c b/src/ptyxis-window.c
index a9b242a..86d3393 100644
--- a/src/ptyxis-window.c
+++ b/src/ptyxis-window.c
@@ -1074,6 +1074,19 @@ ptyxis_window_toggle_fullscreen (GtkWidget  *widget,
     gtk_window_fullscreen (GTK_WINDOW (widget));
 }
 
+static void
+ptyxis_window_toggle_hideheaderbar (GtkWidget  *widget,
+                                 const char *action_name,
+                                 GVariant   *param)
+{
+  PtyxisWindow *self = (PtyxisWindow *)widget;
+
+  if (gtk_widget_get_visible (GTK_WIDGET (self->header_bar)))
+    gtk_widget_set_visible (GTK_WIDGET (self->header_bar), FALSE);
+  else
+    gtk_widget_set_visible (GTK_WIDGET (self->header_bar), TRUE);
+}
+
 static void
 ptyxis_window_toplevel_state_changed_cb (PtyxisWindow *self,
                                          GParamSpec   *pspec,
@@ -1082,6 +1095,7 @@ ptyxis_window_toplevel_state_changed_cb (PtyxisWindow *self,
   GdkToplevelState state;
   gboolean is_fullscreen;
   gboolean is_maximized;
+  gboolean is_tiled;
 
   g_assert (PTYXIS_IS_WINDOW (self));
   g_assert (GDK_IS_TOPLEVEL (toplevel));
@@ -1090,6 +1104,7 @@ ptyxis_window_toplevel_state_changed_cb (PtyxisWindow *self,
 
   is_fullscreen = !!(state & GDK_TOPLEVEL_STATE_FULLSCREEN);
   is_maximized = !!(state & GDK_TOPLEVEL_STATE_MAXIMIZED);
+  is_tiled = !!(state & GDK_TOPLEVEL_STATE_TILED);
 
   gtk_widget_action_set_enabled (GTK_WIDGET (self), "win.fullscreen", !is_fullscreen);
   gtk_widget_action_set_enabled (GTK_WIDGET (self), "win.unfullscreen", is_fullscreen);
@@ -1121,6 +1136,12 @@ ptyxis_window_toplevel_state_changed_cb (PtyxisWindow *self,
   else
     gtk_widget_remove_css_class (GTK_WIDGET (self), "fullscreen");
 
+  if (is_tiled) {
+    gtk_widget_set_visible (GTK_WIDGET (self->header_bar), FALSE);
+  } else {
+    gtk_widget_set_visible (GTK_WIDGET (self->header_bar), TRUE);
+  }
+
   self->is_fullscreen = is_fullscreen;
   self->is_maximized = is_maximized;
 }
@@ -2044,6 +2065,7 @@ ptyxis_window_class_init (PtyxisWindowClass *klass)
   gtk_widget_class_install_action (widget_class, "win.fullscreen", NULL, ptyxis_window_fullscreen_action);
   gtk_widget_class_install_action (widget_class, "win.unfullscreen", NULL, ptyxis_window_unfullscreen_action);
   gtk_widget_class_install_action (widget_class, "win.toggle-fullscreen", NULL, ptyxis_window_toggle_fullscreen);
+  gtk_widget_class_install_action (widget_class, "win.toggle-hideheaderbar", NULL, ptyxis_window_toggle_hideheaderbar);
   gtk_widget_class_install_action (widget_class, "win.tab-overview", NULL, ptyxis_window_tab_overview_action);
   gtk_widget_class_install_action (widget_class, "win.zoom-in", "b", ptyxis_window_zoom_in_action);
   gtk_widget_class_install_action (widget_class, "win.zoom-out", "b", ptyxis_window_zoom_out_action);
diff --git a/src/ptyxis-window.ui b/src/ptyxis-window.ui
index f67fa61..47fde4b 100644
--- a/src/ptyxis-window.ui
+++ b/src/ptyxis-window.ui
@@ -164,6 +164,16 @@
             <property name="action">action(win.toggle-fullscreen)</property>
           </object>
         </child>
+        <child>
+          <object class="GtkShortcut">
+            <binding name="trigger">
+              <lookup name="toggle-hideheaderbar" type="PtyxisShortcuts">
+                <lookup name="shortcuts">PtyxisWindow</lookup>
+              </lookup>
+            </binding>
+            <property name="action">action(win.toggle-hideheaderbar)</property>
+          </object>
+        </child>
         <child>
           <object class="GtkShortcut">
             <binding name="trigger">
@@ -772,6 +782,20 @@
         <attribute name="hidden-when">action-disabled</attribute>
       </item>
     </section>
+    <section>
+      <item>
+        <attribute name="id">toggle-hideheaderbar</attribute>
+        <attribute name="label" translatable="yes">Hide Header Bar</attribute>
+        <attribute name="action">win.hideheaderbar</attribute>
+        <attribute name="hidden-when">action-disabled</attribute>
+      </item>
+      <item>
+        <attribute name="id">toggle-hideheaderbar</attribute>
+        <attribute name="label" translatable="yes">Unhide Header Bar</attribute>
+        <attribute name="action">win.unhideheaderbar</attribute>
+        <attribute name="hidden-when">action-disabled</attribute>
+      </item>
+    </section>
     <section>
       <item>
         <attribute name="id">preferences</attribute>
openSUSE Build Service is sponsored by