[libwnck] core: Add Screen argument to _wnck_get_utf8_property()



commit 5d08138ed40a4869c89133acab5d17e676405ccc
Author: Vincent Untz <vuntz gnome org>
Date:   Wed Jan 19 22:47:49 2011 +0100

    core: Add Screen argument to _wnck_get_utf8_property()

 libwnck/application.c |    3 ++-
 libwnck/screen.c      |    8 ++++++--
 libwnck/window.c      |    3 ++-
 libwnck/xutils.c      |   16 ++++++++++------
 libwnck/xutils.h      |    3 ++-
 5 files changed, 22 insertions(+), 11 deletions(-)
---
diff --git a/libwnck/application.c b/libwnck/application.c
index 97ffed9..c7cfdef 100644
--- a/libwnck/application.c
+++ b/libwnck/application.c
@@ -542,7 +542,8 @@ _wnck_application_create (Window      xwindow,
   application->priv->pid = _wnck_get_pid (xscreen,
                                           application->priv->xwindow);
 
-  application->priv->startup_id = _wnck_get_utf8_property (application->priv->xwindow,
+  application->priv->startup_id = _wnck_get_utf8_property (xscreen,
+                                                           application->priv->xwindow,
                                                            _wnck_atom_get ("_NET_STARTUP_ID"));
 
   g_hash_table_insert (app_hash, &application->priv->xwindow, application);
diff --git a/libwnck/screen.c b/libwnck/screen.c
index b426630..f93d7ca 100644
--- a/libwnck/screen.c
+++ b/libwnck/screen.c
@@ -2187,15 +2187,18 @@ update_showing_desktop (WnckScreen *screen)
 static void
 update_wm (WnckScreen *screen)
 {
+  Screen *xscreen;
   Window  wm_window;
 
   if (!screen->priv->need_update_wm)
     return;
 
+  xscreen = WNCK_SCREEN_XSCREEN (screen);
+
   screen->priv->need_update_wm = FALSE;
 
   wm_window = None;
-  _wnck_get_window (WNCK_SCREEN_XSCREEN (screen),
+  _wnck_get_window (xscreen,
                     screen->priv->xroot,
                     _wnck_atom_get ("_NET_SUPPORTING_WM_CHECK"),
                     &wm_window);
@@ -2203,7 +2206,8 @@ update_wm (WnckScreen *screen)
   g_free (screen->priv->wm_name);
 
   if (wm_window != None)
-    screen->priv->wm_name = _wnck_get_utf8_property (wm_window,
+    screen->priv->wm_name = _wnck_get_utf8_property (xscreen,
+                                                     wm_window,
                                                      _wnck_atom_get ("_NET_WM_NAME"));
   else
     screen->priv->wm_name = NULL;
diff --git a/libwnck/window.c b/libwnck/window.c
index dc8241d..dd79f1c 100644
--- a/libwnck/window.c
+++ b/libwnck/window.c
@@ -3039,7 +3039,8 @@ update_startup_id (WnckWindow *window)
 
   g_free (window->priv->startup_id);
   window->priv->startup_id =
-    _wnck_get_utf8_property (window->priv->xwindow,
+    _wnck_get_utf8_property (WNCK_SCREEN_XSCREEN (window->priv->screen),
+                             window->priv->xwindow,
                              _wnck_atom_get ("_NET_STARTUP_ID"));
 }
 
diff --git a/libwnck/xutils.c b/libwnck/xutils.c
index 1a0450c..23f89d7 100644
--- a/libwnck/xutils.c
+++ b/libwnck/xutils.c
@@ -358,9 +358,11 @@ _wnck_get_string_property_latin1 (Screen *screen,
 }
 
 char*
-_wnck_get_utf8_property (Window  xwindow,
+_wnck_get_utf8_property (Screen *screen,
+                         Window  xwindow,
                          Atom    atom)
 {
+  Display *display;
   Atom type;
   int format;
   gulong nitems;
@@ -370,12 +372,14 @@ _wnck_get_utf8_property (Window  xwindow,
   char *retval;
   Atom utf8_string;
 
+  display = DisplayOfScreen (screen);
+
   utf8_string = _wnck_atom_get ("UTF8_STRING");
 
   _wnck_error_trap_push ();
   type = None;
   val = NULL;
-  result = XGetWindowProperty (_wnck_get_default_display(),
+  result = XGetWindowProperty (display,
 			       xwindow,
 			       atom,
 			       0, G_MAXLONG,
@@ -1186,11 +1190,11 @@ _wnck_get_name (Screen *screen,
 {
   char *name;
 
-  name = _wnck_get_utf8_property (xwindow,
+  name = _wnck_get_utf8_property (screen, xwindow,
                                   _wnck_atom_get ("_NET_WM_VISIBLE_NAME"));
 
   if (name == NULL)
-    name = _wnck_get_utf8_property (xwindow,
+    name = _wnck_get_utf8_property (screen, xwindow,
                                     _wnck_atom_get ("_NET_WM_NAME"));
 
   if (name == NULL)
@@ -1206,11 +1210,11 @@ _wnck_get_icon_name (Screen *screen,
 {
   char *name;
 
-  name = _wnck_get_utf8_property (xwindow,
+  name = _wnck_get_utf8_property (screen, xwindow,
                                   _wnck_atom_get ("_NET_WM_VISIBLE_ICON_NAME"));
 
   if (name == NULL)
-    name = _wnck_get_utf8_property (xwindow,
+    name = _wnck_get_utf8_property (screen, xwindow,
                                     _wnck_atom_get ("_NET_WM_ICON_NAME"));
 
   if (name == NULL)
diff --git a/libwnck/xutils.h b/libwnck/xutils.h
index 59ad071..81dd427 100644
--- a/libwnck/xutils.h
+++ b/libwnck/xutils.h
@@ -59,7 +59,8 @@ gboolean _wnck_get_atom          (Screen *screen,
 char*    _wnck_get_text_property (Screen *screen,
                                   Window  xwindow,
                                   Atom    atom);
-char*    _wnck_get_utf8_property (Window  xwindow,
+char*    _wnck_get_utf8_property (Screen *screen,
+                                  Window  xwindow,
                                   Atom    atom);
 gboolean _wnck_get_window_list   (Window   xwindow,
                                   Atom     atom,



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