a11y: Remove "press" and "release" actions from buttons

http://mail.gnome.org/archives/gnome-accessibility-devel/2011-June/msg00020.html
has some details about this.
The main problem is that the internal button states get fiddled with and
that is not a good idea to do from an AT.

Also update tests to reflect that.
This commit is contained in:
Benjamin Otte
2011-06-28 19:13:43 +02:00
committed by Matthias Clasen
parent 8e28e22bcf
commit 6b02119bb1
13 changed files with 1 additions and 116 deletions

View File

@ -511,30 +511,6 @@ idle_do_action (gpointer data)
*/ */
g_signal_emit_by_name (button, "leave"); g_signal_emit_by_name (button, "leave");
break; break;
case 1:
/* FIXME: Do not access public member
button->in_button = TRUE;
*/
g_signal_emit_by_name (button, "enter");
/*
* 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 = 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);
break;
case 2:
/* FIXME: Do not access public member
button->in_button = FALSE;
*/
g_signal_emit_by_name (button, "leave");
break;
default: default:
g_assert_not_reached (); g_assert_not_reached ();
break; break;
@ -547,7 +523,7 @@ idle_do_action (gpointer data)
static gint static gint
gail_button_get_n_actions (AtkAction *action) gail_button_get_n_actions (AtkAction *action)
{ {
return 3; return 1;
} }
static const gchar* static const gchar*
@ -639,23 +615,6 @@ gail_button_action_get_name (AtkAction *action,
*/ */
return_value = "click"; return_value = "click";
break; break;
case 1:
/*
* This action simulates a button press by simulating moving the
* mouse into the button followed by pressing the left mouse button.
*/
return_value = "press";
break;
case 2:
/*
* This action simulates releasing the left mouse button outside the
* button.
*
* To simulate releasing the left mouse button inside the button use
* the click action.
*/
return_value = "release";
break;
default: default:
return_value = NULL; return_value = NULL;
break; break;

View File

@ -368,8 +368,6 @@ window1
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 0 keybinding: <Alt>l action 0 keybinding: <Alt>l
action 1 name: press
action 2 name: release
Credits Credits
"toggle button" "toggle button"
parent: unnamed-GailContainer-7 parent: unnamed-GailContainer-7
@ -417,8 +415,6 @@ window1
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 0 keybinding: <Alt>r action 0 keybinding: <Alt>r
action 1 name: press
action 2 name: release
Close Close
"push button" "push button"
parent: unnamed-GailContainer-7 parent: unnamed-GailContainer-7
@ -466,5 +462,3 @@ window1
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 0 keybinding: <Alt>c action 0 keybinding: <Alt>c
action 1 name: press
action 2 name: release

View File

@ -52,5 +52,3 @@ window1
image description: (null) image description: (null)
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 1 name: press
action 2 name: release

View File

@ -153,8 +153,6 @@ window1
image description: (null) image description: (null)
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 1 name: press
action 2 name: release
"table column header" "table column header"
parent: unnamed-GailTreeView-5 parent: unnamed-GailTreeView-5
@ -201,8 +199,6 @@ window1
image description: (null) image description: (null)
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 1 name: press
action 2 name: release
unnamed-GailContainerCell-6 unnamed-GailContainerCell-6
"table cell" "table cell"
parent: unnamed-GailTreeView-5 parent: unnamed-GailTreeView-5
@ -474,8 +470,6 @@ Click "Show other applications", for more options, or "Find applications online"
image description: (null) image description: (null)
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 1 name: press
action 2 name: release
unnamed-GailContainer-10 unnamed-GailContainer-10
"filler" "filler"
parent: unnamed-GailContainer-0 parent: unnamed-GailContainer-0
@ -532,8 +526,6 @@ Click "Show other applications", for more options, or "Find applications online"
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 0 keybinding: <Alt>s action 0 keybinding: <Alt>s
action 1 name: press
action 2 name: release
Cancel Cancel
"push button" "push button"
parent: unnamed-GailContainer-10 parent: unnamed-GailContainer-10
@ -581,5 +573,3 @@ Click "Show other applications", for more options, or "Find applications online"
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 0 keybinding: <Alt>c action 0 keybinding: <Alt>c
action 1 name: press
action 2 name: release

View File

@ -51,8 +51,6 @@ window1
image description: (null) image description: (null)
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 1 name: press
action 2 name: release
button2 button2
"push button" "push button"
index: 1 index: 1
@ -98,8 +96,6 @@ window1
image description: (null) image description: (null)
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 1 name: press
action 2 name: release
unnamed-GailContainer-0 unnamed-GailContainer-0
"filler" "filler"
parent: unnamed-GailContainer-1 parent: unnamed-GailContainer-1
@ -156,8 +152,6 @@ window1
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 0 keybinding: <Alt>c action 0 keybinding: <Alt>c
action 1 name: press
action 2 name: release
Cancel Cancel
"push button" "push button"
parent: unnamed-GailContainer-0 parent: unnamed-GailContainer-0
@ -205,8 +199,6 @@ window1
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 0 keybinding: <Alt>c action 0 keybinding: <Alt>c
action 1 name: press
action 2 name: release
Finish Finish
"push button" "push button"
parent: unnamed-GailContainer-0 parent: unnamed-GailContainer-0
@ -254,8 +246,6 @@ window1
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 0 keybinding: <Alt>f action 0 keybinding: <Alt>f
action 1 name: press
action 2 name: release
Go Back Go Back
"push button" "push button"
parent: unnamed-GailContainer-0 parent: unnamed-GailContainer-0
@ -303,8 +293,6 @@ window1
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 0 keybinding: <Alt>b action 0 keybinding: <Alt>b
action 1 name: press
action 2 name: release
Continue Continue
"push button" "push button"
parent: unnamed-GailContainer-0 parent: unnamed-GailContainer-0
@ -352,8 +340,6 @@ window1
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 0 keybinding: <Alt>o action 0 keybinding: <Alt>o
action 1 name: press
action 2 name: release
Apply Apply
"push button" "push button"
parent: unnamed-GailContainer-0 parent: unnamed-GailContainer-0
@ -401,5 +387,3 @@ window1
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 0 keybinding: <Alt>a action 0 keybinding: <Alt>a
action 1 name: press
action 2 name: release

View File

@ -76,8 +76,6 @@ window1
image description: (null) image description: (null)
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 1 name: press
action 2 name: release
button3 button3
"radio button" "radio button"
parent: grid1 parent: grid1
@ -126,8 +124,6 @@ window1
image description: (null) image description: (null)
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 1 name: press
action 2 name: release
button2 button2
"check box" "check box"
parent: grid1 parent: grid1
@ -174,8 +170,6 @@ window1
image description: (null) image description: (null)
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 1 name: press
action 2 name: release
button1 button1
"toggle button" "toggle button"
parent: grid1 parent: grid1
@ -222,5 +216,3 @@ window1
image description: (null) image description: (null)
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 1 name: press
action 2 name: release

View File

@ -121,8 +121,6 @@ window1
image description: (null) image description: (null)
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 1 name: press
action 2 name: release
unnamed-GailContainer-11 unnamed-GailContainer-11
"filler" "filler"
parent: unnamed-GailContainer-2 parent: unnamed-GailContainer-2
@ -1362,8 +1360,6 @@ window1
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 0 keybinding: <Alt>h action 0 keybinding: <Alt>h
action 1 name: press
action 2 name: release
OK OK
"push button" "push button"
parent: unnamed-GailContainer-57 parent: unnamed-GailContainer-57
@ -1411,8 +1407,6 @@ window1
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 0 keybinding: <Alt>o action 0 keybinding: <Alt>o
action 1 name: press
action 2 name: release
Cancel Cancel
"push button" "push button"
parent: unnamed-GailContainer-57 parent: unnamed-GailContainer-57
@ -1460,5 +1454,3 @@ window1
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 0 keybinding: <Alt>c action 0 keybinding: <Alt>c
action 1 name: press
action 2 name: release

View File

@ -52,5 +52,3 @@ window1
image description: (null) image description: (null)
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 1 name: press
action 2 name: release

View File

@ -52,7 +52,5 @@ window1
image description: (null) image description: (null)
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 1 name: press
action 2 name: release
<AtkHyperlinkImpl> <AtkHyperlinkImpl>
anchors: http://www.gtk.org anchors: http://www.gtk.org

View File

@ -26,8 +26,6 @@ Click to prevent further changes
image description: (null) image description: (null)
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 1 name: press
action 2 name: release
Lock Lock
"label" "label"
parent: button1 parent: button1

View File

@ -104,8 +104,6 @@ window1
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 0 keybinding: <Alt>y action 0 keybinding: <Alt>y
action 1 name: press
action 2 name: release
Tab 2 Tab 2
"page tab" "page tab"
parent: notebook1 parent: notebook1
@ -192,5 +190,3 @@ window1
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 0 keybinding: <Alt>n action 0 keybinding: <Alt>n
action 1 name: press
action 2 name: release

View File

@ -70,8 +70,6 @@ window1
image description: (null) image description: (null)
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 1 name: press
action 2 name: release
unnamed-GailComboBox-0 unnamed-GailComboBox-0
"combo box" "combo box"
parent: button4 parent: button4
@ -176,8 +174,6 @@ window1
image description: (null) image description: (null)
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 1 name: press
action 2 name: release
Sans Sans
"label" "label"
parent: button3 parent: button3
@ -274,8 +270,6 @@ window1
image description: (null) image description: (null)
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 1 name: press
action 2 name: release
button1 button1
"combo box" "combo box"
parent: grid1 parent: grid1

View File

@ -70,8 +70,6 @@ window1
image description: (null) image description: (null)
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 1 name: press
action 2 name: release
column 1 description: Column 2 column 1 description: Column 2
<column 1 header> <column 1 header>
Column 2 Column 2
@ -120,8 +118,6 @@ window1
image description: (null) image description: (null)
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 1 name: press
action 2 name: release
Column 1 Column 1
"table column header" "table column header"
parent: tree1 parent: tree1
@ -168,8 +164,6 @@ window1
image description: (null) image description: (null)
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 1 name: press
action 2 name: release
Column 2 Column 2
"table column header" "table column header"
parent: tree1 parent: tree1
@ -216,8 +210,6 @@ window1
image description: (null) image description: (null)
<AtkAction> <AtkAction>
action 0 name: click action 0 name: click
action 1 name: press
action 2 name: release
One One
"table cell" "table cell"
parent: tree1 parent: tree1