forked from AuroraMiddleware/gtk
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:
parent
bbcc3ee456
commit
a7ff95ce73
@ -1108,10 +1108,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 *
|
||||
|
Loading…
Reference in New Issue
Block a user