|
| 1 | +From ae49ae3f657dc0086eca8873213cf9dcee953ab8 Mon Sep 17 00:00:00 2001 |
| 2 | +From: John Ralls <jralls@ceridwen.us> |
| 3 | +Date: Thu, 12 Jun 2025 16:06:02 -0700 |
| 4 | +Subject: [PATCH] [Quartz] Set the view's frame in a move for temp windows. |
| 5 | + |
| 6 | +Temp windows (context menus mostly) are created at 0,0 then moved to the |
| 7 | +pointer location. When the move is from a Retina to a non-Retina monitor |
| 8 | +the view needs to be redrawn at the new scale, but macOS doesn't recognize |
| 9 | +that and the menu ends up truncated. Setting the frame on the view forces |
| 10 | +the redraw. |
| 11 | + |
| 12 | +Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/7598 |
| 13 | +--- |
| 14 | + gdk/quartz/gdkwindow-quartz.c | 4 ++++ |
| 15 | + 1 file changed, 4 insertions(+) |
| 16 | + |
| 17 | +diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c |
| 18 | +index 9a6aea9c6f..08e47dd089 100644 |
| 19 | +--- a/gdk/quartz/gdkwindow-quartz.c |
| 20 | ++++ b/gdk/quartz/gdkwindow-quartz.c |
| 21 | +@@ -1393,6 +1393,10 @@ move_resize_window_internal (GdkWindow *window, |
| 22 | + |
| 23 | + frame_rect = [impl->toplevel frameRectForContentRect:content_rect]; |
| 24 | + [impl->toplevel setFrame:frame_rect display:YES]; |
| 25 | ++ |
| 26 | ++ if (window->window_type == GDK_WINDOW_TEMP) |
| 27 | ++ [impl->view setFrame:content_rect]; |
| 28 | ++ |
| 29 | + impl->cairo_surface = gdk_quartz_ref_cairo_surface (window); |
| 30 | + cairo_surface_destroy (impl->cairo_surface); // Remove the extra reference |
| 31 | + } |
| 32 | +-- |
| 33 | +2.39.5 (Apple Git-154) |
| 34 | + |
0 commit comments