GDK W32: Fix idiotic gdk_win32_display_get_monitor() implementation

Replace the code borrowed from the X11 backend with the code borrowed from Wayland backend. Now GTK doesn't crash when the number of monitors is zero.
This commit is contained in:
Руслан Ижбулатов 2017-01-20 09:08:41 +00:00
parent c36d66bdb6
commit f7ae36739a

View File

@ -1095,10 +1095,10 @@ gdk_win32_display_get_monitor (GdkDisplay *display,
{
GdkWin32Display *win32_display = GDK_WIN32_DISPLAY (display);
if (0 <= monitor_num || monitor_num < win32_display->monitors->len)
return (GdkMonitor *) g_ptr_array_index (win32_display->monitors, monitor_num);
if (monitor_num < 0 || monitor_num >= win32_display->monitors->len)
return NULL;
return NULL;
return (GdkMonitor *) g_ptr_array_index (win32_display->monitors, monitor_num);
}
static GdkMonitor *