summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-15 23:23:25 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-15 23:23:25 +0000
commit43fb6e79242354cdf09d66024ae826eaebb4585c (patch)
tree1ff7a48c9a8c73c105d3faa06e0776c75eadb9b6
parentd5ed857acf364cee975b5b9db42dc4dc96f5cd15 (diff)
downloadchromium_src-43fb6e79242354cdf09d66024ae826eaebb4585c.zip
chromium_src-43fb6e79242354cdf09d66024ae826eaebb4585c.tar.gz
chromium_src-43fb6e79242354cdf09d66024ae826eaebb4585c.tar.bz2
Linux: Change the cursor back to the default arrow when the render view loses focus.
BUG=8726 Review URL: http://codereview.chromium.org/42210 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11716 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/tab_contents/web_contents_view_gtk.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/tab_contents/web_contents_view_gtk.cc b/chrome/browser/tab_contents/web_contents_view_gtk.cc
index 72b47ab..e550174 100644
--- a/chrome/browser/tab_contents/web_contents_view_gtk.cc
+++ b/chrome/browser/tab_contents/web_contents_view_gtk.cc
@@ -36,6 +36,13 @@ gboolean OnFocus(GtkWidget* widget, GtkDirectionType focus,
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 @@ RenderWidgetHostView* WebContentsViewGtk::CreateViewForWidget(
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;