| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/browser/renderer_host/render_widget_host_view_gtk.h" | 5 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 #include <gdk/gdk.h> | 8 #include <gdk/gdk.h> |
| 9 #include <cairo/cairo.h> | 9 #include <cairo/cairo.h> |
| 10 | 10 |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 gtk_widget_set_has_tooltip(view_, FALSE); | 280 gtk_widget_set_has_tooltip(view_, FALSE); |
| 281 } else { | 281 } else { |
| 282 gtk_widget_set_tooltip_text(view_, WideToUTF8(tooltip_text).c_str()); | 282 gtk_widget_set_tooltip_text(view_, WideToUTF8(tooltip_text).c_str()); |
| 283 } | 283 } |
| 284 } | 284 } |
| 285 | 285 |
| 286 BackingStore* RenderWidgetHostViewGtk::AllocBackingStore( | 286 BackingStore* RenderWidgetHostViewGtk::AllocBackingStore( |
| 287 const gfx::Size& size) { | 287 const gfx::Size& size) { |
| 288 Display* display = x11_util::GetXDisplay(); | 288 Display* display = x11_util::GetXDisplay(); |
| 289 void* visual = x11_util::GetVisualFromGtkWidget(view_); | 289 void* visual = x11_util::GetVisualFromGtkWidget(view_); |
| 290 XID parent_window = x11_util::GetX11WindowFromGtkWidget(view_); | 290 XID root_window = x11_util::GetX11RootWindow(); |
| 291 bool use_shared_memory = x11_util::QuerySharedMemorySupport(display); | 291 bool use_shared_memory = x11_util::QuerySharedMemorySupport(display); |
| 292 int depth = gtk_widget_get_visual(view_)->depth; | 292 int depth = gtk_widget_get_visual(view_)->depth; |
| 293 | 293 |
| 294 return new BackingStore(size, display, depth, visual, parent_window, | 294 return new BackingStore(size, display, depth, visual, root_window, |
| 295 use_shared_memory); | 295 use_shared_memory); |
| 296 } | 296 } |
| 297 | 297 |
| 298 void RenderWidgetHostViewGtk::Paint(const gfx::Rect& damage_rect) { | 298 void RenderWidgetHostViewGtk::Paint(const gfx::Rect& damage_rect) { |
| 299 BackingStore* backing_store = host_->GetBackingStore(); | 299 BackingStore* backing_store = host_->GetBackingStore(); |
| 300 | 300 |
| 301 if (backing_store) { | 301 if (backing_store) { |
| 302 // Only render the widget if it is attached to a window; there's a short | 302 // Only render the widget if it is attached to a window; there's a short |
| 303 // period where this object isn't attached to a window but hasn't been | 303 // period where this object isn't attached to a window but hasn't been |
| 304 // Destroy()ed yet and it receives paint messages... | 304 // Destroy()ed yet and it receives paint messages... |
| 305 GdkWindow* window = view_->window; | 305 GdkWindow* window = view_->window; |
| 306 if (window) | 306 if (window) { |
| 307 backing_store->ShowRect(damage_rect); | 307 backing_store->ShowRect( |
| 308 | 308 damage_rect, x11_util::GetX11WindowFromGtkWidget(view_)); |
| 309 } |
| 309 } else { | 310 } else { |
| 310 NOTIMPLEMENTED(); | 311 NOTIMPLEMENTED(); |
| 311 } | 312 } |
| 312 } | 313 } |
| 313 | 314 |
| OLD | NEW |