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

Unified Diff: chrome/browser/gtk/browser_window_gtk.cc

Issue 151063: Fix a bug where we were getting a resize cursor near the top of the web (Closed)
Patch Set: Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/browser_window_gtk.cc
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc
index 2cc2d19645a80ac4b5e9b0aa21f4fc9b60f6591b..aeae1298b00d968423f475823f8288d0119aa651 100644
--- a/chrome/browser/gtk/browser_window_gtk.cc
+++ b/chrome/browser/gtk/browser_window_gtk.cc
@@ -706,6 +706,7 @@ void BrowserWindowGtk::ShowHTMLDialog(HtmlDialogUIDelegate* delegate,
}
void BrowserWindowGtk::UserChangedTheme() {
+ SetBackgroundColor();
gdk_window_invalidate_rect(GTK_WIDGET(window_)->window,
&GTK_WIDGET(window_)->allocation, TRUE);
}
@@ -1139,10 +1140,16 @@ gboolean BrowserWindowGtk::OnGtkAccelerator(GtkAccelGroup* accel_group,
// static
gboolean BrowserWindowGtk::OnMouseMoveEvent(GtkWidget* widget,
GdkEventMotion* event, BrowserWindowGtk* browser) {
+ // Get the mouse position relative to |widget|. We can't just use event->x
+ // and event->y because that's relative to the gdk window that got the
+ // event.
+ gint x = 0;
+ gint y = 0;
+ gtk_widget_get_pointer(widget, &x, &y);
+
// Update the cursor if we're on the custom frame border.
GdkWindowEdge edge;
- bool has_hit_edge = browser->GetWindowEdge(static_cast<int>(event->x),
- static_cast<int>(event->y), &edge);
+ bool has_hit_edge = browser->GetWindowEdge(x, y, &edge);
GdkCursorType new_cursor = GDK_LAST_CURSOR;
if (has_hit_edge)
new_cursor = GdkWindowEdgeToGdkCursorType(edge);
« 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