FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

return value of KeyRelease callback is ignored?

 
Post new topic   Reply to topic     Forum Index -> gtkD
View previous topic :: View next topic  
Author Message
Dubhead



Joined: 08 Sep 2008
Posts: 4
Location: Tokyo, Japan

PostPosted: Mon Sep 08, 2008 3:22 am    Post subject: return value of KeyRelease callback is ignored? Reply with quote

Thanks for RC2!

In Gtk+, when the callback for KeyRelease event returns TRUE, the event isn't propagated further,
as explained in http://library.gnome.org/devel/gtk/stable/GtkWidget.html#GtkWidget-key-release-event

In GtkD RC2, the return value is not checked, and the event is always propagated.
Here is a simple patch:

Code:

--- Widget.d.orig       2008-09-08 18:14:25.000000000 +0900
+++ Widget.d    2008-09-08 18:14:49.000000000 +0900
@@ -1752,7 +1752,9 @@
                foreach ( gboolean delegate(GdkEventKey*, Widget) dlg ; widget.onKeyReleaseListeners )
                {
-                       dlg(event, widget);
+                       if (dlg(event, widget)) {
+                           return true;        // event consumed
+                       }
                }

                return consumed;


A similar patch should be necessary for KeyPress.
Back to top
View user's profile Send private message
Mike Wey



Joined: 07 May 2007
Posts: 428

PostPosted: Mon Sep 08, 2008 12:55 pm    Post subject: Reply with quote

added in svn r606, along with all the other events that can return a bool.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> gtkD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group