diff options
| author | Victor Kareh <[email protected]> | 2026-05-21 09:10:25 -0400 |
|---|---|---|
| committer | Victor Kareh <[email protected]> | 2026-05-21 09:10:25 -0400 |
| commit | dc188e76fa82c1df6f1caa24b3c953c5e577e50b (patch) | |
| tree | faa35da19fb70f7d9b8c4b052070791184035647 | |
| parent | 7384b9fdda2a3c61cda7ee95ba491316869d0a30 (diff) | |
| download | mate-panel-window-list-preview-decorations.tar.bz2 mate-panel-window-list-preview-decorations.tar.xz | |
window-list: always capture fresh pixels for preview thumbnailswindow-list-preview-decorations
Use gdk_pixbuf_get_from_window instead of gdk_cairo_set_source_window to
avoid stale window content in preview thumbnails.
| -rw-r--r-- | applets/wncklet/window-list.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/applets/wncklet/window-list.c b/applets/wncklet/window-list.c index cad33b17..9bf05dee 100644 --- a/applets/wncklet/window-list.c +++ b/applets/wncklet/window-list.c @@ -343,21 +343,26 @@ preview_window_thumbnail (WnckWindow *wnck_window, gdk_x11_display_error_trap_push (gdk_window_get_display (window)); + GdkPixbuf *pixbuf = gdk_pixbuf_get_from_window (window, + src_x / scale, src_y / scale, + width / scale, height / scale); + + if (gdk_x11_display_error_trap_pop (gdk_window_get_display (window)) || pixbuf == NULL) + { + g_object_unref (window); + return NULL; + } + thumbnail = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, *thumbnail_width, *thumbnail_height); cairo_surface_set_device_scale (thumbnail, scale, scale); cr = cairo_create (thumbnail); cairo_scale (cr, ratio, ratio); - gdk_cairo_set_source_window (cr, window, -src_x / scale, -src_y / scale); + gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); cairo_paint (cr); cairo_destroy (cr); - - if (gdk_x11_display_error_trap_pop (gdk_window_get_display (window))) - { - cairo_surface_destroy (thumbnail); - thumbnail = NULL; - } + g_object_unref (pixbuf); g_object_unref (window); |
