Skip to content

gdksurface-win32.c: Fix up popup placement (fix issue #3793)

Chun-wei Fan requested to merge fix-3793 into master

Hi,

From the commit message, in order to fix placement of popup surfaces:

If we are undergoing a surface move, just apply the next_layout anyways, even if we are not moving a toplevel surface.

Update the way how we obtain the x and y coordinates of a surface, if it is a toplevel, apply the x and y coordinates from the results from we obtained the underlying Win32 HWND, as we did before. But if it is a popup, use gdk_win32_surface_get_geometry() to obtain the correct x and y coordinates to place our popup surface.

Also correct how we compute the shadow dimensions, and the final popup rectangle as we attempt to layout the popup surface, since GDK-Win32 keeps track of the shadow dimensions in system (unscaled) units, not GDK units.

Also fix the formatting of popup-related function declarations in gdksurface-win32.c.

This will apply for both the gtk-4-2 branch as well as the master branch.

With blessings, thank you!

Edited by Chun-wei Fan

Merge request reports