gui/window: Only set focus when popover is explicitly closed
The window would either set focus to the event widget or a focusable ancestor, no matter how the event popover was being closed. This caused a major accessibility regression where, whenever the event editor dialog opened from the event popover, the window set focus to the event widget instead of the content inside the dialog, which made the dialog incapable of navigating through until the dialog was focused. This also prevented mnemonics from being triggered. This patch addresses that bug by only setting focus whenever the popover is being closed explicitly; as in, when the user presses outside the popover to hide it or pressing escape. Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1398
This commit is contained in:
@@ -862,14 +862,13 @@ event_preview_cb (GcalEventWidget *event_widget,
|
||||
|
||||
case GCAL_EVENT_PREVIEW_ACTION_NONE:
|
||||
default:
|
||||
if (self->last_focused_widget)
|
||||
{
|
||||
gtk_root_set_focus (GTK_ROOT (self), self->last_focused_widget);
|
||||
g_clear_weak_pointer (&self->last_focused_widget);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (self->last_focused_widget)
|
||||
{
|
||||
gtk_root_set_focus (GTK_ROOT (self), self->last_focused_widget);
|
||||
g_clear_weak_pointer (&self->last_focused_widget);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user