[libwnck/wip/muktupavels/wnck-handle: 42/44] urgency-monitor: port to WnckHandle




commit fed1fdd572a27d14408afa95a468cad4fd8c849c
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Mon Aug 19 21:55:19 2019 +0300

    urgency-monitor: port to WnckHandle

 libwnck/wnck-urgency-monitor.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/libwnck/wnck-urgency-monitor.c b/libwnck/wnck-urgency-monitor.c
index f4eecd1..7ee4feb 100644
--- a/libwnck/wnck-urgency-monitor.c
+++ b/libwnck/wnck-urgency-monitor.c
@@ -188,6 +188,7 @@ main (int argc, char **argv)
 {
   GOptionContext *ctxt;
   GError         *error;
+  WnckHandle     *handle;
   WnckScreen     *screen;
 
   ctxt = g_option_context_new (NULL);
@@ -210,9 +211,9 @@ main (int argc, char **argv)
 
   gtk_init (&argc, &argv);
 
-  wnck_set_client_type (WNCK_CLIENT_TYPE_PAGER);
+  handle = wnck_handle_new (WNCK_CLIENT_TYPE_PAGER);
+  screen = wnck_handle_get_default_screen (handle);
 
-  screen = wnck_screen_get_default ();
   g_signal_connect (screen, "window_opened",
                     G_CALLBACK (connect_to_window), NULL);
   g_signal_connect (screen, "window_closed",
@@ -220,5 +221,7 @@ main (int argc, char **argv)
 
   gtk_main ();
 
+  g_object_unref (handle);
+
   return 0;
 }


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