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

OS Menu Functions #44

Closed
slime73 opened this issue Aug 2, 2010 · 4 comments
Closed

OS Menu Functions #44

slime73 opened this issue Aug 2, 2010 · 4 comments
Labels
change Change to existing functionality

Comments

@slime73
Copy link
Member

slime73 commented Aug 2, 2010

Original report by Jasoco (Bitbucket: Jasoco, GitHub: Jasoco).


I think it would be neat if we could capture what happens when you click an option in the menubar. Like the Quit, Minimize, etc. These are OS-related menus, but should still let us decide what happens when we click them.

For instance Quit. On OS X it's under the love menu, on Windows under the icon in the title bar and is called "Close". Right now, it just quits the app outright. Shouldn't it be capturable? So we can show "Are you sure?" dialogs and save the game first, etc.

And Minimize. Well, it'd be smarter if we could detect when the game window was minimized. In case we want to pause the action so it doesn't keep playing in the background.

I guess I'm proposing some functions like love.menuOnQuit(), love.menuOnMinimize(), love.menuOnRestore(), (To go with Minimize) and on OS X, love.menuOnHide() and love.menuOnShow().

@slime73
Copy link
Member Author

slime73 commented Aug 2, 2010

Original comment by Andrzej Giniewicz (Bitbucket: giniu, GitHub: giniu).


The quit part is already done in ticket #24 iirc. Other than that, I think only minimize/restore is possible in current SDL, right? Using SDL_ActiveEvent probably? Might be nice. I'd also vote for love.minimize and love.restore callbacks (or whatever the names could be), for example to make stuff like pause the game, mute the sound and similar stuff when minimized... I don't see other uses for it though

@slime73
Copy link
Member Author

slime73 commented Aug 3, 2010

Original comment by Jasoco (Bitbucket: Jasoco, GitHub: Jasoco).


Well, those really are the only uses for the most part. When you minimize, most of the time you'll want the game to pause. Would be nice if OS X could also detect hide and show and treat them the same as minimize and restore. Would really like to capture Quit though. Since if I quit through the game interface, I can do whatever I want before the Quit command is pushed. But if I press Command+Q in OS X, or choose Quit from the menu, or Close on Windows, or Control+F4 on Windows, all standard Quit/Close commands, the game just quits. No warning the user. This seems incorrect. It should let you capture the Quit and code it how you want it to quit. To prevent accidental quitting.

Also, another thing we could capture is focus. Like when the game window becomes covered by another app window. i.e. loses front focus. This would also be useful to pause the game when you switch to Excel because your boss entered the room, or what have you.

I didn't know Quit had been resolved. I didn't see it in the list because I didn't realize the default list was not "All" issues. My fault. I am new to this system.

@slime73
Copy link
Member Author

slime73 commented Aug 3, 2010

Original comment by Bart van Strien (Bitbucket: bartbes, GitHub: bartbes).


Minimize/Restore should be doable.

@slime73
Copy link
Member Author

slime73 commented Aug 3, 2010

Original comment by Bart van Strien (Bitbucket: bartbes, GitHub: bartbes).


Just pushed love.focus (works on input focus rather than minimize).

@slime73 slime73 closed this as completed Aug 3, 2010
@slime73 slime73 added major change Change to existing functionality labels Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change Change to existing functionality
Projects
None yet
Development

No branches or pull requests

1 participant