Skip to content

BUTTON_PRESS event that does not originate from within the menu is treated as a click outside #13829

Description

@dr-ni

Problem

When the Cinnamon menu is open, it installs a global captured-event handler via PopupMenuManager._grab() (popupMenu.js). Any BUTTON_PRESS event that does not originate from within the menu is treated as a click outside and triggers _closeMenu().

Cinnamon has an escape hatch for this — Main.virtualKeyboardManager.shouldTakeEvent(event) — which is supposed to let virtual keyboard clicks pass through without closing the menu. However, its implementation (virtualKeyboard.js#L818) only recognises Cinnamon's own built-in on-screen keyboard:

shouldTakeEvent(event) {
    if (!this._keyboard)
        return false;
    let actor = event.get_source();
    return Main.layoutManager.keyboardBox.contains(actor) ||
           !!actor._extendedKeys || !!actor.extendedKey;
}

Onboard is an external X11 window and is never inside keyboardBox, so shouldTakeEvent() returns false for every Onboard key press. The menu then closes immediately.

This happens regardless of Onboard's window mode (normal, force-to-top/override-redirect, docking).

Expected behaviour

Clicking an Onboard key while the Cinnamon menu search box is focused should type into the search box without closing the menu.

Suggested fix

Extend shouldTakeEvent() to also accept events from windows with _NET_WM_WINDOW_TYPE_DOCK or override_redirect set — the standard way external OSKs identify themselves to the WM.

Reference

Reported by a user in onboard-osk/onboard#41

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions