diff options
author | Michael Natterer <mitch@lanedo.com> | 2012-02-23 15:33:12 +0100 |
---|---|---|
committer | Michael Natterer <mitch@gimp.org> | 2012-02-23 15:34:46 +0100 |
commit | d95b5308eafa1e70d50818c6835607af1a6a840e (patch) | |
tree | 9118971eb4a141ada02c8129e83041ca871203e8 /gdk | |
parent | 334668a18370e294a485c3ecbb3d70ce109709c3 (diff) | |
download | gtk+-d95b5308eafa1e70d50818c6835607af1a6a840e.tar.gz |
quartz: implement GdkScreen::get_monitor_workarea()
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/quartz/gdkscreen-quartz.c | 26 |
1 files changed, 25 insertions, 1 deletions
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; |