[Xfce4-commits] [apps/xfce4-terminal] 01/01: Fix incorrect window positioning when started in fullscreen state

noreply at xfce.org noreply at xfce.org
Thu Jan 12 14:16:41 CET 2017


This is an automated email from the git hooks/post-receive script.

f2404 pushed a commit to branch master
in repository apps/xfce4-terminal.

commit 1476271e77ad6df8d21bacffc03eb5c21b9de270
Author: Igor <f2404 at yandex.ru>
Date:   Thu Jan 12 16:16:36 2017 +0300

    Fix incorrect window positioning when started in fullscreen state
---
 terminal/terminal-window.c | 34 +++++++++++++++++++++++++++-------
 1 file changed, 27 insertions(+), 7 deletions(-)

diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index 6fe27fc..4c619af 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -108,6 +108,8 @@ static void         terminal_window_style_set                     (GtkWidget
                                                                    GtkStyle               *previous_style);
 static gboolean     terminal_window_scroll_event                  (GtkWidget              *widget,
                                                                    GdkEventScroll         *event);
+static gboolean     terminal_window_map_event                     (GtkWidget              *widget,
+                                                                   GdkEventAny            *event);
 static gboolean     terminal_window_confirm_close                 (TerminalWindow         *window);
 static void         terminal_window_size_push                     (TerminalWindow         *window);
 static gboolean     terminal_window_size_pop                      (gpointer                data);
@@ -374,6 +376,7 @@ terminal_window_class_init (TerminalWindowClass *klass)
   gtkwidget_class->delete_event = terminal_window_delete_event;
   gtkwidget_class->style_set = terminal_window_style_set;
   gtkwidget_class->scroll_event = terminal_window_scroll_event;
+  gtkwidget_class->map_event = terminal_window_map_event;
 
   /**
    * TerminalWindow::new-window
@@ -660,6 +663,20 @@ terminal_window_scroll_event (GtkWidget      *widget,
 
 
 static gboolean
+terminal_window_map_event (GtkWidget   *widget,
+                           GdkEventAny *event)
+{
+  TerminalWindow *window = TERMINAL_WINDOW (widget);
+
+  if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (window->priv->action_fullscreen)))
+    gtk_window_fullscreen (GTK_WINDOW (widget));
+
+  return FALSE;
+}
+
+
+
+static gboolean
 terminal_window_confirm_close (TerminalWindow *window)
 {
   GtkWidget *dialog;
@@ -1704,15 +1721,18 @@ static void
 terminal_window_action_fullscreen (GtkToggleAction *action,
                                    TerminalWindow  *window)
 {
-  if (gtk_toggle_action_get_active (action))
-    gtk_window_fullscreen (GTK_WINDOW (window));
-  else
+  if (gtk_widget_get_visible (GTK_WIDGET (window)))
     {
-      gtk_window_unfullscreen (GTK_WINDOW (window));
+      if (gtk_toggle_action_get_active (action))
+        gtk_window_fullscreen (GTK_WINDOW (window));
+      else
+        {
+          gtk_window_unfullscreen (GTK_WINDOW (window));
 
-      /* update drop-down window geometry, otherwise it'll be incorrect */
-      if (window->drop_down)
-        terminal_window_dropdown_update_geometry (TERMINAL_WINDOW_DROPDOWN (window));
+          /* update drop-down window geometry, otherwise it'll be incorrect */
+          if (window->drop_down)
+            terminal_window_dropdown_update_geometry (TERMINAL_WINDOW_DROPDOWN (window));
+        }
     }
 }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list