From a931b089754c0fc3e43705e9ac2137803274dced Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Mon, 14 Jan 2019 20:58:51 +0100 Subject: screen: avoid 'NULL' in 'meta_error_trap...' functions Fixes https://github.com/mate-desktop/marco/issues/445 --- src/core/screen.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/screen.c b/src/core/screen.c index 5bc5d2e2..4b74ed72 100644 --- a/src/core/screen.c +++ b/src/core/screen.c @@ -1221,21 +1221,23 @@ get_window_pixbuf (MetaWindow *window, int *width, int *height) { + MetaDisplay *display; cairo_surface_t *surface; GdkPixbuf *pixbuf, *scaled; double ratio; + display = window->display; surface = meta_compositor_get_window_surface (window->display->compositor, window); if (surface == None) return NULL; - meta_error_trap_push (NULL); + meta_error_trap_push (display); pixbuf = meta_ui_get_pixbuf_from_surface (surface); cairo_surface_destroy (surface); - if (meta_error_trap_pop_with_return (NULL, FALSE) != Success) + if (meta_error_trap_pop_with_return (display, FALSE) != Success) g_clear_object (&pixbuf); if (pixbuf == NULL) -- cgit v1.2.1