1
0
mirror of synced 2024-11-15 03:27:40 +01:00
ImHex/lib/libimhex/source/helpers
David Mentler 751eff0edf
impr: Restore native macOS title bar double click gesture in borderless mode (#1689)
### 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

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2024-05-20 11:27:57 +02:00
..
crypto.cpp refactor: Get rid of this->m_ 2023-12-19 13:10:25 +01:00
debugging.cpp feat: Added debug variables to aid with development 2023-10-13 23:46:48 +02:00
encoding_file.cpp fix: Build error due to mismatching types 2024-01-27 16:56:18 +01:00
fs.cpp build: Added support patches for FreeBSD (#1584) 2024-03-21 21:31:17 +01:00
http_requests_emscripten.cpp refactor: Get rid of this->m_ 2023-12-19 13:10:25 +01:00
http_requests_native.cpp impr: Code style improvements 2023-12-27 16:33:49 +01:00
http_requests.cpp fix: Missing include 2023-11-19 16:11:26 +01:00
logger.cpp impr: Optimize includes in logger 2024-03-25 20:37:19 +01:00
magic.cpp impr: Allow full magic analysis, removed unidentified data from magic report 2024-05-19 10:21:02 +02:00
opengl.cpp impr: .0f -> .0F 2024-02-24 23:34:29 +01:00
patches.cpp fix: Misspelling of Endianness (#1609) 2024-03-28 22:25:28 +01:00
tar.cpp impr: Only store paths with forward slashes in project files 2024-05-08 21:30:20 +02:00
utils_linux.cpp impr: General code cleanup 2023-11-10 20:47:08 +01:00
utils_macos.m impr: Restore native macOS title bar double click gesture in borderless mode (#1689) 2024-05-20 11:27:57 +02:00
utils.cpp fix: Remaining build issues 2024-03-13 09:40:37 +01:00