diff options
author | Dan Winship <danw@gnome.org> | 2011-08-05 12:42:33 -0400 |
---|---|---|
committer | Eitan Isaacson <eitan@monotonous.org> | 2011-08-12 09:19:41 +0200 |
commit | 2e42f22a485e2b17a63b9f9946d025cc707ade86 (patch) | |
tree | a7e91bf0e6596af64cf5310ec6b2d5420d51e234 /modules | |
parent | 1e6448d0c33462cf668563922cd22ab6f3e826eb (diff) | |
download | caribou-2e42f22a485e2b17a63b9f9946d025cc707ade86.tar.gz |
Fix widget type check
Check that the widget is either a Gtk.Editable (eg, a Gtk.Entry) or a
Gtk.TextView, and check that it's not read-only as well.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gtk3/caribou-gtk-module.vala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/gtk3/caribou-gtk-module.vala b/modules/gtk3/caribou-gtk-module.vala index bbbac05..12429fb 100644 --- a/modules/gtk3/caribou-gtk-module.vala +++ b/modules/gtk3/caribou-gtk-module.vala @@ -67,7 +67,10 @@ namespace Caribou { uint32 timestamp = Gdk.X11Display.get_user_time (display); #endif - if (widget != null && (widget is Gtk.Entry || widget is Gtk.TextView) && widget is Gtk.Editable) { + if ((widget is Gtk.Editable && + ((Gtk.Editable) widget).get_editable ()) || + (widget is Gtk.TextView && + ((Gtk.TextView) widget).get_editable ())) { Gdk.Window current_window = widget.get_window (); int x = 0, y = 0, w = 0, h = 0; if (current_window != null) |