Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Right-clicking on an element with app-region: drag shows title bar menu #3565

Open
leaanthony opened this issue Jun 13, 2023 · 5 comments
Open
Assignees
Labels
feature request feature request tracked We are tracking this work internally.

Comments

@leaanthony
Copy link

leaanthony commented Jun 13, 2023

Description

Recently, support was added for the app-region CSS property, that allows developers to indicate which elements may be used to drag windows. Right-clicking such a region brings up the default title bar menu. I would expect this to show the default context menu, however I can understand why it does what it does (HTCAPTION message by any chance?). Perhaps this can be configurable?

Example

Right-clicking on non-draggable area:
image

Right clicking on draggable area:
image

Version
SDK: N/A
Runtime: 114.0.1823.43
Framework: Win32
OS: Windows 11 Pro 22H2 (22621.1778)

Repro Steps
Add app-region: drag to any element. Right click on that element.

AB#45248037

@leaanthony leaanthony added the bug Something isn't working label Jun 13, 2023
@champnic champnic added the tracked We are tracking this work internally. label Jun 13, 2023
@champnic
Copy link
Member

Thanks for catching this! I've added it as a bug on our backlog.

@champnic champnic self-assigned this Jun 13, 2023
@champnic
Copy link
Member

Hey @leaanthony - This is currently By Design as the intent for the "drag" region is to be used as the titlebar. Do you have a scenario that would benefit from being a drag region outside of the titlebar?

@leaanthony
Copy link
Author

This is currently By Design as the intent for the "drag" region is to be used as the titlebar.

Hi @champnic - I've added a comment on the w3c spec thread whilst they are still debating it about whether drag really means title bar and if so, that the spec should clarify that.

There are certainly scenarios where you would want to define regions that should be draggable and not act like titlebars, for instance frameless non-rectangular applications which win32 provides support for. Apple even provide this in Cocoa for moving NSWindows by their background.

So whilst this is closed, I would implore you to consider reopening it, not necessarily to change what app-region: drag does (I'm clarifying that with the w3c group), but more that there should be a way of setting this to act like an HTCLIENT rather than HTCAPTION. Not only would it be backwards compatible with the current behaviour but it would also give developers the flexibility to choose how those regions should act, just like they currently do with a normal win32 window.

Unfortunately, as it is, it means that frameworks like Wails and Tauri will need to continue using JS hacks instead of the native app-region to ensure they have flexibility in how the app works. If this is then promoted to default behaviour then we will be asking for a way of disabling it, which isn't great.

Thanks for your time as always @champnic 🙏

@champnic
Copy link
Member

Thanks for following up with the w3c spec.

Regarding scenarios, I was looking for a scenario where a dev would decide to have a drag region outside of the title bar in their app. Like "Building an app that does 'x' and user expects dragging this area will drag the whole app around" or similar. Do you know of any dev scenarios that need this functionality?

@champnic champnic added feature request feature request tracked We are tracking this work internally. and removed bug Something isn't working tracked We are tracking this work internally. labels Jun 27, 2023
@champnic champnic reopened this Jun 27, 2023
@champnic
Copy link
Member

@leaanthony I'm reopening this issue and changing it to a Feature Request instead of a Bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request feature request tracked We are tracking this work internally.
Projects
None yet
Development

No branches or pull requests

2 participants