[Xfce4-commits] [apps/xfce4-terminal] 01/01: Fix terminal geometry hints for GKT < 3.19.5

noreply at xfce.org noreply at xfce.org
Tue Nov 1 11:49:22 CET 2016


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 d8bd5f116ba05d7a6067f621f04c9a5e51de5fe8
Author: Igor <f2404 at yandex.ru>
Date:   Tue Nov 1 13:49:16 2016 +0300

    Fix terminal geometry hints for GKT < 3.19.5
---
 terminal/terminal-screen.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c
index 311f02f..2ad569e 100644
--- a/terminal/terminal-screen.c
+++ b/terminal/terminal-screen.c
@@ -1674,25 +1674,31 @@ terminal_screen_get_geometry (TerminalScreen *screen,
  * I don't like this way, but its required to work-around a Gtk+
  * bug (maybe also caused by a Vte bug, not sure).
  *
- * Code borrowed from gnome-terminal (terminal_window_update_geometry).
+ * Code for GTK > 3.19.5 borrowed from gnome-terminal
+ * (terminal_window_update_geometry).
  **/
 void
 terminal_screen_set_window_geometry_hints (TerminalScreen *screen,
                                            GtkWindow      *window)
 {
   GdkGeometry    hints;
+  glong          char_width, char_height;
+#if GTK_CHECK_VERSION (3, 19, 5)
   GtkRequisition vbox_request;
   GtkAllocation  toplevel_allocation, vbox_allocation;
-  glong          char_width, char_height;
   glong          grid_width, grid_height;
   glong          chrome_width, chrome_height;
   gint           csd_width, csd_height;
+#else
+  gint           xpad, ypad;
+#endif
 
   terminal_return_if_fail (TERMINAL_IS_SCREEN (screen));
   terminal_return_if_fail (VTE_IS_TERMINAL (screen->terminal));
   terminal_return_if_fail (gtk_widget_get_realized (screen));
   terminal_return_if_fail (gtk_widget_get_realized (window));
 
+#if GTK_CHECK_VERSION (3, 19, 5)
   terminal_screen_get_geometry (screen, &char_width, &char_height, NULL, NULL);
   terminal_screen_get_size (screen, &grid_width, &grid_height);
 
@@ -1707,13 +1713,24 @@ terminal_screen_set_window_geometry_hints (TerminalScreen *screen,
 
   hints.base_width = chrome_width + csd_width;
   hints.base_height = chrome_height + csd_height;
+#else
+  terminal_screen_get_geometry (screen, &char_width, &char_height, &xpad, &ypad);
+
+  hints.base_width = xpad;
+  hints.base_height = ypad;
+#endif
+
   hints.width_inc = char_width;
   hints.height_inc = char_height;
   hints.min_width = hints.base_width + hints.width_inc * 4;
   hints.min_height = hints.base_height + hints.height_inc * 2;
 
   gtk_window_set_geometry_hints (window,
+#if GTK_CHECK_VERSION (3, 19, 5)
                                  NULL,
+#else
+                                 screen->terminal,
+#endif
                                  &hints,
                                  GDK_HINT_RESIZE_INC
                                  | GDK_HINT_MIN_SIZE

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


More information about the Xfce4-commits mailing list