From 92261b50225d3fb7a56648e275b881992e171d60 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Mon, 28 Feb 2022 11:50:21 -0800 Subject: [PATCH] macos: add GDK_NOTE for surface sizing and placement This can be useful to debug sizing issues with the surface as well as the "window manager" placement code. --- gdk/macos/gdkmacostoplevelsurface.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/gdk/macos/gdkmacostoplevelsurface.c b/gdk/macos/gdkmacostoplevelsurface.c index c84ebb704b..d89434593b 100644 --- a/gdk/macos/gdkmacostoplevelsurface.c +++ b/gdk/macos/gdkmacostoplevelsurface.c @@ -174,6 +174,14 @@ _gdk_macos_toplevel_surface_present (GdkToplevel *toplevel, _gdk_macos_surface_set_geometry_hints (GDK_MACOS_SURFACE (self), &geometry, mask); gdk_surface_constrain_size (&geometry, mask, width, height, &width, &height); + + GDK_NOTE (MISC, + g_message ("Resizing \"%s\" to %dx%d", + GDK_MACOS_SURFACE (self)->title ? + GDK_MACOS_SURFACE (self)->title : + "untitled", + width, height)); + _gdk_macos_surface_resize (GDK_MACOS_SURFACE (self), width, height); /* Maximized state */ @@ -202,6 +210,13 @@ _gdk_macos_toplevel_surface_present (GdkToplevel *toplevel, GDK_MACOS_SURFACE (self), &x, &y); + GDK_NOTE (MISC, + g_message ("Placing new toplevel \"%s\" at %d,%d", + GDK_MACOS_SURFACE (self)->title ? + GDK_MACOS_SURFACE (self)->title : + "untitled", + x, y)); + _gdk_macos_surface_move (GDK_MACOS_SURFACE (self), x, y); }