GDK W32: Fix shown window position calculation for dialogs and splashes

Two errors here:
1) A typo in splashscreen rectangle calculation - sets right twice
   instead of setting top
2) Centering for dialogs is off because it doesn't convert
   GDK virtual desktop coordinates to Windows WM virtual desktop
   coordinates by adding _gdk_offset_*

https://bugzilla.gnome.org/show_bug.cgi?id=763628
This commit is contained in:
Руслан Ижбулатов 2016-03-14 16:14:22 +00:00
parent bbced9a0cf
commit 5ac848d229

View File

@ -1207,7 +1207,7 @@ show_window_internal (GdkWindow *window,
else
{
center_on_rect.left = 0;
center_on_rect.right = 0;
center_on_rect.top = 0;
center_on_rect.right = GetSystemMetrics (SM_CXSCREEN);
center_on_rect.bottom = GetSystemMetrics (SM_CYSCREEN);
}
@ -1218,8 +1218,8 @@ show_window_internal (GdkWindow *window,
{
GdkWindow *owner = window_impl->transient_owner;
/* Center on transient parent */
center_on_rect.left = owner->x;
center_on_rect.top = owner->y;
center_on_rect.left = owner->x - _gdk_offset_x;
center_on_rect.top = owner->y - _gdk_offset_y;
center_on_rect.right = center_on_rect.left + owner->width;
center_on_rect.bottom = center_on_rect.top + owner->height;
_gdk_win32_adjust_client_rect (GDK_WINDOW (owner), &center_on_rect);