quartz: do not cache the screen in the gdkmonitor
Instead we just cache the monitor number and get out of it the nsscreen when it is needed. This is a requirement since it nsscreen it is not supposed to be cached. Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/1312
This commit is contained in:
@ -35,12 +35,19 @@ gdk_quartz_monitor_get_workarea (GdkMonitor *monitor,
|
||||
|
||||
GDK_QUARTZ_ALLOC_POOL;
|
||||
|
||||
NSRect rect = [quartz_monitor->nsscreen visibleFrame];
|
||||
NSArray *array = [NSScreen screens];
|
||||
if (quartz_monitor->monitor_num < [array count])
|
||||
{
|
||||
NSScreen *screen = [array objectAtIndex:quartz_monitor->monitor_num];
|
||||
NSRect rect = [screen visibleFrame];
|
||||
|
||||
dest->x = rect.origin.x - quartz_screen->min_x;
|
||||
dest->y = quartz_screen->height - (rect.origin.y + rect.size.height) + quartz_screen->min_y;
|
||||
dest->width = rect.size.width;
|
||||
dest->height = rect.size.height;
|
||||
dest->x = rect.origin.x - quartz_screen->min_x;
|
||||
dest->y = quartz_screen->height - (rect.origin.y + rect.size.height) + quartz_screen->min_y;
|
||||
dest->width = rect.size.width;
|
||||
dest->height = rect.size.height;
|
||||
}
|
||||
else
|
||||
*dest = monitor->geometry;
|
||||
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user