You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just tested the window example on OS X 10.10.5 and can confirm CMD+Q does not quit (or print any special events). Not sure if that's still something we'd want to handle in winit - I imagine we did, we'd at least still want some way to handle the request to close the window.
I've been using winit (through glutin) and I was wondering if it would be appreciated if I tried to add this behavior (personally it feels inconsistent that I can request a close through Alt+F4 on Windows but not through CMD+W or CMD+Q on Mac)
I suppose that there's not any case where Cmd+Q shouldn't trigger CloseRequested, since it's not like winit's goal is to support making horribly non-compliant applications. So, if you want it, then feel free to add it, and I'll merge it.
Reviving this issue from the dead: FWIW, I'm against adding new events to Event or WindowEvent that only ever get implemented on a single platform, since it makes it unlikely that those events will actually get used downstream. Would it be reasonably compliant to have cmd+Q send a CloseRequested event to every window in the application?
@Osspial CMD+Q should also kill any background processes for the application, but I'm not sure how in-scope for Winit that is. I think sending a close to all windows would come the closest to getting the "correct" behavior.
@ryanisaacg I mean, if all of an application's windows are closed there isn't a whole lot you can sensibly do besides terminate the entire application and its children.
I mean, if all of an application's windows are closed there isn't a whole lot you can sensibly do besides terminate the entire application and its children.
On Mac OS, it's long been common for applications to stay open after all windows close, because of the menu bar's persistence outside of any window's lifetime.
For example, in a simple word processor, where a window corresponds to an open document, a user may close all of their documents and then want later to create a new document or open an existing one. It's possible (even likely) they'd leave the application running with no open windows, then switch to it, probably using the Dock, and finally select the appropriate thing from the menu bar to open a new window.
Reacted by Felix Rabe, Osspial, Paulo Cunha, Mads Marquart and Travis
Activity
mitchmindtree commentedon Nov 3, 2016
Just tested the window example on OS X 10.10.5 and can confirm
CMD+Qdoes not quit (or print any special events). Not sure if that's still something we'd want to handle in winit - I imagine we did, we'd at least still want some way to handle the request to close the window.repi commentedon Jan 3, 2018
Can confirm that this is still the case;
CMD+Qon Mac doesn't quit or close the window.One can easily add it oneself though by checking
VirtualKeyCode::Qandmodifiers.logo, which is what I've done.But would be nice if it was automatic in Winit and generate
WindowEvent::Closed, but no big deal.✨ CMD-Q now quits the app on Mac
francesca64 commentedon May 6, 2018
With the new
CloseRequestedbehavior, implementing this would be (functionally) pretty innocuous, though I don't believe it's a good precedent to set.elliegoldstein commentedon Jun 3, 2018
I've been using winit (through glutin) and I was wondering if it would be appreciated if I tried to add this behavior (personally it feels inconsistent that I can request a close through
Alt+F4on Windows but not throughCMD+WorCMD+Qon Mac)francesca64 commentedon Jun 3, 2018
I suppose that there's not any case where Cmd+Q shouldn't trigger
CloseRequested, since it's not like winit's goal is to support making horribly non-compliant applications. So, if you want it, then feel free to add it, and I'll merge it.francesca64 commentedon Jun 3, 2018
Actually, Cmd+Q shouldn't send
CloseRequested, but a new top-levelQuitRequestedvariant or something, shouldn't it?elliegoldstein commentedon Jun 3, 2018
I'm not too sure; I'm pretty new to the Mac world. That definitely sounds right though.
francesca64 commentedon Jun 4, 2018
QuitRequestedcould also be useful for handling alacritty/alacritty#675Osspial commentedon Apr 24, 2019
Reviving this issue from the dead: FWIW, I'm against adding new events to
EventorWindowEventthat only ever get implemented on a single platform, since it makes it unlikely that those events will actually get used downstream. Would it be reasonably compliant to havecmd+Qsend aCloseRequestedevent to every window in the application?elliegoldstein commentedon Apr 24, 2019
@Osspial CMD+Q should also kill any background processes for the application, but I'm not sure how in-scope for Winit that is. I think sending a close to all windows would come the closest to getting the "correct" behavior.
Osspial commentedon Apr 24, 2019
@ryanisaacg I mean, if all of an application's windows are closed there isn't a whole lot you can sensibly do besides terminate the entire application and its children.
tomjakubowski commentedon Jun 23, 2019
On Mac OS, it's long been common for applications to stay open after all windows close, because of the menu bar's persistence outside of any window's lifetime.
For example, in a simple word processor, where a window corresponds to an open document, a user may close all of their documents and then want later to create a new document or open an existing one. It's possible (even likely) they'd leave the application running with no open windows, then switch to it, probably using the Dock, and finally select the appropriate thing from the menu bar to open a new window.
Describe how to adjust the JSON size limit when running the server.
Merge pull request rust-windowing#41 from tauri-apps/fix/covector