Repository navigation
fix(ui): keep floating surfaces clickable over desktop drag regions - #67285
Conversation
There was a problem hiding this comment.
I couldn't verify this: the bug only happens in the Electron desktop app on macOS. Headless Chromium can't launch here (missing system libraries), so the e2e spec didn't run either. From reading the code, the approach is right. The positioners and overlays are portalled after the drag regions, so their no-drag cuts a hole only while they're shown. Every place that sets data-floating-overlay sets it only while visible.
Public API: unchanged.
One small concern, inline: tooltip positioners match too. The e2e addition only checks the computed CSS, which synthetic clicks can't really exercise. For a one-rule fix it can be dropped to keep the change minimal.
| The OS takes presses inside a drag region before the page sees them, whatever is painted on top. A later no-drag | ||
| region cuts a hole in it, so menus and popovers portalled over the titlebar or the session header stay clickable. | ||
| */ | ||
| [data-popper-positioner], |
There was a problem hiding this comment.
This also matches tooltip positioners. A tooltip that appears over the titlebar or the header gap, for example while hovering a tab, would stop window dragging under it while it's shown, even though it isn't interactive. packages/app/src/runtime/plugin/embeds.tsx already leaves tooltips out of its overlay check with [data-popper-positioner]:not(:has([role="tooltip"])). Doing the same here would keep the hole to surfaces you can actually click.
Summary
Electron's drag areas take mouse presses before the page sees them, whatever is drawn on top. Menus and popovers portalled over the session header's drag gap (or the titlebar) look clickable, but a click there starts a window drag. Electron's documented fix is to mark the surfaces on top as
no-drag, which cuts a hole in the drag area only while they're open./* packages/ui/src/styles/base.css */ *[data-tauri-drag-region] [contenteditable] { app-region: no-drag; } + +[data-popper-positioner], +[data-floating-overlay] { + app-region: no-drag; +}This covers menus, submenus, selects, popovers and other floating surfaces. No flag: this is a bug fix.
Closes #63776
Evidence
After: with the rule in place, those items click, the window still drags from the gap outside the menu, and the gap drags again once the menu closes. Tested by hand with real clicks.
e2e/regression/session-header.spec.ts› "the desktop session header drags the window from the gap after the title" (ltr, rtl) now opens a menu and checks:Merge Danger
Door: two-way
One CSS rule; reverting it restores the old behaviour.
Blast Radius: drag areas
Only the area under a visible popper or floating overlay stops dragging, and only while it's laid out. Web builds ignore
app-region. Windows uses the same Chromium mechanism but hasn't been tried by hand.