Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

[a11y][Gtk] Revert combobox fix. #899

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 1 addition & 21 deletions Xwt.Gtk/Xwt.GtkBackend/AccessibleBackend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,27 +59,7 @@ public void Initialize (IAccessibleEventSink eventSink)
public void Initialize (IWidgetBackend parentWidget, IAccessibleEventSink eventSink)
{
var backend = parentWidget as WidgetBackend;
Gtk.Widget nativeWidget = null;

// Needed only for AtkCocoa.
if (Platform.IsMac) {
// Gtk.ComboBox and Gtk.ComboBoxEntry a11y doesn't work with Gtk/AtkCocoa.
// Workaround:
// Set a11y properties to their children.
// For Gtk.ComboBoxEntry use its Gtk.Entry, for Gtk.ComboBox -- Gtk.ToggleButton.
if (backend is IComboBoxEntryBackend) {
nativeWidget = (backend?.Widget as Gtk.Bin)?.Child;
} else if (backend is IComboBoxBackend) {
foreach (var child in ((Gtk.Container)backend.Widget).AllChildren) {
if (child is Gtk.ToggleButton) {
nativeWidget = (Gtk.Widget)child;
break;
}
}
}
}

Initialize (nativeWidget ?? backend?.Widget, eventSink);
Initialize (backend?.Widget, eventSink);
}

public void Initialize (IPopoverBackend parentPopover, IAccessibleEventSink eventSink)
Expand Down