summaryrefslogtreecommitdiffstats
path: root/views/screen_gtk.cc
diff options
context:
space:
mode:
Diffstat (limited to 'views/screen_gtk.cc')
-rw-r--r--views/screen_gtk.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/views/screen_gtk.cc b/views/screen_gtk.cc
index efb8775..22aaa44 100644
--- a/views/screen_gtk.cc
+++ b/views/screen_gtk.cc
@@ -6,6 +6,8 @@
#include <gtk/gtk.h>
+#include "base/logging.h"
+
namespace views {
// static
@@ -15,5 +17,20 @@ gfx::Point Screen::GetCursorScreenPoint() {
return gfx::Point(x, y);
}
+// static
+gfx::Rect Screen::GetMonitorWorkAreaNearestWindow(gfx::NativeWindow window) {
+ // TODO(beng): use |window|.
+ guchar* raw_data = NULL;
+ gint data_len = 0;
+ gboolean success = gdk_property_get(gdk_get_default_root_window(),
+ gdk_atom_intern("_NET_WORKAREA", FALSE),
+ gdk_atom_intern("CARDINAL", FALSE),
+ 0, 0xFF, false, NULL, NULL, &data_len,
+ &raw_data);
+ DCHECK(success);
+ glong* data = reinterpret_cast<glong*>(raw_data);
+ return gfx::Rect(data[0], data[1], data[0] + data[2], data[1] + data[3]);
+}
+
} // namespace