Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quit hides, exit quits, on MacOS #111

Open
metaclam opened this issue Oct 7, 2024 · 6 comments · May be fixed by #131
Open

Quit hides, exit quits, on MacOS #111

metaclam opened this issue Oct 7, 2024 · 6 comments · May be fixed by #131
Assignees
Labels
bug Something isn't working os:mac
Milestone

Comments

@metaclam
Copy link

metaclam commented Oct 7, 2024

Quit simply hides the app on MacOS 15.0.1. In my case it miniaturizes to the dock icon. You must go to Torrent menu > exit to actually quit.

This is a minor annoyance only; especially if you restart the Mac, transgui will not quit and interrupts restart.

@lighterowl lighterowl self-assigned this Jan 24, 2025
@lighterowl lighterowl added the bug Something isn't working label Jan 24, 2025
@lighterowl lighterowl added this to the 5.18.8 milestone Jan 24, 2025
@lighterowl
Copy link
Owner

Hi there, thanks for the report.

You'll have to help me out here though as I couldn't reproduce it with the latest build (https://github.com/lighterowl/transgui/actions/runs/12964723663) and MacOS 15.2. Here's a screencap of what I've tried :

foo.mp4

In my case, Hide actually hides , Quit/Exit actually quits, and Transgui doesn't seem to interrupt restart as the machine restarts as expected.

@lighterowl
Copy link
Owner

Ok, I know what this is about : the behaviour you're describing takes place when Close to tray is checked in Application options -> Advanced.

I'm not a Mac user so I don't have any ideas on what could be done to improve this, is "closing to tray" common on MacOS at all? Perhaps this shouldn't be an option to begin with. Let me know what you think.

@metaclam
Copy link
Author

Thx for looking into it. A "tray" isn't really a thing, but there's a "dock". So "Close to Tray" seems to mean in this case, the close button on the window itself will minimize the app's main window to the dock, instead of quitting the application. On most Mac apps that is not expected behavior, the window should close but the app remains running.

You are right that unchecking that means the CMD-Q or Quit from the Application menu, will quit the app as expected and allow a restart (I assume, have not tested restart but it does quit). However, it also means that clicking the close button on the window quits the application, which it shouldn't do.

Either state of that button, the minimize button on the window (the center button) minimizes to the dock as expected. So personally i can live with that non-standard close button with close to tray disabled. If you could fix that, you could leave the "close to tray" state off and remove from GUI and all would be normal Mac behavior.

one other note: most mac apps where you can close the main window would have a "Window" menu with an option to "Show Main Window" or some such.

@lighterowl
Copy link
Owner

What you're describing seems to be non-standard behaviour from an application's perspective, unless I'm missing something or these applications customarily use some kind of common framework that provides such window behaviour. "Stock" Lazarus applications just quit when clicking the red button, and so does the Cocoa HelloWorld example. So I'm fairly sure this isn't provided by MacOS itself and needs some extra care to implement, and I couldn't find any documentation relating to this specifically.

How about this : both the red and yellow buttons minimise the window, and quitting is possible via Torrent -> Quit or by right-clicking the application in the dock and selecting Quit. The window itself can still be hidden by right-clicking the application in the dock and selecting Hide. It would be perfect if I could make the red button equivalent to clicking "Hide" in the dock but I couldn't find anything related to that, will keep looking though.

The fact that the application blocks restart when minimised is a bug and will be fixed regardless.

Sound good?

@lighterowl
Copy link
Owner

Ok, scratch that. I was able to get this working so that the red button hides the window - surprisingly, the proper function to call is Application.Minimize which is translated to NSApplication.hide under macOS. It is also now possible to interact with the application via the dock and Hide, Show and Quit do what they should.

@lighterowl
Copy link
Owner

The changes are in https://github.com/lighterowl/transgui/actions/runs/13098591433 , please try them out and let me know what you think. "Close to tray" and "Minimize to tray" are now hidden in the UI and the relevant options will be removed from INI when the window is closed. The red button now always hides the application to the dock, restart is not blocked anymore, and exiting the application is possible via "Quit" in the dock or via the application's menu.

@lighterowl lighterowl linked a pull request Feb 2, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working os:mac
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants