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