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

Bug#598865: unblock: libwnck/2.30.4-2



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: freeze-exception

Hi,

please unblock libwnck for squeeze.

libwnck (2.30.4-2) unstable; urgency=low

  * 10_pager_multirow.patch: stolen upstream. Fix an unitialized value 
    bug that causes issues with:
    + Multi-row pagers. Closes: #597540.
    + Vertical pagers. Closes: #598122.
    + Xmonad. Closes: #597911.

libwnck (2.30.4-1) unstable; urgency=low

  * 01_tasklist_orientation.patch: require to set a macro to use the 
    non-upstreamed API.
  * New upstream translation and bugfix release.

Upstream changes:
==============
Version 2.30.4
==============
 Fixes
  - Stop using gdk_display (Vincent)
 Misc
  - Update information in README and other files (Vincent)
 Translators
  - Dirgita (id)

Attaching the upstream changes, and the added patch. The change to
01_tasklist_orientation is as trivial as the changelog says. 

Cheers,
-- 
 .''`.      Josselin Mouette
: :' :
`. `'  “If you behave this way because you are blackmailed by someone,
  `-    […] I will see what I can do for you.”  -- Jörg Schilling


--- libwnck-2.30.3/libwnck/private.h	2010-02-09 12:27:10.000000000 +0000
+++ libwnck-2.30.4/libwnck/private.h	2010-09-11 10:03:36.000000000 +0000
@@ -110,6 +110,7 @@
 gboolean _wnck_workspace_set_viewport (WnckWorkspace *space, int x, int y);
 
 void _wnck_init (void);
+Display *_wnck_get_default_display (void);
 
 #define DEFAULT_ICON_WIDTH 32
 #define DEFAULT_ICON_HEIGHT 32
--- libwnck-2.30.3/libwnck/screen.c	2010-08-04 11:28:16.000000000 +0000
+++ libwnck-2.30.4/libwnck/screen.c	2010-09-13 04:12:48.000000000 +0000
@@ -566,14 +566,14 @@
 sn_error_trap_push (SnDisplay *display,
                     Display   *xdisplay)
 {
-  gdk_error_trap_push ();
+  _wnck_error_trap_push ();
 }
 
 static void
 sn_error_trap_pop (SnDisplay *display,
                    Display   *xdisplay)
 {
-  gdk_error_trap_pop ();
+  _wnck_error_trap_pop ();
 }
 #endif /* HAVE_STARTUP_NOTIFICATION */
 
@@ -581,13 +581,17 @@
 wnck_screen_construct (WnckScreen *screen,
                        int         number)
 {
+  Display *display;
+
+  display = _wnck_get_default_display ();
+
   /* Create the initial state of the screen. */
-  screen->priv->xroot = RootWindow (gdk_display, number);
-  screen->priv->xscreen = ScreenOfDisplay (gdk_display, number);
+  screen->priv->xroot = RootWindow (display, number);
+  screen->priv->xscreen = ScreenOfDisplay (display, number);
   screen->priv->number = number;
 
 #ifdef HAVE_STARTUP_NOTIFICATION
-  screen->priv->sn_display = sn_display_new (gdk_display,
+  screen->priv->sn_display = sn_display_new (display,
                                              sn_error_trap_push,
                                              sn_error_trap_pop);
 #endif
@@ -624,14 +628,18 @@
 WnckScreen*
 wnck_screen_get (int index)
 {
-  g_return_val_if_fail (gdk_display != NULL, NULL);
+  Display *display;
 
-  if (index >= ScreenCount (gdk_display))
+  display = _wnck_get_default_display ();
+
+  g_return_val_if_fail (display != NULL, NULL);
+
+  if (index >= ScreenCount (display))
     return NULL;
   
   if (screens == NULL)
     {
-      screens = g_new0 (WnckScreen*, ScreenCount (gdk_display));
+      screens = g_new0 (WnckScreen*, ScreenCount (display));
       _wnck_event_filter_init ();
     }
   
@@ -648,8 +656,12 @@
 WnckScreen*
 _wnck_screen_get_existing (int number)
 {
-  g_return_val_if_fail (gdk_display != NULL, NULL);
-  g_return_val_if_fail (number < ScreenCount (gdk_display), NULL);
+  Display *display;
+
+  display = _wnck_get_default_display ();
+
+  g_return_val_if_fail (display != NULL, NULL);
+  g_return_val_if_fail (number < ScreenCount (display), NULL);
 
   if (screens != NULL)
     return screens[number];
@@ -670,7 +682,7 @@
 {
   int default_screen;
 
-  default_screen = DefaultScreen (gdk_display);
+  default_screen = DefaultScreen (_wnck_get_default_display ());
 
   return wnck_screen_get (default_screen);
 }
@@ -693,12 +705,15 @@
 wnck_screen_get_for_root (gulong root_window_id)
 {
   int i;
+  Display *display;
   
   if (screens == NULL)
     return NULL;
 
   i = 0;
-  while (i < ScreenCount (gdk_display))
+  display = _wnck_get_default_display ();
+
+  while (i < ScreenCount (display))
     {
       if (screens[i] != NULL && screens[i]->priv->xroot == root_window_id)
         return screens[i];
--- libwnck-2.30.3/libwnck/util.c	2010-03-29 23:46:48.000000000 +0000
+++ libwnck-2.30.4/libwnck/util.c	2010-09-11 11:11:10.000000000 +0000
@@ -745,6 +745,14 @@
     }
 }
 
+Display *
+_wnck_get_default_display (void)
+{
+  /* FIXME: when we fix libwnck to not use the GDK default display, we will
+   * need to fix wnckprop accordingly. */
+  return GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
+}
+
 /* stock icon code Copyright (C) 2002 Jorn Baayen <jorn@nl.linux.org> */
 typedef struct
 {
--- libwnck-2.30.3/libwnck/window.c	2010-08-04 11:22:28.000000000 +0000
+++ libwnck-2.30.4/libwnck/window.c	2010-09-11 10:19:52.000000000 +0000
@@ -579,6 +579,12 @@
   g_object_unref (G_OBJECT (window));
 }
 
+static Display *
+_wnck_window_get_display (WnckWindow *window)
+{
+  return DisplayOfScreen (WNCK_SCREEN_XSCREEN (window->priv->screen));
+}
+
 /**
  * wnck_window_has_name:
  * @window: a #WnckWindow.
@@ -979,7 +985,7 @@
   }
   _wnck_error_trap_push ();
 
-  XChangeProperty (gdk_display,
+  XChangeProperty (_wnck_window_get_display (window),
                    window->priv->xwindow, 
                    _wnck_atom_get ("_NET_WM_WINDOW_TYPE"),
 		   XA_ATOM, 32, PropModeReplace,
@@ -3057,7 +3063,7 @@
     return;
 
   _wnck_error_trap_push ();
-  hints = XGetWMHints (gdk_display, window->priv->xwindow);
+  hints = XGetWMHints (_wnck_window_get_display (window), window->priv->xwindow);
   _wnck_error_trap_pop ();
 
   if (hints)
--- libwnck-2.30.3/libwnck/wnckprop.c	2010-02-09 12:27:10.000000000 +0000
+++ libwnck-2.30.4/libwnck/wnckprop.c	2010-09-11 11:14:45.000000000 +0000
@@ -320,35 +320,37 @@
 static guint32
 get_xserver_timestamp (WnckScreen *screen)
 {
+  Display *display;
   int number;
   Screen *xscreen;
   TimeStampInfo info;
   unsigned char c = 'a';
   XEvent xevent;
 
+  display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
   number = wnck_screen_get_number (screen);
-  xscreen = ScreenOfDisplay (gdk_display, number);
+  xscreen = ScreenOfDisplay (display, number);
 
-  info.window = XCreateSimpleWindow (gdk_display,
+  info.window = XCreateSimpleWindow (display,
                                      RootWindowOfScreen (xscreen),
                                      0, 0, 10, 10, 0,
-                                     WhitePixel (gdk_display, number),
-                                     WhitePixel (gdk_display, number));
-  info.timestamp_prop_atom = XInternAtom (gdk_display, "_TIMESTAMP_PROP",
+                                     WhitePixel (display, number),
+                                     WhitePixel (display, number));
+  info.timestamp_prop_atom = XInternAtom (display, "_TIMESTAMP_PROP",
                                           FALSE);
 
-  XSelectInput (gdk_display, info.window, PropertyChangeMask);
+  XSelectInput (display, info.window, PropertyChangeMask);
 
-  XChangeProperty (gdk_display, info.window,
+  XChangeProperty (display, info.window,
 		   info.timestamp_prop_atom, info.timestamp_prop_atom,
 		   8, PropModeReplace, &c, 1);
 
-  XIfEvent (gdk_display, &xevent,
+  XIfEvent (display, &xevent,
 	    timestamp_predicate, (XPointer)&info);
 
-  XDestroyWindow (gdk_display, info.window);
+  XDestroyWindow (display, info.window);
 
-  XSync (gdk_display, False);
+  XSync (display, False);
 
   return xevent.xproperty.time;
 }
@@ -1650,7 +1652,8 @@
 }
 
 static gboolean
-wm_state_set (Window window)
+wm_state_set (Display *display,
+              Window   window)
 {
   Atom    wm_state;
   gulong  nitems;
@@ -1663,7 +1666,7 @@
   wm_state = gdk_x11_get_xatom_by_name ("WM_STATE");
 
   gdk_error_trap_push ();
-  result = XGetWindowProperty (gdk_display,
+  result = XGetWindowProperty (display,
                                window,
                                wm_state,
                                0, G_MAXLONG,
@@ -1683,7 +1686,8 @@
 }
 
 static WnckWindow *
-find_managed_window (Window window)
+find_managed_window (Display *display,
+                     Window   window)
 {
   Window      root;
   Window      parent;
@@ -1692,11 +1696,11 @@
   guint       nkids;
   int         i, result;
 
-  if (wm_state_set (window))
+  if (wm_state_set (display, window))
     return wnck_window_get (window);
 
   gdk_error_trap_push ();
-  result = XQueryTree (gdk_display, window, &root, &parent, &kids, &nkids);
+  result = XQueryTree (display, window, &root, &parent, &kids, &nkids);
   if (gdk_error_trap_pop () || !result)
     return NULL;
 
@@ -1704,13 +1708,13 @@
 
   for (i = 0; i < nkids; i++)
     {
-      if (wm_state_set (kids [i]))
+      if (wm_state_set (display, kids [i]))
         {
           retval = wnck_window_get (kids [i]);
           break;
         }
 
-      retval = find_managed_window (kids [i]);
+      retval = find_managed_window (display, kids [i]);
       if (retval != NULL)
         break;
     }
@@ -1727,7 +1731,7 @@
   if (event->subwindow == None)
     return;
 
-  got_from_user = find_managed_window (event->subwindow);
+  got_from_user = find_managed_window (event->display, event->subwindow);
 }
 
 static GdkFilterReturn
@@ -1744,7 +1748,7 @@
         clean_up ();
         return GDK_FILTER_REMOVE;
       case KeyPress:
-        if (xevent->xkey.keycode == XKeysymToKeycode (gdk_display, XK_Escape))
+        if (xevent->xkey.keycode == XKeysymToKeycode (xevent->xany.display, XK_Escape))
           {
             clean_up ();
             return GDK_FILTER_REMOVE;
--- libwnck-2.30.3/libwnck/xutils.c	2010-06-01 13:56:13.000000000 +0000
+++ libwnck-2.30.4/libwnck/xutils.c	2010-09-11 11:07:32.000000000 +0000
@@ -46,7 +46,7 @@
   
   _wnck_error_trap_push ();
   type = None;
-  result = XGetWindowProperty (gdk_display,
+  result = XGetWindowProperty (_wnck_get_default_display(),
 			       xwindow,
 			       atom,
 			       0, G_MAXLONG,
@@ -87,7 +87,7 @@
   
   _wnck_error_trap_push ();
   type = None;
-  result = XGetWindowProperty (gdk_display,
+  result = XGetWindowProperty (_wnck_get_default_display(),
 			       xwindow,
 			       wm_state,
 			       0, G_MAXLONG,
@@ -127,7 +127,7 @@
   
   _wnck_error_trap_push ();
   type = None;
-  result = XGetWindowProperty (gdk_display,
+  result = XGetWindowProperty (_wnck_get_default_display(),
 			       xwindow,
 			       atom,
 			       0, G_MAXLONG,
@@ -167,7 +167,7 @@
   
   _wnck_error_trap_push ();
   type = None;
-  result = XGetWindowProperty (gdk_display,
+  result = XGetWindowProperty (_wnck_get_default_display(),
 			       xwindow,
 			       atom,
 			       0, G_MAXLONG,
@@ -207,7 +207,7 @@
   
   _wnck_error_trap_push ();
   type = None;
-  result = XGetWindowProperty (gdk_display,
+  result = XGetWindowProperty (_wnck_get_default_display(),
 			       xwindow,
 			       atom,
 			       0, G_MAXLONG,
@@ -269,7 +269,7 @@
   _wnck_error_trap_push ();
 
   text.nitems = 0;
-  if (XGetTextProperty (gdk_display,
+  if (XGetTextProperty (_wnck_get_default_display(),
                         xwindow,
                         &text,
                         atom))
@@ -303,7 +303,7 @@
   
   _wnck_error_trap_push ();
   str = NULL;
-  result = XGetWindowProperty (gdk_display,
+  result = XGetWindowProperty (_wnck_get_default_display(),
 			       xwindow, atom,
 			       0, G_MAXLONG,
 			       False, XA_STRING, &type, &format, &nitems,
@@ -345,7 +345,7 @@
   _wnck_error_trap_push ();
   type = None;
   val = NULL;
-  result = XGetWindowProperty (gdk_display,
+  result = XGetWindowProperty (_wnck_get_default_display(),
 			       xwindow,
 			       atom,
 			       0, G_MAXLONG,
@@ -400,7 +400,7 @@
   
   _wnck_error_trap_push ();
   type = None;
-  result = XGetWindowProperty (gdk_display,
+  result = XGetWindowProperty (_wnck_get_default_display(),
 			       xwindow,
 			       atom,
 			       0, G_MAXLONG,
@@ -444,7 +444,7 @@
   
   _wnck_error_trap_push ();
   type = None;
-  result = XGetWindowProperty (gdk_display,
+  result = XGetWindowProperty (_wnck_get_default_display(),
 			       xwindow,
 			       atom,
 			       0, G_MAXLONG,
@@ -488,7 +488,7 @@
   
   _wnck_error_trap_push ();
   type = None;
-  result = XGetWindowProperty (gdk_display,
+  result = XGetWindowProperty (_wnck_get_default_display(),
 			       xwindow,
 			       atom,
 			       0, G_MAXLONG,
@@ -535,7 +535,7 @@
   _wnck_error_trap_push ();
   type = None;
   val = NULL;
-  result = XGetWindowProperty (gdk_display,
+  result = XGetWindowProperty (_wnck_get_default_display(),
 			       xwindow,
 			       atom,
 			       0, G_MAXLONG,
@@ -625,7 +625,7 @@
 
   _wnck_error_trap_push ();
   
-  XChangeProperty (gdk_display,
+  XChangeProperty (_wnck_get_default_display(),
 		   xwindow,
                    atom,
 		   utf8_string, 8, PropModeReplace,
@@ -645,7 +645,7 @@
 int
 _wnck_error_trap_pop (void)
 {
-  XSync (gdk_display, False);
+  XSync (_wnck_get_default_display(), False);
   return gdk_error_trap_pop ();
 }
 
@@ -655,7 +655,10 @@
              gpointer    data)
 {
   XEvent *xevent = gdkxevent;
+#ifdef HAVE_STARTUP_NOTIFICATION
   int i;
+  Display *display;
+#endif /* HAVE_STARTUP_NOTIFICATION */
   
   switch (xevent->type)
     {
@@ -706,7 +709,9 @@
        * us to send all events through sn_display_process_event
        */
       i = 0;
-      while (i < ScreenCount (gdk_display))
+      display = _wnck_get_default_display ();
+
+      while (i < ScreenCount (display))
         {
           WnckScreen *s;
 
@@ -759,8 +764,12 @@
 void
 _wnck_iconify (Window xwindow)
 {
+  Display *display;
+
+  display = _wnck_get_default_display ();
+
   _wnck_error_trap_push ();
-  XIconifyWindow (gdk_display, xwindow, DefaultScreen (gdk_display));
+  XIconifyWindow (display, xwindow, DefaultScreen (display));
   _wnck_error_trap_pop ();
 }
 
@@ -779,7 +788,7 @@
   if (gdkwindow)
     gdk_window_show (gdkwindow);
   else
-    XMapRaised (gdk_display, xwindow);
+    XMapRaised (_wnck_get_default_display (), xwindow);
   _wnck_error_trap_pop ();
 }
 
@@ -788,12 +797,17 @@
 	     Window  xwindow,
 	     Time    timestamp)
 {
-  XEvent xev;
+  Display *display;
+  Window   root;
+  XEvent   xev;
+
+  display = DisplayOfScreen (screen);
+  root = RootWindowOfScreen (screen);
   
   xev.xclient.type = ClientMessage;
   xev.xclient.serial = 0;
   xev.xclient.send_event = True;
-  xev.xclient.display = gdk_display;
+  xev.xclient.display = display;
   xev.xclient.window = xwindow;
   xev.xclient.message_type = _wnck_atom_get ("_NET_CLOSE_WINDOW");
   xev.xclient.format = 32;
@@ -804,8 +818,8 @@
   xev.xclient.data.l[4] = 0;
 
   _wnck_error_trap_push ();
-  XSendEvent (gdk_display,
-              RootWindowOfScreen (screen),
+  XSendEvent (display,
+              root,
               False,
 	      SubstructureRedirectMask | SubstructureNotifyMask,
 	      &xev); 
@@ -828,12 +842,17 @@
 _wnck_keyboard_move (Screen *screen,
                      Window  xwindow)
 {
-  XEvent xev;
+  Display *display;
+  Window   root;
+  XEvent   xev;
+
+  display = DisplayOfScreen (screen);
+  root = RootWindowOfScreen (screen);
   
   xev.xclient.type = ClientMessage;
   xev.xclient.serial = 0;
   xev.xclient.send_event = True;
-  xev.xclient.display = gdk_display;
+  xev.xclient.display = display;
   xev.xclient.window = xwindow;
   xev.xclient.message_type = _wnck_atom_get ("_NET_WM_MOVERESIZE");
   xev.xclient.format = 32;
@@ -844,8 +863,8 @@
   xev.xclient.data.l[4] = _wnck_get_client_type ();
 
   _wnck_error_trap_push ();
-  XSendEvent (gdk_display,
-              RootWindowOfScreen (screen),
+  XSendEvent (display,
+              root,
               False,
               SubstructureRedirectMask | SubstructureNotifyMask,
               &xev); 
@@ -856,12 +875,17 @@
 _wnck_keyboard_size (Screen *screen,
                      Window  xwindow)
 {
-  XEvent xev;
+  Display *display;
+  Window   root;
+  XEvent   xev;
+
+  display = DisplayOfScreen (screen);
+  root = RootWindowOfScreen (screen);
   
   xev.xclient.type = ClientMessage;
   xev.xclient.serial = 0;
   xev.xclient.send_event = True;
-  xev.xclient.display = gdk_display;
+  xev.xclient.display = display;
   xev.xclient.window = xwindow;
   xev.xclient.message_type = _wnck_atom_get ("_NET_WM_MOVERESIZE");
   xev.xclient.format = 32;
@@ -872,8 +896,8 @@
   xev.xclient.data.l[4] = _wnck_get_client_type ();
 
   _wnck_error_trap_push ();
-  XSendEvent (gdk_display,
-              RootWindowOfScreen (screen),
+  XSendEvent (display,
+              root,
               False,
               SubstructureRedirectMask | SubstructureNotifyMask,
               &xev); 
@@ -887,16 +911,21 @@
                     Atom     state1,
                     Atom     state2)
 {
-  XEvent xev;
+  Display *display;
+  Window   root;
+  XEvent   xev;
 
 #define _NET_WM_STATE_REMOVE        0    /* remove/unset property */
 #define _NET_WM_STATE_ADD           1    /* add/set property */
 #define _NET_WM_STATE_TOGGLE        2    /* toggle property  */  
   
+  display = DisplayOfScreen (screen);
+  root = RootWindowOfScreen (screen);
+
   xev.xclient.type = ClientMessage;
   xev.xclient.serial = 0;
   xev.xclient.send_event = True;
-  xev.xclient.display = gdk_display;
+  xev.xclient.display = display;
   xev.xclient.window = xwindow;
   xev.xclient.message_type = _wnck_atom_get ("_NET_WM_STATE");
   xev.xclient.format = 32;
@@ -907,8 +936,8 @@
   xev.xclient.data.l[4] = 0;
 
   _wnck_error_trap_push ();
-  XSendEvent (gdk_display,
-	      RootWindowOfScreen (screen),
+  XSendEvent (display,
+	      root,
               False,
 	      SubstructureRedirectMask | SubstructureNotifyMask,
 	      &xev);
@@ -920,12 +949,17 @@
 			Window      xwindow,
                         int         new_space)
 {
-  XEvent xev;
+  Display *display;
+  Window   root;
+  XEvent   xev;
+
+  display = DisplayOfScreen (screen);
+  root = RootWindowOfScreen (screen);
   
   xev.xclient.type = ClientMessage;
   xev.xclient.serial = 0;
   xev.xclient.send_event = True;
-  xev.xclient.display = gdk_display;
+  xev.xclient.display = display;
   xev.xclient.window = xwindow;
   xev.xclient.message_type = _wnck_atom_get ("_NET_WM_DESKTOP");
   xev.xclient.format = 32;
@@ -936,8 +970,8 @@
   xev.xclient.data.l[4] = 0;
 
   _wnck_error_trap_push ();
-  XSendEvent (gdk_display,
-	      RootWindowOfScreen (screen),
+  XSendEvent (display,
+	      root,
               False,
 	      SubstructureRedirectMask | SubstructureNotifyMask,
 	      &xev);
@@ -949,16 +983,21 @@
                 Window  xwindow,
                 Time    timestamp)
 {
-  XEvent xev;
+  Display *display;
+  Window   root;
+  XEvent   xev;
 
   if (timestamp == 0)
     g_warning ("Received a timestamp of 0; window activation may not "
                "function properly.\n");
   
+  display = DisplayOfScreen (screen);
+  root = RootWindowOfScreen (screen);
+
   xev.xclient.type = ClientMessage;
   xev.xclient.serial = 0;
   xev.xclient.send_event = True;
-  xev.xclient.display = gdk_display;
+  xev.xclient.display = display;
   xev.xclient.window = xwindow;
   xev.xclient.message_type = _wnck_atom_get ("_NET_ACTIVE_WINDOW");
   xev.xclient.format = 32;
@@ -969,8 +1008,8 @@
   xev.xclient.data.l[4] = 0;
 
   _wnck_error_trap_push ();
-  XSendEvent (gdk_display,
-	      RootWindowOfScreen (screen),
+  XSendEvent (display,
+	      root,
               False,
 	      SubstructureRedirectMask | SubstructureNotifyMask,
 	      &xev); 
@@ -982,13 +1021,18 @@
                           int     new_active_space,
                           Time    timestamp)
 {
-  XEvent xev;
+  Display *display;
+  Window   root;
+  XEvent   xev;
+
+  display = DisplayOfScreen (screen);
+  root = RootWindowOfScreen (screen);
   
   xev.xclient.type = ClientMessage;
   xev.xclient.serial = 0;
   xev.xclient.send_event = True;
-  xev.xclient.display = gdk_display;
-  xev.xclient.window = RootWindowOfScreen (screen);
+  xev.xclient.display = display;
+  xev.xclient.window = root;
   xev.xclient.message_type = _wnck_atom_get ("_NET_CURRENT_DESKTOP");
   xev.xclient.format = 32;
   xev.xclient.data.l[0] = new_active_space;
@@ -998,8 +1042,8 @@
   xev.xclient.data.l[4] = 0;
 
   _wnck_error_trap_push ();
-  XSendEvent (gdk_display,
-	      RootWindowOfScreen (screen),
+  XSendEvent (display,
+	      root,
               False,
 	      SubstructureRedirectMask | SubstructureNotifyMask,
 	      &xev);
@@ -1011,13 +1055,18 @@
 		       int     x,
 		       int     y)
 {
-  XEvent xev;
+  Display *display;
+  Window   root;
+  XEvent   xev;
+
+  display = DisplayOfScreen (screen);
+  root = RootWindowOfScreen (screen);
   
   xev.xclient.type = ClientMessage;
   xev.xclient.serial = 0;
   xev.xclient.send_event = True;
-  xev.xclient.display = gdk_display;
-  xev.xclient.window = RootWindowOfScreen (screen);
+  xev.xclient.display = display;
+  xev.xclient.window = root;
   xev.xclient.message_type = _wnck_atom_get ("_NET_DESKTOP_VIEWPORT");
   xev.xclient.format = 32;
   xev.xclient.data.l[0] = x;
@@ -1027,8 +1076,8 @@
   xev.xclient.data.l[4] = 0;
 
   _wnck_error_trap_push ();
-  XSendEvent (gdk_display,
-	      RootWindowOfScreen (screen),
+  XSendEvent (display,
+	      root,
               False,
 	      SubstructureRedirectMask | SubstructureNotifyMask,
 	      &xev);
@@ -1039,13 +1088,18 @@
 _wnck_toggle_showing_desktop (Screen  *screen,
                               gboolean show)
 {
-  XEvent xev;
+  Display *display;
+  Window   root;
+  XEvent   xev;
+
+  display = DisplayOfScreen (screen);
+  root = RootWindowOfScreen (screen);
   
   xev.xclient.type = ClientMessage;
   xev.xclient.serial = 0;
   xev.xclient.send_event = True;
-  xev.xclient.display = DisplayOfScreen (screen);
-  xev.xclient.window = RootWindowOfScreen (screen);
+  xev.xclient.display = display;
+  xev.xclient.window = root;
   xev.xclient.message_type = _wnck_atom_get ("_NET_SHOWING_DESKTOP");
   xev.xclient.format = 32;
   xev.xclient.data.l[0] = show != FALSE;
@@ -1055,8 +1109,8 @@
   xev.xclient.data.l[4] = 0;
 
   _wnck_error_trap_push ();
-  XSendEvent (DisplayOfScreen (screen),
-	      RootWindowOfScreen (screen),
+  XSendEvent (display,
+	      root,
               False,
 	      SubstructureRedirectMask | SubstructureNotifyMask,
 	      &xev);
@@ -1172,7 +1226,7 @@
   ch.res_name = NULL;
   ch.res_class = NULL;
 
-  XGetClassHint (gdk_display, xwindow,
+  XGetClassHint (_wnck_get_default_display (), xwindow,
                  &ch);
 
   _wnck_error_trap_pop ();
@@ -1254,11 +1308,11 @@
        * and not changing them again
        */
       XWindowAttributes attrs;
-      XGetWindowAttributes (gdk_display, xwindow, &attrs);
+      XGetWindowAttributes (_wnck_get_default_display (), xwindow, &attrs);
       mask |= attrs.your_event_mask;
     }
   
-  XSelectInput (gdk_display, xwindow, mask);
+  XSelectInput (_wnck_get_default_display (), xwindow, mask);
   _wnck_error_trap_pop ();
 }
   
@@ -1455,7 +1509,7 @@
   _wnck_error_trap_push ();
   type = None;
   data = NULL;
-  result = XGetWindowProperty (gdk_display,
+  result = XGetWindowProperty (_wnck_get_default_display (),
 			       xwindow,
 			       _wnck_atom_get ("_NET_WM_ICON"),
 			       0, G_MAXLONG,
@@ -1529,7 +1583,7 @@
   if (d)
     *d = 1;
   
-  XGetGeometry (gdk_display,
+  XGetGeometry (_wnck_get_default_display (),
                 pixmap, &root_ignored, &x_ignored, &y_ignored,
                 &width, &height, &border_width_ignored, &depth);
 
@@ -1775,7 +1829,7 @@
   
   _wnck_error_trap_push ();
   icons = NULL;
-  result = XGetWindowProperty (gdk_display, xwindow,
+  result = XGetWindowProperty (_wnck_get_default_display (), xwindow,
 			       _wnck_atom_get ("KWM_WIN_ICON"),
 			       0, G_MAXLONG,
 			       False,
@@ -2092,7 +2146,7 @@
       icon_cache->wm_hints_dirty = FALSE;
       
       _wnck_error_trap_push ();
-      hints = XGetWMHints (gdk_display, xwindow);
+      hints = XGetWMHints (_wnck_get_default_display (), xwindow);
       _wnck_error_trap_pop ();
       pixmap = None;
       mask = None;
@@ -2251,16 +2305,19 @@
                            int    *widthp,
                            int    *heightp)
 {
+  Display *display;
   int x, y;
   unsigned int width, height, bw, depth;
   Window root_window;
 
   width = 1;
   height = 1;
+
+  display = DisplayOfScreen (screen);
   
   _wnck_error_trap_push ();
 
-  XGetGeometry (gdk_display,
+  XGetGeometry (display,
                 xwindow,
                 &root_window,
                 &x, &y, &width, &height, &bw, &depth);
@@ -2283,12 +2340,17 @@
                                 int     width,
                                 int     height)
 {
-  XEvent xev;
+  Display *display;
+  Window   root;
+  XEvent   xev;
+
+  display = DisplayOfScreen (screen);
+  root = RootWindowOfScreen (screen);
 
   xev.xclient.type = ClientMessage;
   xev.xclient.serial = 0;
   xev.xclient.send_event = True;
-  xev.xclient.display = gdk_display;
+  xev.xclient.display = display;
   xev.xclient.window = xwindow;
   xev.xclient.message_type = _wnck_atom_get ("_NET_MOVERESIZE_WINDOW");
   xev.xclient.format = 32;
@@ -2299,8 +2361,8 @@
   xev.xclient.data.l[4] = height;
 
   _wnck_error_trap_push ();
-  XSendEvent (gdk_display,
-              RootWindowOfScreen (screen),
+  XSendEvent (display,
+              root,
               False,
               SubstructureRedirectMask | SubstructureNotifyMask,
               &xev);
@@ -2313,16 +2375,21 @@
                            int    *xp,
                            int    *yp)
 {
-  int x, y;
-  Window child;
+  Display *display;
+  Window   root;
+  int      x, y;
+  Window   child;
 
   x = 0;
   y = 0;
+
+  display = DisplayOfScreen (screen);
+  root = RootWindowOfScreen (screen);
   
   _wnck_error_trap_push ();
-  XTranslateCoordinates (gdk_display,
+  XTranslateCoordinates (display,
                          xwindow,
-			 RootWindowOfScreen (screen),
+			 root,
                          0, 0,
                          &x, &y, &child);
   _wnck_error_trap_pop ();
@@ -2349,7 +2416,7 @@
   
   _wnck_error_trap_push ();
 
-  XChangeProperty (gdk_display,
+  XChangeProperty (_wnck_get_default_display (),
 		   xwindow,
 		   _wnck_atom_get ("_NET_WM_ICON_GEOMETRY"),
 		   XA_CARDINAL, 32, PropModeReplace,
@@ -2373,7 +2440,9 @@
                           int     rows,
                           int     columns)
 {
-  gulong data[4];
+  Display *display;
+  Window   root;
+  gulong   data[4];
 
   /* FIXME: hack, hack, hack so as not
    * to have to add a orientation param
@@ -2383,6 +2452,9 @@
    */
   g_assert ((rows == 0) || (columns == 0));
 
+  display = DisplayOfScreen (xscreen);
+  root = RootWindowOfScreen (xscreen);
+
   data[0] = (columns == 0) ? _NET_WM_ORIENTATION_HORZ : _NET_WM_ORIENTATION_VERT;
   data[1] = columns;
   data[2] = rows;
@@ -2390,8 +2462,8 @@
   
   _wnck_error_trap_push ();
 
-  XChangeProperty (gdk_display,
-                   RootWindowOfScreen (xscreen),
+  XChangeProperty (display,
+                   root,
 		   _wnck_atom_get ("_NET_DESKTOP_LAYOUT"),
 		   XA_CARDINAL, 32, PropModeReplace,
 		   (guchar *)&data, 4);
@@ -2441,11 +2513,11 @@
   info.timestamp_prop_atom = _wnck_atom_get ("_TIMESTAMP_PROP");
   info.window = window;
 
-  XChangeProperty (gdk_display, window,
+  XChangeProperty (_wnck_get_default_display (), window,
 		   info.timestamp_prop_atom, info.timestamp_prop_atom,
 		   8, PropModeReplace, &c, 1);
 
-  XIfEvent (gdk_display, &xevent,
+  XIfEvent (_wnck_get_default_display (), &xevent,
 	    timestamp_predicate, (XPointer)&info);
 
   return xevent.xproperty.time;
@@ -2453,6 +2525,7 @@
 
 typedef struct
 {
+  Display *display;
   int screen_number;
   int token;
   Window window;
@@ -2467,7 +2540,7 @@
 _wnck_free_layout_manager (LayoutManager *lm)
 {
   _wnck_error_trap_push ();
-  XDestroyWindow (gdk_display, lm->window);
+  XDestroyWindow (lm->display, lm->window);
   _wnck_error_trap_pop ();
 
   g_slice_free (LayoutManager, lm);
@@ -2479,6 +2552,8 @@
 _wnck_try_desktop_layout_manager (Screen *xscreen,
                                   int     current_token)
 {
+  Display *display;
+  Window root;
   Atom selection_atom;
   Window owner;
   GSList *tmp;
@@ -2488,19 +2563,22 @@
   char buffer[256];
   LayoutManager *lm;
 
+  display = DisplayOfScreen (xscreen);
+  root = RootWindowOfScreen (xscreen);
   number = XScreenNumberOfScreen (xscreen);
   
   sprintf (buffer, "_NET_DESKTOP_LAYOUT_S%d", number);
   selection_atom = _wnck_atom_get (buffer);
 
-  owner = XGetSelectionOwner (gdk_display, selection_atom);
+  owner = XGetSelectionOwner (display, selection_atom);
   
   tmp = layout_managers;
   while (tmp != NULL)
     {
       lm = tmp->data;
 
-      if (number == lm->screen_number)
+      if (display == lm->display &&
+          number == lm->screen_number)
         {
           if (current_token == lm->token)
             {
@@ -2535,23 +2613,23 @@
 
   _wnck_error_trap_push ();
 
-  lm->window = XCreateSimpleWindow (gdk_display,
-                                    RootWindowOfScreen (xscreen),
+  lm->window = XCreateSimpleWindow (display,
+                                    root,
                                     0, 0, 10, 10, 0,
-                                    WhitePixel (gdk_display, number),
-                                    WhitePixel (gdk_display, number));
+                                    WhitePixel (display, number),
+                                    WhitePixel (display, number));
 
-  XSelectInput (gdk_display, lm->window, PropertyChangeMask);
+  XSelectInput (display, lm->window, PropertyChangeMask);
   timestamp = get_server_time (lm->window);
 
-  XSetSelectionOwner (gdk_display, lm->selection_atom,
+  XSetSelectionOwner (display, lm->selection_atom,
 		      lm->window, timestamp);
 
   _wnck_error_trap_pop ();
 
   /* Check to see if we managed to claim the selection. */
 
-  if (XGetSelectionOwner (gdk_display, lm->selection_atom) !=
+  if (XGetSelectionOwner (display, lm->selection_atom) !=
       lm->window)
     {
       g_free (lm);
@@ -2559,7 +2637,7 @@
     }
   
   xev.type = ClientMessage;
-  xev.window = RootWindow (gdk_display, number);
+  xev.window = root;
   xev.message_type = lm->manager_atom;
   xev.format = 32;
   xev.data.l[0] = timestamp;
@@ -2569,7 +2647,7 @@
   xev.data.l[4] = 0;	/* manager specific data */
   
   _wnck_error_trap_push ();
-  XSendEvent (gdk_display, RootWindow (gdk_display, number),
+  XSendEvent (display, root,
               False, StructureNotifyMask, (XEvent *)&xev);
   _wnck_error_trap_pop ();
 
@@ -2583,10 +2661,12 @@
 _wnck_release_desktop_layout_manager (Screen *xscreen,
                                       int     current_token)
 {
+  Display *display;
   GSList *tmp;
   int number;
   LayoutManager *lm;
   
+  display = DisplayOfScreen (xscreen);
   number = XScreenNumberOfScreen (xscreen);
   
   tmp = layout_managers;
@@ -2594,20 +2674,21 @@
     {
       lm = tmp->data;
 
-      if (number == lm->screen_number)
+      if (display == lm->display &&
+          number == lm->screen_number)
         {
           if (current_token == lm->token)
             {
               _wnck_error_trap_push ();
 
               /* release selection ownership */
-              if (XGetSelectionOwner (gdk_display, lm->selection_atom) !=
+              if (XGetSelectionOwner (display, lm->selection_atom) !=
                   lm->window)
                 {
                   Time timestamp;
 
                   timestamp = get_server_time (lm->window);
-                  XSetSelectionOwner (gdk_display, lm->selection_atom,
+                  XSetSelectionOwner (display, lm->selection_atom,
                                       None, timestamp);
                 }
 
@@ -2636,7 +2717,8 @@
     {
       lm = tmp->data;
 
-      if (xev->xany.window == lm->window &&
+      if (xev->xany.display == lm->display &&
+          xev->xany.window == lm->window &&
           xev->xselectionclear.selection == lm->selection_atom)
         {
           _wnck_free_layout_manager (lm);
From c4e2408bf81f476ee29f44e44d3adaaaf06afa06 Mon Sep 17 00:00:00 2001
From: Theppitak Karoonboonyanan <thep@linux.thai.net>
Date: Tue, 21 Sep 2010 07:54:11 +0000
Subject: [core] Initialize LayoutManager::display

Uninitialized value caused problem with multi-row pager.

https://bugzilla.gnome.org/show_bug.cgi?id=630229
---
diff --git a/libwnck/xutils.c b/libwnck/xutils.c
index 33caa9e..92b9201 100644
--- a/libwnck/xutils.c
+++ b/libwnck/xutils.c
@@ -2604,6 +2604,7 @@ _wnck_try_desktop_layout_manager (Screen *xscreen,
 
   lm = g_slice_new0 (LayoutManager);
 
+  lm->display = display;
   lm->screen_number = number;
   lm->token = next_token;
   ++next_token;
--
cgit v0.8.3.1

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: