From e4c1352520fa7b3c05ba6f6c59f6203fb63de6fe Mon Sep 17 00:00:00 2001 From: rcaridade145 Date: Fri, 15 Oct 2021 21:28:44 +0100 Subject: Safeguard against calling gdk_x11_window_get_xid with a NULL GdkWindow --- src/core/display.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/display.c b/src/core/display.c index 3b52c8b4..7a6cf12e 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -1615,8 +1615,11 @@ mouse_event_is_in_tab_popup (MetaDisplay *display, GtkWidget *popup_widget = meta_ui_tab_popup_get_widget (screen->tab_popup); if (ok1 && popup_widget != NULL) { - Window popup_xid = gdk_x11_window_get_xid (gtk_widget_get_window (popup_widget)); - + GdkWindow * window = gtk_widget_get_window (popup_widget); + if (window == NULL) + return FALSE; + + Window popup_xid = gdk_x11_window_get_xid (window); gboolean ok2 = XTranslateCoordinates (display->xdisplay, event_window, popup_xid, event_x, event_y, -- cgit v1.2.1