Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: content/browser/renderer_host/render_widget_host_gtk.cc

Issue 7241003: Fix a bug where window.screen would return 0, 0 as the width and height (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/render_widget_host.h" 5 #include "content/browser/renderer_host/render_widget_host.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 "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 10 matching lines...) Expand all
21 // http://crbug.com/9060 for more details. 21 // http://crbug.com/9060 for more details.
22 void RenderWidgetHost::OnMsgGetScreenInfo(gfx::NativeViewId view, 22 void RenderWidgetHost::OnMsgGetScreenInfo(gfx::NativeViewId view,
23 WebScreenInfo* results) { 23 WebScreenInfo* results) {
24 GtkWidget* widget = NULL; 24 GtkWidget* widget = NULL;
25 GdkWindow* gdk_window = NULL; 25 GdkWindow* gdk_window = NULL;
26 if (GtkNativeViewManager::GetInstance()->GetNativeViewForId( 26 if (GtkNativeViewManager::GetInstance()->GetNativeViewForId(
27 &widget, view) && widget) { 27 &widget, view) && widget) {
28 gdk_window = widget->window; 28 gdk_window = widget->window;
29 } else { 29 } else {
30 GdkDisplay* display = gdk_display_get_default(); 30 GdkDisplay* display = gdk_display_get_default();
31 gdk_window = gdk_display_get_window_at_pointer(display, NULL, NULL); 31 gdk_window = gdk_display_get_default_group(display);
32 } 32 }
33 if (!gdk_window) 33 if (!gdk_window)
34 return; 34 return;
35 GdkScreen* screen = gdk_drawable_get_screen(gdk_window); 35 GdkScreen* screen = gdk_drawable_get_screen(gdk_window);
36 *results = WebScreenInfoFactory::screenInfo( 36 *results = WebScreenInfoFactory::screenInfo(
37 gdk_x11_drawable_get_xdisplay(gdk_window), 37 gdk_x11_drawable_get_xdisplay(gdk_window),
38 gdk_x11_screen_get_screen_number(screen)); 38 gdk_x11_screen_get_screen_number(screen));
39 39
40 // TODO(tony): We should move this code into WebScreenInfoFactory. 40 // TODO(tony): We should move this code into WebScreenInfoFactory.
41 int monitor_number = gdk_screen_get_monitor_at_window(screen, gdk_window); 41 int monitor_number = gdk_screen_get_monitor_at_window(screen, gdk_window);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 for (int i = 0; 110 for (int i = 0;
111 i < static_cast<int>(deferred_plugin_handles_.size()); 111 i < static_cast<int>(deferred_plugin_handles_.size());
112 i++) { 112 i++) {
113 if (deferred_plugin_handles_[i] == id) { 113 if (deferred_plugin_handles_[i] == id) {
114 deferred_plugin_handles_.erase(deferred_plugin_handles_.begin() + i); 114 deferred_plugin_handles_.erase(deferred_plugin_handles_.begin() + i);
115 i--; 115 i--;
116 } 116 }
117 } 117 }
118 } 118 }
119 } 119 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698