From 5a55f6ff7b981760272861b1d67b5a7dfb2bd7ad Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 2 Aug 2020 21:27:03 -0400 Subject: [PATCH] gdk: Fix gdk_surface_get_layout_monitor We are determining the monitor by maximizing the intersection; that only works if our rectangle is not empty. Fixes: #3003 --- gdk/gdksurface.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c index 63abe2595b..6d8b84ee34 100644 --- a/gdk/gdksurface.c +++ b/gdk/gdksurface.c @@ -265,6 +265,9 @@ gdk_surface_get_layout_monitor (GdkSurface *surface, &root_rect.x, &root_rect.y); + root_rect.width = MAX (1, root_rect.width); + root_rect.height = MAX (1, root_rect.height); + display = get_display_for_surface (surface, surface->transient_for); return get_monitor_for_rect (display, &root_rect, get_bounds); }