[Xfce4-commits] [apps/xfce4-terminal] 01/01: Resolve gdk_screen_get_width/height deprecation for GTK+ >= 3.22

noreply at xfce.org noreply at xfce.org
Mon Feb 27 17:29:07 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 26b0f42755a6d903c248e2fb91b99865a3b249e1
Author: Igor <f2404 at yandex.ru>
Date:   Mon Feb 27 19:28:50 2017 +0300

    Resolve gdk_screen_get_width/height deprecation for GTK+ >= 3.22
---
 terminal/terminal-app.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/terminal/terminal-app.c b/terminal/terminal-app.c
index 8fb371a..84a9e63 100644
--- a/terminal/terminal-app.c
+++ b/terminal/terminal-app.c
@@ -685,14 +685,19 @@ terminal_app_open_window (TerminalApp        *app,
   gboolean         reuse_window = FALSE;
   GdkDisplay      *attr_display;
   gint             attr_screen_num;
-#if GTK_CHECK_VERSION (3,20,0) && defined (GDK_WINDOWING_X11)
+#if GTK_CHECK_VERSION (3, 20, 0) && defined (GDK_WINDOWING_X11)
   TerminalScreen  *active_terminal;
   GdkGravity       gravity = GDK_GRAVITY_NORTH_WEST;
   gint             mask = NoValue, x, y;
   guint            width, height;
-  gint             screen_width, screen_height;
+  gint             screen_width = 0, screen_height = 0;
   gint             window_width, window_height;
 #endif
+#if GTK_CHECK_VERSION (3, 22, 0) && defined (GDK_WINDOWING_X11)
+  GdkMonitor      *monitor;
+  GdkRectangle     monitor_geo;
+  gint             i, n;
+#endif
 
   terminal_return_if_fail (TERMINAL_IS_APP (app));
   terminal_return_if_fail (attr != NULL);
@@ -832,7 +837,7 @@ terminal_app_open_window (TerminalApp        *app,
         geometry = g_strdup (attr->geometry);
 
       /* try to apply the geometry to the window */
-#if GTK_CHECK_VERSION (3,20,0) && defined (GDK_WINDOWING_X11)
+#if GTK_CHECK_VERSION (3, 20, 0) && defined (GDK_WINDOWING_X11)
       mask = XParseGeometry (geometry, &x, &y, &width, &height);
       if (((mask & WidthValue) && (mask & HeightValue)) || ((mask & XValue) && (mask & YValue)))
         {
@@ -851,8 +856,19 @@ terminal_app_open_window (TerminalApp        *app,
           if ((mask & XValue) && (mask & YValue))
             {
               screen = gtk_window_get_screen (GTK_WINDOW (window));
+  #if GTK_CHECK_VERSION (3, 22, 0)
+              n = gdk_display_get_n_monitors (gdk_screen_get_display (screen));
+              for (i = 0; i < n; ++i)
+                {
+                  monitor = gdk_display_get_monitor (gdk_screen_get_display (screen), i);
+                  gdk_monitor_get_geometry (monitor, &monitor_geo);
+                  screen_width += monitor_geo.width;
+                  screen_height += monitor_geo.height;
+                }
+  #else
               screen_width = gdk_screen_get_width (screen);
               screen_height = gdk_screen_get_height (screen);
+  #endif
               gtk_window_get_default_size (GTK_WINDOW (window), &window_width, &window_height);
               if (mask & XNegative)
                 {

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


More information about the Xfce4-commits mailing list