[gnome-applets] window-title: port to WnckHandle



commit e1452b9defc9931dea4d610ed7d6089a3ca2d6fa
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Oct 2 15:14:08 2022 +0300

    window-title: port to WnckHandle

 gnome-applets/window-title/window-title-private.h | 1 +
 gnome-applets/window-title/window-title.c         | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gnome-applets/window-title/window-title-private.h 
b/gnome-applets/window-title/window-title-private.h
index 4e7885b7b..735d22127 100644
--- a/gnome-applets/window-title/window-title-private.h
+++ b/gnome-applets/window-title/window-title-private.h
@@ -86,6 +86,7 @@ struct _WTApplet
 
        /* Variables */
        WTPreferences   *prefs;                                 // Main properties
+       WnckHandle *handle;
        WnckScreen              *activescreen;                  // Active screen
 
        gulong active_window_changed_id;
diff --git a/gnome-applets/window-title/window-title.c b/gnome-applets/window-title/window-title.c
index 6d7d34213..47a91f131 100644
--- a/gnome-applets/window-title/window-title.c
+++ b/gnome-applets/window-title/window-title.c
@@ -120,6 +120,8 @@ wt_applet_dispose (GObject *object)
         }
     }
 
+  g_clear_object (&self->handle);
+
   G_OBJECT_CLASS (wt_applet_parent_class)->dispose (object);
 }
 
@@ -137,7 +139,7 @@ wt_applet_class_init (WTAppletClass *self_class)
 static void
 wt_applet_init (WTApplet *self)
 {
-  wnck_set_client_type (WNCK_CLIENT_TYPE_PAGER);
+  self->handle = wnck_handle_new (WNCK_CLIENT_TYPE_PAGER);
 }
 
 /* Safely returns the bottom-most (root) window */
@@ -696,7 +698,7 @@ init_wtapplet (WTApplet *wtapplet)
 
        wtapplet->settings = gp_applet_settings_new (applet, WINDOWTITLE_GSCHEMA);
        wtapplet->prefs = wt_applet_load_preferences(wtapplet);
-       wtapplet->activescreen = wnck_screen_get_default();
+       wtapplet->activescreen = wnck_handle_get_default_screen (wtapplet->handle);
        wnck_screen_force_update(wtapplet->activescreen);
        wtapplet->activeworkspace = wnck_screen_get_active_workspace(wtapplet->activescreen);
        wtapplet->activewindow = wnck_screen_get_active_window(wtapplet->activescreen);


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