diff options
author | Li Yuan <li.yuan@.sun.com> | 2008-04-02 08:29:31 +0000 |
---|---|---|
committer | Li Yuan <liyuan@src.gnome.org> | 2008-04-02 08:29:31 +0000 |
commit | d33b599ac77991a3ee9da6d292ba1b402102aeee (patch) | |
tree | 02ddd118d273c92d7de6d178c1f9d1d5d99a572a /modules/other | |
parent | 6716dc6f763940613defdbca376701a3787df9aa (diff) | |
download | gtk+-d33b599ac77991a3ee9da6d292ba1b402102aeee.tar.gz |
Patch from Alejandro Piñeiro Iglesias <apinheiro@igalia.com>. Bug
2008-04-02 Li Yuan <li.yuan@.sun.com>
* gailbutton.c: (idle_do_action):
Patch from Alejandro Piñeiro Iglesias <apinheiro@igalia.com>.
Bug #496167. Synthesize press and release GdkEvent in button's click
action.
svn path=/trunk/; revision=19958
Diffstat (limited to 'modules/other')
-rw-r--r-- | modules/other/gail/ChangeLog | 7 | ||||
-rw-r--r-- | modules/other/gail/gailbutton.c | 23 |
2 files changed, 29 insertions, 1 deletions
diff --git a/modules/other/gail/ChangeLog b/modules/other/gail/ChangeLog index 8f3dcd529f..993b9f0608 100644 --- a/modules/other/gail/ChangeLog +++ b/modules/other/gail/ChangeLog @@ -1,3 +1,10 @@ +2008-04-02 Li Yuan <li.yuan@.sun.com> + + * gailbutton.c: (idle_do_action): + Patch from Alejandro Piñeiro Iglesias <apinheiro@igalia.com>. + Bug #496167. Synthesize press and release GdkEvent in button's click + action. + 2008-03-31 Li Yuan <li.yuan@sun.com> * gailbutton.c: (gail_button_ref_state_set): diff --git a/modules/other/gail/gailbutton.c b/modules/other/gail/gailbutton.c index 64232f5e93..dc2e9d5ebd 100644 --- a/modules/other/gail/gailbutton.c +++ b/modules/other/gail/gailbutton.c @@ -522,7 +522,28 @@ idle_do_action (gpointer data) switch (action_number) { case 0: - gtk_widget_activate (widget); + /* first a press */ + + button->in_button = TRUE; + gtk_button_enter (button); + /* + * Simulate a button press event. calling gtk_button_pressed() does + * not get the job done for a GtkOptionMenu. + */ + tmp_event.button.type = GDK_BUTTON_PRESS; + tmp_event.button.window = widget->window; + tmp_event.button.button = 1; + tmp_event.button.send_event = TRUE; + tmp_event.button.time = GDK_CURRENT_TIME; + tmp_event.button.axes = NULL; + + gtk_widget_event (widget, &tmp_event); + + /* then a release */ + tmp_event.button.type = GDK_BUTTON_RELEASE; + gtk_widget_event (widget, &tmp_event); + button->in_button = FALSE; + gtk_button_leave (button); break; case 1: button->in_button = TRUE; |