Date: | 2015-04-24 18:07:10 (8 years 1 month ago) |
---|---|
Author: | Maarten ter Huurne |
Commit: | cb1b26e5e67d79ca9d03e85db06ec6c2e5b3557a |
Message: | Quit GMenu2X when window is closed in main screen This helps when testing on PC. I didn't bother to implement the same functionality for all dialog event loops, since that would be a lot of extra work and not necessary for the scenario that I need it for: clean exit when running under Valgrind. |
Files: |
src/gmenu2x.cpp (1 diff) src/inputmanager.cpp (1 diff) src/inputmanager.h (1 diff) |
Change Details
src/gmenu2x.cpp | ||
---|---|---|
636 | 636 | gotEvent = input.getButton(&button, wait); |
637 | 637 | } while (wait && !gotEvent); |
638 | 638 | if (gotEvent) { |
639 | if (button == InputManager::QUIT) { | |
640 | break; | |
641 | } | |
639 | 642 | for (auto it = layers.rbegin(); it != layers.rend(); ++it) { |
640 | 643 | if ((*it)->handleButtonPress(button)) { |
641 | 644 | break; |
src/inputmanager.cpp | ||
---|---|---|
275 | 275 | *button = REPAINT; |
276 | 276 | return true; |
277 | 277 | |
278 | case SDL_QUIT: | |
279 | *button = QUIT; | |
280 | return true; | |
281 | ||
278 | 282 | default: |
279 | 283 | return false; |
280 | 284 | } |
src/inputmanager.h | ||
---|---|---|
58 | 58 | ACCEPT, CANCEL, |
59 | 59 | ALTLEFT, ALTRIGHT, |
60 | 60 | MENU, SETTINGS, |
61 | REPAINT, | |
61 | // Events that are not actually buttons: | |
62 | // (not included in BUTTON_TYPE_SIZE) | |
63 | REPAINT, QUIT, | |
62 | 64 | }; |
63 | 65 | #define BUTTON_TYPE_SIZE 10 |
64 | 66 |
Branches:
install_locations
master
opkrun
packages