[gnome-panel] fish: avoid deprecated gdk_screen_make_display_name



commit 79d1bd18c7832a9d8e9073b9ee0b75c251fd2e77
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Oct 28 01:24:09 2016 +0300

    fish: avoid deprecated gdk_screen_make_display_name

 applets/fish/fish-applet.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/applets/fish/fish-applet.c b/applets/fish/fish-applet.c
index af235a3..4c65759 100644
--- a/applets/fish/fish-applet.c
+++ b/applets/fish/fish-applet.c
@@ -584,9 +584,13 @@ fish_read_output (GIOChannel   *source,
  * Set the DISPLAY variable, to be use by g_spawn_async.
  */
 static void
-set_environment (gpointer display)
+set_environment (gpointer user_data)
 {
-       g_setenv ("DISPLAY", display, TRUE);
+       GdkDisplay *display;
+
+       display = gdk_display_get_default ();
+
+       g_setenv ("DISPLAY", gdk_display_get_name (display), TRUE);
 }
 
 static void
@@ -599,7 +603,6 @@ display_fortune_dialog (FishApplet *fish)
        int          argc;
        char       **argv;
        GdkScreen   *screen;
-       char        *display;
 
        /* if there is still a pipe, close it */
        if (fish->source_id)
@@ -713,22 +716,18 @@ display_fortune_dialog (FishApplet *fish)
 
        clear_fortune_text (fish);
 
-       display = gdk_screen_make_display_name (screen);
-
        g_spawn_async_with_pipes (NULL, /* working directory */
                                  argv,
                                  NULL, /* envp */
                                  G_SPAWN_SEARCH_PATH|G_SPAWN_STDERR_TO_DEV_NULL,
                                  set_environment,
-                                 &display,
+                                 NULL,
                                  NULL, /* child pid */
                                  NULL, /* stdin */
                                  &output,
                                  NULL, /* stderr */
                                  &error);
 
-       g_free (display);
-
        if (error) {
                char *message;
 


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