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

Unified Diff: chrome/browser/tab_contents/web_contents_view_gtk.cc

Issue 42210: Linux: Change the cursor back to the default arrow when the render view loses... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 9 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/tab_contents/web_contents_view_gtk.cc
===================================================================
--- chrome/browser/tab_contents/web_contents_view_gtk.cc (revision 11697)
+++ chrome/browser/tab_contents/web_contents_view_gtk.cc (working copy)
@@ -36,6 +36,13 @@
return TRUE;
}
+// Whenever we lose focus, set the cursor back to that of our parent window,
+// which should be the default arrow.
+gboolean OnFocusOut(GtkWidget* widget, GdkEventFocus* event, void*) {
+ gdk_window_set_cursor(widget->window, NULL);
+ return FALSE;
+}
+
// Callback used in WebContentsViewGtk::CreateViewForWidget().
void RemoveWidget(GtkWidget* widget, void* container) {
gtk_container_remove(GTK_CONTAINER(container), widget);
@@ -74,6 +81,8 @@
gtk_widget_show(view->native_view());
g_signal_connect(view->native_view(), "focus",
G_CALLBACK(OnFocus), web_contents_);
+ g_signal_connect(view->native_view(), "focus-out-event",
+ G_CALLBACK(OnFocusOut), NULL);
gtk_container_foreach(GTK_CONTAINER(vbox_), RemoveWidget, vbox_);
gtk_box_pack_start(GTK_BOX(vbox_), view->native_view(), TRUE, TRUE, 0);
return view;
« 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