summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--applets/wncklet/window-list.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/applets/wncklet/window-list.c b/applets/wncklet/window-list.c
index 4851a823..8ec3f396 100644
--- a/applets/wncklet/window-list.c
+++ b/applets/wncklet/window-list.c
@@ -252,15 +252,18 @@ preview_window_thumbnail (WnckWindow *wnck_window,
int *thumbnail_scale)
{
GdkWindow *window;
+ Window win;
cairo_surface_t *thumbnail;
cairo_t *cr;
double ratio;
int width, height, scale;
- window = gdk_x11_window_foreign_new_for_display (gdk_display_get_default (), wnck_window_get_xid (wnck_window));
-
- if (window == NULL)
- return NULL;
+ win = wnck_window_get_xid (wnck_window);
+ if ((window = gdk_x11_window_lookup_for_display (gdk_display_get_default (), win)) == NULL)
+ {
+ if ((window = gdk_x11_window_foreign_new_for_display (gdk_display_get_default (), win)) == NULL)
+ return NULL;
+ }
*thumbnail_scale = scale = gdk_window_get_scale_factor (window);
width = gdk_window_get_width (window) * scale;