[gimp] app: update tests for new GDK/GIMP API



commit 3673352c99532f87121ab81449e20755ccf8f848
Author: Ell <ell_se yahoo com>
Date:   Sat May 26 04:08:01 2018 -0400

    app: update tests for new GDK/GIMP API
    
    This only makes the tests build, though they still fail.

 app/tests/test-tools.c | 6 ++++--
 app/tests/test-ui.c    | 9 ++++-----
 2 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/app/tests/test-tools.c b/app/tests/test-tools.c
index 2d1c83ef68..c8e24feb7b 100644
--- a/app/tests/test-tools.c
+++ b/app/tests/test-tools.c
@@ -208,6 +208,7 @@ gimp_test_synthesize_tool_button_event (GimpDisplayShell *shell,
   GdkEvent   *event   = gdk_event_new (button_event_type);
   GdkWindow  *window  = gtk_widget_get_window (GTK_WIDGET (shell->canvas));
   GdkDisplay *display = gdk_window_get_display (window);
+  GdkSeat    *seat    = gdk_display_get_default_seat (display);
 
   g_assert (button_event_type == GDK_BUTTON_PRESS ||
             button_event_type == GDK_BUTTON_RELEASE);
@@ -220,7 +221,7 @@ gimp_test_synthesize_tool_button_event (GimpDisplayShell *shell,
   event->button.axes       = NULL;
   event->button.state      = 0;
   event->button.button     = button;
-  event->button.device     = gdk_display_get_core_pointer (display);
+  event->button.device     = gdk_seat_get_pointer (seat);
   event->button.x_root     = -1;
   event->button.y_root     = -1;
 
@@ -239,6 +240,7 @@ gimp_test_synthesize_tool_motion_event (GimpDisplayShell *shell,
   GdkEvent   *event   = gdk_event_new (GDK_MOTION_NOTIFY);
   GdkWindow  *window  = gtk_widget_get_window (GTK_WIDGET (shell->canvas));
   GdkDisplay *display = gdk_window_get_display (window);
+  GdkSeat    *seat    = gdk_display_get_default_seat (display);
 
   event->motion.window     = g_object_ref (window);
   event->motion.send_event = TRUE;
@@ -248,7 +250,7 @@ gimp_test_synthesize_tool_motion_event (GimpDisplayShell *shell,
   event->motion.axes       = NULL;
   event->motion.state      = GDK_BUTTON1_MASK | modifiers;
   event->motion.is_hint    = FALSE;
-  event->motion.device     = gdk_display_get_core_pointer (display);
+  event->motion.device     = gdk_seat_get_pointer (seat);
   event->motion.x_root     = -1;
   event->motion.y_root     = -1;
 
diff --git a/app/tests/test-ui.c b/app/tests/test-ui.c
index 774d3e074f..39575763d8 100644
--- a/app/tests/test-ui.c
+++ b/app/tests/test-ui.c
@@ -114,7 +114,6 @@ tool_options_editor_updates (gconstpointer data)
   GimpImageWindow       *image_window = GIMP_IMAGE_WINDOW (toplevel);
   GimpUIManager         *ui_manager   = gimp_image_window_get_ui_manager (image_window);
   GtkWidget             *dockable     = gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
-                                                                        gtk_widget_get_screen (toplevel),
                                                                         gimp_widget_get_monitor (toplevel),
                                                                         NULL /*ui_manager*/,
                                                                         toplevel,
@@ -753,18 +752,18 @@ repeatedly_switch_window_mode (gconstpointer data)
 static void
 window_roles (gconstpointer data)
 {
+  GdkMonitor     *monitor        = NULL;
   GtkWidget      *dock           = NULL;
   GtkWidget      *toolbox        = NULL;
   GimpDockWindow *dock_window    = NULL;
   GimpDockWindow *toolbox_window = NULL;
 
+  monitor        = gdk_display_get_primary_monitor (gdk_display_get_default ());
   dock           = gimp_dock_with_window_new (gimp_dialog_factory_get_singleton (),
-                                              gdk_screen_get_default (),
-                                              0,
+                                              monitor,
                                               FALSE /*toolbox*/);
   toolbox        = gimp_dock_with_window_new (gimp_dialog_factory_get_singleton (),
-                                              gdk_screen_get_default (),
-                                              0,
+                                              monitor,
                                               TRUE /*toolbox*/);
   dock_window    = gimp_dock_window_from_dock (GIMP_DOCK (dock));
   toolbox_window = gimp_dock_window_from_dock (GIMP_DOCK (toolbox));


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