From d95b5308eafa1e70d50818c6835607af1a6a840e Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Thu, 23 Feb 2012 15:33:12 +0100 Subject: [PATCH] quartz: implement GdkScreen::get_monitor_workarea() --- gdk/quartz/gdkscreen-quartz.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/gdk/quartz/gdkscreen-quartz.c b/gdk/quartz/gdkscreen-quartz.c index 55f4ca08a1..28384419d9 100644 --- a/gdk/quartz/gdkscreen-quartz.c +++ b/gdk/quartz/gdkscreen-quartz.c @@ -415,6 +415,30 @@ gdk_quartz_screen_get_monitor_geometry (GdkScreen *screen, *dest = GDK_QUARTZ_SCREEN (screen)->screen_rects[monitor_num]; } +static void +gdk_quartz_screen_get_monitor_workarea (GdkScreen *screen, + gint monitor_num, + GdkRectangle *dest) +{ + GdkQuartzScreen *quartz_screen = GDK_QUARTZ_SCREEN (screen); + NSArray *array; + NSScreen *nsscreen; + NSRect rect; + + GDK_QUARTZ_ALLOC_POOL; + + array = [NSScreen screens]; + nsscreen = [array objectAtIndex:monitor_num]; + rect = [nsscreen 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; + + GDK_QUARTZ_RELEASE_POOL; +} + static gchar * gdk_quartz_screen_make_display_name (GdkScreen *screen) { @@ -461,7 +485,7 @@ gdk_quartz_screen_class_init (GdkQuartzScreenClass *klass) screen_class->get_monitor_height_mm = gdk_quartz_screen_get_monitor_height_mm; screen_class->get_monitor_plug_name = gdk_quartz_screen_get_monitor_plug_name; screen_class->get_monitor_geometry = gdk_quartz_screen_get_monitor_geometry; - screen_class->get_monitor_workarea = gdk_quartz_screen_get_monitor_geometry; + screen_class->get_monitor_workarea = gdk_quartz_screen_get_monitor_workarea; screen_class->is_composited = gdk_quartz_screen_is_composited; screen_class->make_display_name = gdk_quartz_screen_make_display_name; screen_class->get_active_window = gdk_quartz_screen_get_active_window;