OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/browser/renderer_host/gtk_window_utils.h" |
| 6 |
| 7 #include <gdk/gdkx.h> |
| 8 #include <gtk/gtk.h> |
| 9 |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" |
| 11 #include "third_party/WebKit/Source/WebKit/chromium/public/x11/WebScreenInfoFact
ory.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 void GetScreenInfoFromNativeWindow( |
| 16 GdkWindow* gdk_window, WebKit::WebScreenInfo* results) { |
| 17 GdkScreen* screen = gdk_drawable_get_screen(gdk_window); |
| 18 *results = WebKit::WebScreenInfoFactory::screenInfo( |
| 19 gdk_x11_drawable_get_xdisplay(gdk_window), |
| 20 gdk_x11_screen_get_screen_number(screen)); |
| 21 |
| 22 // TODO(tony): We should move this code into WebScreenInfoFactory. |
| 23 int monitor_number = gdk_screen_get_monitor_at_window(screen, gdk_window); |
| 24 GdkRectangle monitor_rect; |
| 25 gdk_screen_get_monitor_geometry(screen, monitor_number, &monitor_rect); |
| 26 results->rect = WebKit::WebRect(monitor_rect.x, monitor_rect.y, |
| 27 monitor_rect.width, monitor_rect.height); |
| 28 // TODO(tony): Should we query _NET_WORKAREA to get the workarea? |
| 29 results->availableRect = results->rect; |
| 30 } |
| 31 |
| 32 } // namespace content |
OLD | NEW |