OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_view_gtk.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_gtk.h" |
6 | 6 |
7 #include <cairo/cairo.h> | 7 #include <cairo/cairo.h> |
8 #include <gdk/gdk.h> | 8 #include <gdk/gdk.h> |
9 #include <gdk/gdkkeysyms.h> | 9 #include <gdk/gdkkeysyms.h> |
10 #include <gdk/gdkx.h> | 10 #include <gdk/gdkx.h> |
(...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1287 GtkNativeViewManager* manager = GtkNativeViewManager::GetInstance(); | 1287 GtkNativeViewManager* manager = GtkNativeViewManager::GetInstance(); |
1288 gfx::NativeViewId view_id = GetNativeViewId(); | 1288 gfx::NativeViewId view_id = GetNativeViewId(); |
1289 | 1289 |
1290 if (!manager->GetPermanentXIDForId(&compositing_surface_, view_id)) { | 1290 if (!manager->GetPermanentXIDForId(&compositing_surface_, view_id)) { |
1291 DLOG(ERROR) << "Can't find XID for view id " << view_id; | 1291 DLOG(ERROR) << "Can't find XID for view id " << view_id; |
1292 } | 1292 } |
1293 } | 1293 } |
1294 return gfx::GLSurfaceHandle(compositing_surface_, gfx::NATIVE_TRANSPORT); | 1294 return gfx::GLSurfaceHandle(compositing_surface_, gfx::NATIVE_TRANSPORT); |
1295 } | 1295 } |
1296 | 1296 |
| 1297 void RenderWidgetHostViewGtk::ResizeCompositingSurface(const gfx::Size& size) { |
| 1298 GtkWidget* widget = view_.get(); |
| 1299 GdkWindow* window = gtk_widget_get_window(widget); |
| 1300 if (window) { |
| 1301 Display* display = GDK_WINDOW_XDISPLAY(window); |
| 1302 gdk_window_resize(window, size.width(), size.height()); |
| 1303 XSync(display, False); |
| 1304 } |
| 1305 } |
| 1306 |
1297 bool RenderWidgetHostViewGtk::LockMouse() { | 1307 bool RenderWidgetHostViewGtk::LockMouse() { |
1298 if (mouse_locked_) | 1308 if (mouse_locked_) |
1299 return true; | 1309 return true; |
1300 | 1310 |
1301 mouse_locked_ = true; | 1311 mouse_locked_ = true; |
1302 | 1312 |
1303 // Release any current grab. | 1313 // Release any current grab. |
1304 GtkWidget* current_grab_window = gtk_grab_get_current(); | 1314 GtkWidget* current_grab_window = gtk_grab_get_current(); |
1305 if (current_grab_window) { | 1315 if (current_grab_window) { |
1306 gtk_grab_remove(current_grab_window); | 1316 gtk_grab_remove(current_grab_window); |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1575 gfx::PluginWindowHandle id) { | 1585 gfx::PluginWindowHandle id) { |
1576 plugin_container_manager_.CreatePluginContainer(id); | 1586 plugin_container_manager_.CreatePluginContainer(id); |
1577 } | 1587 } |
1578 | 1588 |
1579 void RenderWidgetHostViewGtk::OnDestroyPluginContainer( | 1589 void RenderWidgetHostViewGtk::OnDestroyPluginContainer( |
1580 gfx::PluginWindowHandle id) { | 1590 gfx::PluginWindowHandle id) { |
1581 plugin_container_manager_.DestroyPluginContainer(id); | 1591 plugin_container_manager_.DestroyPluginContainer(id); |
1582 } | 1592 } |
1583 | 1593 |
1584 } // namespace content | 1594 } // namespace content |
OLD | NEW |