impr: Restore native macOS title bar double click gesture in borderless mode #1689
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem description
Problem 1
In borderless mode ImHex disables the standard macOS titlebar rendering and input processing. As a result double clicking the titlebar does not trigger the native macOS behavior set in
System Settings -> Desktop & Dock -> Double-click a window's title bar to [Zoom/Minimize/Do nothing]
.Problem 2
The ImHex window shows up as blank/transparent when de-minimizing it from the dock.
Problem 3
Widgets experience ghost hover inputs from the past position of the cursor during live resizing.
Implementation description
ImGui elements consume input events in the order they are drawn. As a result by "drawing" an
InvisibleButton
over the content area of the titlebar we can catch unprocessed clicks in the titlebar area. Connecting this button's double clicks to the native window is then a trivial endeavour.The blank windows was caused by the rendering stack clearing the GL buffer, but proceeding to draw nothing in it. I have short circuited this path.
Ghost hover inputs were squelched by consistently moving the ImGui cursor to
0, 0
during a live resize. The OS will dispatch a cursor positioning event once the resizing ends, restoring normal behavior.Screenshots
N/A
Additional things
N/A