Skip to content

Closing popups requires two Esc key presses #2118

@tokyo4j

Description

@tokyo4j

In KDE Plasma or GNOME, we can press Escape key to close a popup menu in applications like featherpad and gedit. However, in cosmic-comp, it requires two key presses of Escape key. I think the cause is that cosmic-comp consumes the first press of Escape key to finish popup grab and the applications cannot see the key press:

cosmic-comp/src/input/mod.rs

Lines 1762 to 1781 in ef14b7e

// cancel grabs
if is_grabbed
&& handle.modified_sym() == Keysym::Escape
&& event.state() == KeyState::Pressed
&& !modifiers.alt
&& !modifiers.ctrl
&& !modifiers.logo
&& !modifiers.shift
{
seat.supressed_keys().add(&handle, None);
return FilterResult::Intercept(Some((
Action::Private(PrivateAction::Escape),
shortcuts::Binding {
modifiers: shortcuts::Modifiers::default(),
keycode: None,
key: Some(Keysym::Escape),
description: None,
},
)));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions