[gtk+] Drop gdk_app_launch_context_set_screen



commit ba91af62ad10d8bcb9563afec3b977c9de97c883
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Oct 30 23:01:34 2017 -0400

    Drop gdk_app_launch_context_set_screen
    
    This function is not necessary, since we already know the display.

 gdk/gdkapplaunchcontext.c                 |   38 +----------------------------
 gdk/gdkapplaunchcontextprivate.h          |    1 -
 gdk/wayland/gdkapplaunchcontext-wayland.c |    1 -
 gdk/x11/gdkapplaunchcontext-x11.c         |   10 +------
 4 files changed, 3 insertions(+), 47 deletions(-)
---
diff --git a/gdk/gdkapplaunchcontext.c b/gdk/gdkapplaunchcontext.c
index ab19967..4f693e0 100644
--- a/gdk/gdkapplaunchcontext.c
+++ b/gdk/gdkapplaunchcontext.c
@@ -42,7 +42,7 @@
  *
  * context = gdk_display_get_app_launch_context (display);
  *
- * gdk_app_launch_context_set_screen (screen);
+ * gdk_app_launch_context_set_display (display);
  * gdk_app_launch_context_set_timestamp (event->time);
  *
  * if (!g_app_info_launch_default_for_uri ("http://www.gtk.org";, context, &error))
@@ -143,9 +143,6 @@ gdk_app_launch_context_finalize (GObject *object)
   if (context->display)
     g_object_unref (context->display);
 
-  if (context->screen)
-    g_object_unref (context->screen);
-
   if (context->icon)
     g_object_unref (context->icon);
 
@@ -171,39 +168,6 @@ gdk_app_launch_context_get_display (GAppLaunchContext *context,
 }
 
 /**
- * gdk_app_launch_context_set_screen:
- * @context: a #GdkAppLaunchContext
- * @screen: a #GdkScreen
- *
- * Sets the screen on which applications will be launched when
- * using this context. See also gdk_app_launch_context_set_display().
- *
- * If both @screen and @display are set, the @screen takes priority.
- * If neither @screen or @display are set, the default screen and
- * display are used.
- *
- * Since: 2.14
- */
-void
-gdk_app_launch_context_set_screen (GdkAppLaunchContext *context,
-                                   GdkScreen           *screen)
-{
-  g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context));
-  g_return_if_fail (screen == NULL || GDK_IS_SCREEN (screen));
-
-  g_return_if_fail (screen == NULL || gdk_screen_get_display (screen) == context->display);
-
-  if (context->screen)
-    {
-      g_object_unref (context->screen);
-      context->screen = NULL;
-    }
-
-  if (screen)
-    context->screen = g_object_ref (screen);
-}
-
-/**
  * gdk_app_launch_context_set_desktop:
  * @context: a #GdkAppLaunchContext
  * @desktop: the number of a workspace, or -1
diff --git a/gdk/gdkapplaunchcontextprivate.h b/gdk/gdkapplaunchcontextprivate.h
index 2e0e6e0..bfb3925 100644
--- a/gdk/gdkapplaunchcontextprivate.h
+++ b/gdk/gdkapplaunchcontextprivate.h
@@ -36,7 +36,6 @@ struct _GdkAppLaunchContext
   GAppLaunchContext parent_instance;
 
   GdkDisplay *display;
-  GdkScreen *screen;
   gint workspace;
   guint32 timestamp;
   GIcon *icon;
diff --git a/gdk/wayland/gdkapplaunchcontext-wayland.c b/gdk/wayland/gdkapplaunchcontext-wayland.c
index b69cc31..943a1c9 100644
--- a/gdk/wayland/gdkapplaunchcontext-wayland.c
+++ b/gdk/wayland/gdkapplaunchcontext-wayland.c
@@ -26,7 +26,6 @@
 #include "gdkwayland.h"
 #include "gdkprivate-wayland.h"
 #include "gdkapplaunchcontextprivate.h"
-#include "gdkscreen.h"
 #include "gdkinternals.h"
 #include "gdkintl.h"
 
diff --git a/gdk/x11/gdkapplaunchcontext-x11.c b/gdk/x11/gdkapplaunchcontext-x11.c
index b7fa648..7abb0a1 100644
--- a/gdk/x11/gdkapplaunchcontext-x11.c
+++ b/gdk/x11/gdkapplaunchcontext-x11.c
@@ -282,10 +282,7 @@ gdk_x11_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
   ctx = GDK_APP_LAUNCH_CONTEXT (context);
 
   display = ctx->display;
-  if (ctx->screen)
-    screen = ctx->screen;
-  else
-    screen = gdk_display_get_default_screen (ctx->display);
+  screen = gdk_display_get_default_screen (ctx->display);
 
   fileinfo = NULL;
 
@@ -402,10 +399,7 @@ gdk_x11_app_launch_context_launch_failed (GAppLaunchContext *context,
 
   ctx = GDK_APP_LAUNCH_CONTEXT (context);
 
-  if (ctx->screen)
-    screen = ctx->screen;
-  else
-    screen = gdk_display_get_default_screen (ctx->display);
+  screen = gdk_display_get_default_screen (ctx->display);
 
   data = g_object_get_data (G_OBJECT (screen), "appinfo-startup-data");
 


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