GNOME Bugzilla – Bug 496167
GailButton action click should synthesize a press GdkEvent
Last modified: 2008-04-02 08:30:18 UTC
At this moment, the action click is implemented on gailbutton by simply calling gtk_widget_activate. This works for widgets like button, where you only require to activate it. But in some cases the click action requires receive the press event, for example, with a slide-kind widget, where you press to modify the value of an element from the press until the release, in a continuous way The gtk_widget_activate should be substitued by a GDK press event followed by a GDK release event.
Created attachment 98975 [details] [review] Fixes the bug This patch fixes the bug, by implementing the click action as a press event followed by a release event.
Are press/release actions competent in the situation you described?
I think that I don't fully understand you. Press/release competent? You ask if applying this patch the click action in other cases still works? I tested it and it works with a normal button, not only in this case. But to avoid problems, I will try to add some context. To test this problem I was using dogtail. If I execute the action press on this custom element, a gdk event press is used, and the value start to being modified. If then I execute the action release, the value stop to being modified (although this required the fix on http://bugzilla.gnome.org/show_bug.cgi?id=336644) But if I try to use directly the action click, the value doesn't changes, at the custom widget uses the press/release events to manage how modify the value. If I made a "click function" on dogtail, based on call the action press and then the action release it works. The patch at comment 1 simply implements the click action in this way on gail button.
Sorry I didn't describe clearly. I understand the bug and the patch you made. I mean can you use press/release actions to modify a slide-kind widget's value, as a work around? Which from the comment #3, you can :-)
(In reply to comment #3) > But if I try to use directly the action click, the value doesn't changes, at > the custom widget uses the press/release events to manage how modify the value. > If I made a "click function" on dogtail, based on call the action press and > then the action release it works. So how about we just call: button->in_button = FALSE; gtk_button_leave (button); in your patch to simulate a release?
I suppose that you are talking about change: tmp_event.button.type = GDK_BUTTON_RELEASE; gtk_widget_event (widget, &tmp_event); with button->in_button = FALSE; gtk_button_leave (button); I have just make a test and doesn't works. As the patch launches a gdk event "press", after this change, trying to use a click leads to the button kept in pressed state continuosly. Anyway, as probably I could misunderstand comment 5, I tried too to simply add this two lines to the previous click button implementation, so: gtk_widget_activate (widget); button->in_button = FALSE; gtk_button_leave (button); but this doesn't work either.
I tried you patch. Seems after applying your patch, when perform click action on a button, the color of the button changes, just like the mouse stays on the button. I guess the button listens the "fake" event of press and changes the color, but never receives the event indicates the mouse leaves.
Created attachment 108396 [details] [review] updated patch this patch can solve the problem by emitting button leave event, can you try it?
(In answer to comment #7) On the code where I detected the bug this problem isn't showed. Anyway I tested it in other environment and in other application (in this case gcalctool) and I see this "on press color" problem that you pointed (In answer to comment #8) I test this patch, and it seems to work with gcalctool, avoiding the color problem. In the same way, it still solves the problem described on comment #0