mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 21:51:08 +00:00
Merge branch 'center-dialogs' into 'main'
win32: Center newly created transient windows Closes #5407 See merge request GNOME/gtk!6050
This commit is contained in:
commit
51265e2367
@ -725,11 +725,7 @@ show_window_internal (GdkSurface *window,
|
||||
|
||||
if (center)
|
||||
{
|
||||
window_rect.left = 0;
|
||||
window_rect.top = 0;
|
||||
window_rect.right = window->width * surface->surface_scale;
|
||||
window_rect.bottom = window->height * surface->surface_scale;
|
||||
_gdk_win32_adjust_client_rect (window, &window_rect);
|
||||
GetWindowRect (GDK_SURFACE_HWND (window), &window_rect);
|
||||
|
||||
x = center_on_rect.left + ((center_on_rect.right - center_on_rect.left) - (window_rect.right - window_rect.left)) / 2;
|
||||
y = center_on_rect.top + ((center_on_rect.bottom - center_on_rect.top) - (window_rect.bottom - window_rect.top)) / 2;
|
||||
|
Loading…
Reference in New Issue
Block a user