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

Unified Diff: content/browser/renderer_host/render_widget_host_view_gtk.cc

Issue 10454013: GTK Render Widget Host View resets cached center location on mouse lock. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_gtk.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_gtk.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_gtk.cc b/content/browser/renderer_host/render_widget_host_view_gtk.cc
index 852ed79dee4d9231c733d43fa1a0b0c096e92d3a..7c26122138a7d554d717a6712574ac2e4cce3586 100644
--- a/content/browser/renderer_host/render_widget_host_view_gtk.cc
+++ b/content/browser/renderer_host/render_widget_host_view_gtk.cc
@@ -207,8 +207,7 @@ class RenderWidgetHostViewGtkWidget {
static gboolean OnConfigureEvent(GtkWidget* widget,
GdkEventConfigure* event,
RenderWidgetHostViewGtk* host_view) {
- host_view->widget_center_valid_ = false;
- host_view->mouse_has_been_warped_to_new_center_ = false;
+ host_view->MarkCachedWidgetCenterStale();
return FALSE;
}
@@ -1288,6 +1287,11 @@ bool RenderWidgetHostViewGtk::LockMouse() {
// Clear the tooltip window.
SetTooltipText(string16());
+ // Ensure that the widget center location will be relevant for this mouse
+ // lock session. It is updated whenever the window geometry moves
+ // but may be out of date due to switching tabs.
+ MarkCachedWidgetCenterStale();
+
return true;
}
@@ -1365,6 +1369,11 @@ void RenderWidgetHostViewGtk::set_last_mouse_down(GdkEventButton* event) {
last_mouse_down_ = temp;
}
+void RenderWidgetHostViewGtk::MarkCachedWidgetCenterStale() {
+ widget_center_valid_ = false;
+ mouse_has_been_warped_to_new_center_ = false;
+}
+
gfx::Point RenderWidgetHostViewGtk::GetWidgetCenter() {
if (widget_center_valid_)
return widget_center_;
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_gtk.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698