Skip to content

Add support for invoking the OS window popup menu #13217

@FloofyPeachy

Description

@FloofyPeachy

Describe the project you are working on

A 3D desktop model editor.

Describe the problem or limitation you are having in your project

My editor has a custom title bar for to free up space inside the window. Other required features are available, except for the system window popup. In a regular window, this can be accessed by right clicking on the title bar or using a shortcut, but there are no methods to manually invoke it in Godot.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Having a function that can be executed to invoke the system window popup menu can be added, regaining the ability to open the menu from Godot, easily, in line with the other window management functions.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Creating a function in DisplayServer that invokes the menu at the current mouse position, at the underlying system level.

This can be used, for example, with an _inputevent detecting right clicks on a container for a custom title bar.

Image

godotengine/godot#110688

If this enhancement will not be used often, can it be worked around with a few lines of script?

Potentially, yes, at least in C#, with DllInput albeit Windows only.

Is there a reason why this should be core and not an add-on in the asset library?

As Godot becomes a better choice for utilities, custom title bars might come up more often for style or practicality. Additionally, add-ons do not have the level of access required to call underlying system functions like the ones required.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions