1
0
mirror of synced 2024-11-24 07:40:17 +01:00
Commit Graph

546 Commits

Author SHA1 Message Date
WerWolv
03d344c0a2 build: Streamline definition on plugin features 2024-07-08 18:12:46 +02:00
WerWolv
dae028d25d fix: Build issue due to uncaptured this pointer 2024-07-05 21:03:24 +02:00
WerWolv
88e2fa04e7 fix: Crash on macOS when dirtying or undirtying a provider from a thread
Fixes #1799
2024-07-05 20:59:20 +02:00
WerWolv
b652565b57 feat: Added DPI awareness on Windows, added FiraCode as optional default font 2024-07-05 17:39:07 +02:00
WerWolv
c26eccfe28 web: Fix canvas to the top left of the screen 2024-07-04 21:37:51 +02:00
WerWolv
9fd547112d impr: Only handle SIGINT on release builds so IDEs can fast-kill ImHex 2024-07-04 21:28:43 +02:00
WerWolv
90bb5d187c web: Fix touch input 2024-07-03 22:35:47 +02:00
WerWolv
01b9cc64d6 impr: Disable tab overlines 2024-07-01 23:53:14 +02:00
WerWolv
2f2717e9aa impr: Completely eradicate Window resize flickering on Windows 2024-07-01 20:50:10 +02:00
WerWolv
60b81e714b impr: Prevent canvas flickering in web build 2024-07-01 20:09:16 +02:00
WerWolv
adc279d681 impr: Further try to improve window resize flickering on Windows 2024-06-29 23:32:44 +02:00
WerWolv
f90dc5d619 fix: ImHex hanging at startup in certain cases 2024-06-29 21:13:04 +02:00
WerWolv
cbf415256b fix: Default folders still not being created correctly on Linux 2024-06-29 19:15:09 +02:00
WerWolv
10970d170c fix: Default folders not being created correctly anymore 2024-06-29 13:01:25 +02:00
WerWolv
90ac96298a impr: Only re-render frame once during window resize or move operations 2024-06-28 21:27:35 +02:00
WerWolv
91f6aae9ef impr: Make Win32 API properly use unicode support 2024-06-28 11:12:17 +02:00
WerWolv
d9cecbbb5f impr: Don't flash bang people when the ImHex main window appears 2024-06-27 17:11:28 +02:00
WerWolv
e5c782ebe9 impr: Further optimize ImGui text rendering 2024-06-27 17:09:20 +02:00
WerWolv
e236872af3 feat: Added simple interactive help system 2024-06-24 22:53:25 +02:00
WerWolv
3d301c4202 fix: Don't automatically create directories in read-only locations
Fixes #1767
2024-06-24 21:51:37 +02:00
WerWolv
a9915579a0 impr: Better detection of Intel GPUs with really bad driver bugs 2024-06-22 22:58:58 +02:00
iTrooz
65dfd4da0f
feat: log stacktrace implementation used (#1769) 2024-06-22 21:33:52 +02:00
WerWolv
b93fd523aa fix: Remove last remaining getDefaultPaths 2024-06-22 12:57:13 +02:00
WerWolv
b60a262b58 fix: Replace old defaults path system with a new one
#1767
2024-06-22 10:44:55 +02:00
WerWolv
3bfb0096e6 fix: Undefined behaviour when sending empty arguments to main instance 2024-06-20 11:09:57 +02:00
WerWolv
f49715c7a0 impr: Better font loading logic 2024-06-16 22:41:16 +02:00
WerWolv
b3b79b3ee8 impr: Show document edited icon in close button on macOS 2024-06-12 19:51:12 +02:00
WerWolv
e954d49c29 feat: Handle SIGINT 2024-06-08 00:57:56 +02:00
WerWolv
ffe3dae7b2 build: Updated ImGui to v1.90.8 2024-06-07 22:12:50 +02:00
WerWolv
4797512207 fix: Variable naming style in splash window 2024-06-05 22:24:00 +02:00
iTrooz
984438e98d
feat: show Linux distribution information on startup (#1729) 2024-06-03 10:02:29 +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
iTrooz
92b1234ddb
build: Reduce debug info produced (#1720) 2024-05-27 16:33:15 +02:00
David Mentler
bdaf1e4151
build: Xcode accomodating CMake setup (#1688)
### Problem description
This PR implements some rudimentary Xcode support for building and
editing ImHex.

### Implementation description

#### Problem 1: Xcode is a multi-configuration buildsystem
The project is already rather CMake generator independent, thus it did
not need to change much to support Xcode's multi-configuration paradigm:

By default, CMake generates a `.xcodeproj` in which targets build their
artifacts into the specified `<>_OUTPUT_DIRECTORY`, postfixed by the
currently active configuration. To better fit the existing paradigm, I
instead opted ot introduce `IMHEX_MAIN_OUTPUT_DIRECTORY`. This variable
is equal to the previously used `RUNTIME_OUTPUT_DIRECTORY` when using
other generators, and is changed to include a configuration specific
_prefix_ when used with Xcode.

The result is different output directories when using Xcode, and no
changes when using any other generator.

#### Problem 2: ImHex does not support AppleClang
To allow building the codebase with Xcode, I have introduced
`IMHEX_IDE_HELPERS_OVERRIDE_XCODE_COMPILER`. Specifying this option to
`ON` will force CMake to honor the user specified compiler settings,
even when using the Xcode generator.

In practice this can be used together with the new "xcode" CMakePreset
to build the project with mainline clang using `xcodebuild`, or Xcode
itself by generating a buildsystem like so:
```
cmake --preset xcode -DCMAKE_PREFIX_PATH=/opt/homebrew/opt/llvm@17
```

This solution is of course not without flaws. The inner workings are a
particularly ugly hack, and mainline clang does not implement the
necessary extensions to allow Xcode to index the code. Regardless this
option is useful to enable future work in terms of bundling/signing
macOS applications in the "intended" way using Xcode without additional
source modifications.

#### Problem 3: Vanilla CMake + Xcode = Bad developer UX 
By default, the CMake generated `.xcodeproj` is a mess. Tons of targets
are scattered about, and source files are not organized beyond grouping
them into a "Source Files" and "Header Files" group.

Even "Header Files" is missing, because the ImHex build system does not
regard private header files of libraries as sources of a target, and
Xcode does not try to guess this information.

The solution is twofold:
* Additional code has been added which organizes the targets into a neat
folder structure
* Additional code was added behind a configuration flag
`IMHEX_IDE_HELPERS_INTRUSIVE_IDE_TWEAKS` which automatically creates
source file trees in Xcode targets, and discovers the non-declared
header files via the folder convention.

### Screenshots
N/A

### Additional things

As a bonus: `IMHEX_OFFLINE_BUILD` assumes that ImHex-Patterns is cloned
into the source tree. I have added an additional fallback that tries to
locate it as a sibling folder of `${CMAKE_SOURCE_DIR}`, as this meshes
better with my filesystem setup.

The setup was tested with `CMake 3.29.2`, `Xcode 15.2`, and `llvm@17`
from homebrew.
2024-05-20 10:12:57 +00: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
WerWolv
ca17054a1e impr: Store settings and achievements immediately 2024-05-15 18:27:09 +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
89f360d1a7 fix: Texture multisampling being used on OpenGL < 3.2
#1653
2024-05-08 22:09:47 +02:00
WerWolv
19c02be673 impr: Only store paths with forward slashes in project files
Fixes #1657
2024-05-08 21:30:20 +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
1df0eea6c6 impr: Added support for SVG loading, improved texture loading API 2024-05-01 20:36:10 +02:00
WerWolv
81982aa821 impr: Make windows always fully opaque when they're not docked 2024-04-27 20:19:45 +02:00
Nora
a7033b68f7
feat: Support DWM immersive dark mode on Windows (#1636)
### Problem description
Implements support for DWM immersive dark mode.  
Closes #1635.

### Implementation description
Uses the DwmSetWindowAttribute API to enable this feature.

Documentation can be found
[here](https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/apply-windows-themes#enable-a-dark-mode-title-bar-for-win32-applications).

### Screenshots
Before:

![image](https://github.com/WerWolv/ImHex/assets/51166756/a2be204f-aa2d-44d7-8628-643a903d6679)

After:

![image](https://github.com/WerWolv/ImHex/assets/51166756/f6c9ab41-c811-45f7-826f-401dd712674b)

### Additional things
Nothing.
2024-04-27 10:03:44 +02:00