mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
impr: Make close button on macOS close providers if any are open instead of closing ImHex
This commit is contained in:
@@ -12,6 +12,13 @@ namespace hex {
|
||||
*/
|
||||
EVENT_DEF(EventImHexStartupFinished);
|
||||
|
||||
/**
|
||||
* @brief Called when the user presses the close button on the main window
|
||||
*
|
||||
* This is currently only used and implemented on macOS
|
||||
*/
|
||||
EVENT_DEF(EventCloseButtonPressed);
|
||||
|
||||
/**
|
||||
* @brief Called when ImHex is closing, to trigger the last shutdown hooks
|
||||
*
|
||||
|
||||
@@ -822,10 +822,7 @@ namespace hex {
|
||||
}
|
||||
|
||||
extern "C" void macOSCloseButtonPressed() {
|
||||
auto windowHandle = ImHexApi::System::getMainWindowHandle();
|
||||
|
||||
glfwHideWindow(windowHandle);
|
||||
glfwIconifyWindow(windowHandle);
|
||||
EventCloseButtonPressed::post();
|
||||
}
|
||||
|
||||
extern "C" void macosEventDataReceived(const u8 *data, size_t length) {
|
||||
|
||||
Reference in New Issue
Block a user