diff options
author | Nohemi Fernandez <nf68@cornell.edu> | 2011-08-04 13:20:48 -0500 |
---|---|---|
committer | Eitan Isaacson <eitan@monotonous.org> | 2011-08-12 09:19:40 +0200 |
commit | 20a031bf4ebac39d7efa5dd23b5cda0ec2fb8fa9 (patch) | |
tree | 6fe4c157c26e74836a44b8aa947e993cdc7f7e67 | |
parent | ad3bcc39c5c17b5e186a0659975e3705af201943 (diff) | |
download | caribou-20a031bf4ebac39d7efa5dd23b5cda0ec2fb8fa9.tar.gz |
Rename get_top_level_focus
-rw-r--r-- | modules/gtk3/caribou-gtk-module.vala | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/modules/gtk3/caribou-gtk-module.vala b/modules/gtk3/caribou-gtk-module.vala index 6a7f553..c662878 100644 --- a/modules/gtk3/caribou-gtk-module.vala +++ b/modules/gtk3/caribou-gtk-module.vala @@ -38,19 +38,18 @@ namespace Caribou { toplevels = Gtk.Window.list_toplevels(); foreach (Gtk.Window window in toplevels) { if (windows.find(window) == null) { - window.notify["has-toplevel-focus"].connect(get_top_level_focus); + window.notify["has-toplevel-focus"].connect(has_top_level_focus_changed); windows.append(window); } } } - private void get_top_level_focus (Object obj, ParamSpec prop) { + private void has_top_level_focus_changed (Object obj, ParamSpec prop) { Gtk.Window window = (Gtk.Window) obj; - if (window.has_toplevel_focus) - focus_tracker (window, window.get_focus()); - } + if (!window.has_toplevel_focus) + return; - private void focus_tracker (Gtk.Window window, Gtk.Widget? widget) { + Gtk.Widget? widget = window.get_focus(); uint32 timestamp = Gtk.get_current_event_time(); if (widget != null && (widget is Gtk.Entry || widget is Gtk.TextView) && widget is Gtk.Editable) { Atk.Object focus_object = widget.get_accessible(); |