[gimp] app: don't use gtk_window_parse_geometry() in GimpImageWindow



commit a628511a4e0c2daa7c97b51317a916b2e71e90f8
Author: Michael Natterer <mitch gimp org>
Date:   Tue May 22 12:33:23 2018 +0200

    app: don't use gtk_window_parse_geometry() in GimpImageWindow

 app/display/gimpimagewindow.c |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)
---
diff --git a/app/display/gimpimagewindow.c b/app/display/gimpimagewindow.c
index 531e053..04da8ae 100644
--- a/app/display/gimpimagewindow.c
+++ b/app/display/gimpimagewindow.c
@@ -1120,9 +1120,7 @@ gimp_image_window_new (Gimp              *gimp,
 
   if (! GIMP_GUI_CONFIG (private->gimp->config)->single_window_mode)
     {
-      GdkMonitor *pointer_monitor;
-
-      pointer_monitor = gimp_get_monitor_at_pointer ();
+      GdkMonitor *pointer_monitor = gimp_get_monitor_at_pointer ();
 
       /*  If we are supposed to go to a monitor other than where the
        *  pointer is, place the window on that monitor manually,
@@ -1132,18 +1130,13 @@ gimp_image_window_new (Gimp              *gimp,
       if (pointer_monitor != monitor)
         {
           GdkRectangle rect;
-          gchar        geom[32];
 
           gdk_monitor_get_workarea (monitor, &rect);
 
-          /*  FIXME: image window placement
-           *
-           *  This is ugly beyond description but better than showing
-           *  the window on the wrong monitor
-           */
-          g_snprintf (geom, sizeof (geom), "%+d%+d",
-                      rect.x + 300, rect.y + 30);
-          gtk_window_parse_geometry (GTK_WINDOW (window), geom);
+          gtk_window_move (GTK_WINDOW (window),
+                           rect.x + 300, rect.y + 30);
+          gtk_window_set_geometry_hints (GTK_WINDOW (window),
+                                         NULL, NULL, GDK_HINT_USER_POS);
         }
     }
 


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