Commit Graph

117 Commits

Author SHA1 Message Date
WerWolv 92b5fd84c2 impr: Simplify tracy integration 2024-06-01 23:57:34 +02:00
WerWolv 3e0bb6d8be feat: Added initial support for tracing function calls and printing exception stack traces 2024-06-01 16:36:36 +02:00
WerWolv b4a810c374 fix: Build error on some platforms due to unused variables 2024-05-30 21:49:01 +02:00
WerWolv 08c2f3fc15 impr: Make window less prone to flickering during resizes on Windows 2024-05-30 16:57:07 +02:00
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
David Mentler 2cb673fd81
impr: Stop rubber banding while resizing on macOS (#1690)
### Problem description
On macOS `glfwSetWindowSizeCallback` is invoked early during window
resizing, rendering a frame in that callback leads to wonky results as
the new framebuffer is swapped before the OS has the chance to actually
resize the window:


https://github.com/WerWolv/ImHex/assets/1068675/46336419-3fc2-4aa1-b16f-68b0c00e3584

### Implementation description
Window contents are redrawn only from `glfwSetWindowRefreshCallback`
during resizing, fixing the issue:


https://github.com/WerWolv/ImHex/assets/1068675/3acc5d4a-b2a5-42f0-9015-5e7172a027cf
2024-05-19 14:14:57 +02:00
WerWolv 125d6a3e2a fix: Settings not being written anymore after restart 2024-05-18 20:32:34 +02:00
WerWolv 7a14e3dac4 fix: Wayland error discarding build errors with older GLFW versions 2024-05-17 20:22:55 +02:00
WerWolv 85fa1b2122 fix: Log spam on Wayland 2024-05-17 09:26:13 +02:00
SparkyTD ea0cafa229
fix: Not being able to close certain modal popups with the close button on the title bar (#1659)
### Problem description
When the close button is clicked, `ImGui::BeginPopupModal()` sets the
bool passed into the second parameter (p_open) to false. However, the
closing logic did not take this into account, making it difficult to
actually close modal popups.

For example, closing the "Export pattern File" modal took several clicks
on the "X" button, now it closes instantly.

### Implementation description
I added an additional check for the `open` variable being `false` in the
logic that checks the closing condition.
2024-05-09 17:49:31 +02:00
WerWolv 978fa17932 impr: Make accept pattern popup open faster and close correctly 2024-05-08 23:54:09 +02:00
WerWolv 2994e69c08 impr: Refactor GLFW window hints into individual window files 2024-05-03 21:39:31 +02:00
daver32 6fbbf899b0
fix: Frame rate getting unlocked when inputs are being processed (#1632)
### Problem description
The framerate limiter doesn't work when inputs are being sent (eg mouse
cursor moving over the window), because `glfwWaitEventsTimeout` returns
early when it encounters an event.

### Implementation description
I made it sleep for the remaining time when that happens.
2024-05-01 20:48:41 +02:00
WerWolv 81982aa821 impr: Make windows always fully opaque when they're not docked 2024-04-27 20:19:45 +02:00
Nik cc7a0db35c
fix: Build issue when GLFW_WAYLAND_APP_ID isn't defined 2024-04-21 17:04:56 +02:00
Integral 6f11873d7e
fix: Missing window icon under wayland (#1633)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description
When running ImHex under Wayland, the window icon is missing.

### Implementation description
Setting
[```GLFW_WAYLAND_APP_ID```](https://www.glfw.org/docs/latest/group__window.html#gafbf1ce7a4362c75e602a4df9e1bdecd3)
to fix the issue.

### Screenshots
Before:

![Screenshot_20240420_162144](https://github.com/WerWolv/ImHex/assets/71180087/3318970f-6ed7-4161-b686-c2eaa28a0739)


After:

![Screenshot_20240420_161920](https://github.com/WerWolv/ImHex/assets/71180087/e9e35fb6-e3c1-44a8-b7a5-b145dfe225d9)


### Additional things
<!-- Anything else you would like to say -->
2024-04-21 12:24:20 +02:00
WerWolv 5f75c8684f impr: Better UI for the case when no plugins could be loaded 2024-04-10 21:04:57 +02:00
WerWolv f587710d1c fix: Multiple memory corruption issues 2024-03-26 19:49:10 +01:00
WerWolv 9236b92dc1 fix: Memory leak when closing ImHex 2024-03-21 21:39:29 +01:00
WerWolv f4ec69021d impr: Manually implement VSync because GPU manufacturers are terrible at writing drivers 2024-03-14 21:18:57 +01:00
WerWolv 95da957f73 impr: Try to improve framerate limiting once more 2024-03-14 19:56:09 +01:00
WerWolv 9b1417f32d fix: ImHex using a ton of CPU power on Linux 2024-03-12 09:06:58 +01:00
WerWolv 8f3f941600 impr: Prevent ImHex from getting stuck in an infinite crash loop 2024-03-02 09:52:09 +01:00
WerWolv 296af748ee fix: Platform window not being updated when recovering from a crash 2024-03-01 20:55:03 +01:00
iTrooz 97f5175c84
impr: Better recovery from exceptions thrown in main thread (#1577)
This PR improves many things which can be seen by the commit name, but
the most important thing is the addition of a popup telling the user
when an exception is thrown


![image](https://github.com/WerWolv/ImHex/assets/42669835/db796416-9cce-4aa5-ad60-c22f05b5fc73)
2024-03-01 18:21:15 +01:00
WerWolv dc1a5a860c fix: Buggy window detachment 2024-02-28 20:36:22 +01:00
WerWolv f7b431902d fix: Make sure glfw waits properly on Wayland 2024-02-28 20:16:15 +01:00
WerWolv 686d47a59e fix: Frame limiting not working correctly on Linux 2024-02-28 18:48:01 +01:00
WerWolv e1795d687f impr: Implement a better algorithm to determine if the frame content has changed 2024-02-27 18:55:18 +01:00
WerWolv 393bea6d4b impr: Don't pass unique_ptr by const reference 2024-02-24 15:06:28 +01:00
WerWolv 91dcfefc5c fix: Crash when recovering from a thrown exception in the main thread 2024-02-23 17:48:23 +01:00
WerWolv 01c934f53a impr: Rework setting change listeners 2024-02-18 11:29:18 +01:00
WerWolv ed292a1e7a impr: Implement basic exception catching in main thread 2024-02-18 02:12:57 +01:00
WerWolv 5d405b4d10 build: Updated GLFW and OpenGL3 ImGui Backends 2024-02-11 11:44:44 +01:00
Nik bcbcb1f23c
impr: Various web build improvements, API cleanup (#1541) 2024-02-10 23:31:05 +01:00
WerWolv 4b20e35fd2 fix: macOS window missing decoration after restart 2024-02-10 10:17:15 +01:00
WerWolv a5f6756659 impr: Hide window immediately after render loop finishes 2024-02-09 19:42:47 +01:00
WerWolv a6f4d0cdec impr: Unfocus ImGui windows when main window loses focus 2024-02-03 23:56:08 +01:00
WerWolv cecb8b8d31 fix: Linking issues and menu bar not appearing sometimes 2024-01-29 15:44:18 +01:00
Nik 339541a56f
impr: Restructure various components much better (#1520) 2024-01-28 22:14:59 +01:00
Nik 58603ed12a
impr: Better experience when first starting ImHex (#1510) 2024-01-21 18:39:51 +01:00
Nik d005b5d2d9
feat: Allow toolbar icons to be modified (#1509) 2024-01-21 18:39:32 +01:00
WerWolv 566147dfae fix: Popups not always appearing when starting ImHex 2024-01-21 14:22:08 +01:00
WerWolv 3e5967c5a7 fix: Dropping files onto ImHex opening them twice 2024-01-20 21:03:46 +01:00
WerWolv 82a3017629 feat: Added always on top and fullscreen mode toggle 2024-01-15 20:52:08 +01:00
WerWolv ea7483f9a7 impr: Get rid of the concept of built-in plugins
#1489
2024-01-12 23:03:13 +01:00
WerWolv 3449525ead feat: Added drag-n-drop overlay for windows 2024-01-10 23:46:50 +01:00
WerWolv a35530f63b fix: Menu bar being hidden by default in the web version 2024-01-08 23:41:28 +01:00
WerWolv bfafc692db impr: Added icons to all menu items 2024-01-08 21:51:48 +01:00
WerWolv 409b3ccd6c fix: Popups not appearing at launch sometimes and crashes when exiting 2024-01-06 17:38:55 +01:00