From da2d4da15a19887c1dd031314d61b1dc2b04ea6d Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 14 Apr 2014 23:11:28 -0400 Subject: Added click-to-focus to GTK+ Areas and documented that click-to-focus happens; also TODOs related to that. --- area_unix.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'area_unix.go') diff --git a/area_unix.go b/area_unix.go index 71a9edb..cfa5741 100644 --- a/area_unix.go +++ b/area_unix.go @@ -141,6 +141,8 @@ func finishMouseEvent(widget *C.GtkWidget, data C.gpointer, me MouseEvent, mb ui //export our_area_button_press_event_callback func our_area_button_press_event_callback(widget *C.GtkWidget, event *C.GdkEvent, data C.gpointer) C.gboolean { + // clicking doesn't automatically transfer keyboard focus; we must do so manually (thanks tristan in irc.gimp.net/#gtk+) + C.gtk_widget_grab_focus(widget) e := (*C.GdkEventButton)(unsafe.Pointer(event)) me := MouseEvent{ // GDK button ID == our button ID -- cgit v1.2.3