[gtk+] quartz: implement GdkScreen::get_monitor_workarea()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] quartz: implement GdkScreen::get_monitor_workarea()
- Date: Thu, 23 Feb 2012 14:35:02 +0000 (UTC)
commit d95b5308eafa1e70d50818c6835607af1a6a840e
Author: Michael Natterer <mitch lanedo com>
Date: Thu Feb 23 15:33:12 2012 +0100
quartz: implement GdkScreen::get_monitor_workarea()
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 55f4ca0..2838441 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]