#4272 closed defect (fixed)
[PATCH] Sending Alt+F4 to a foreground window also closes 0 A.D. in the background
Reported by: | elexis | Owned by: | elexis |
---|---|---|---|
Priority: | Must Have | Milestone: | Alpha 21 |
Component: | Core engine | Keywords: | patch |
Cc: | Patch: |
Description
If 0 A.D. is running in one window and another application is running in another window on top of the 0 A. D. window, then sending an Alt+F4 signal to the foreground window closes that window, the keydown event is still sent to 0 A.D. and that application closes too (at least on ffm and my linux machine).
Every application tested other from 0 A.D. accepts the Alt+F4 only if there was a keypress for Alt+F4 (not only keydown), i.e. 0 A.D. (or SDL2?) must test whether there was a keyup
(release of the key) before.
Bug reported by ffm who uses dwm on some gnu/linux machine (I'm using ubuntu 16 with i3wm, likely doesn't matter).
Attachments (1)
Change History (5)
comment:1 by , 8 years ago
Keywords: | patch review added |
---|---|
Milestone: | Backlog → Alpha 21 |
Summary: | Sending Alt+F4 to a foreground window also closes 0 A.D. in the background → [PATCH] Sending Alt+F4 to a foreground window also closes 0 A.D. in the background |
- r7933 introduced the hotkey combination Alt+F4.
- Removing that hotkey fixes the issue. Alt+F4 closes the app unless it was sent to the app that had the focus previously.
- Since the user is actually pressing (multiple HOTKEYDOWN events) and releasing (one HOTKEYUP event), triggering these events is actually correct.
by , 8 years ago
Attachment: | fix_altf4_bug.patch added |
---|
comment:2 by , 8 years ago
The patch doesn't introduce any problems for me on Windows (the bug reported here does not happen on Windows), and I agree with the principle, so it looks good to me.
As elexis said on IRC, if the operating system does not consider that Alt+F4
should quit the application, I don't think we should try to enforce that.
comment:4 by , 8 years ago
Keywords: | review removed |
---|
- Discussed the patch with Philip in IRC on 2016-10-09
Super+Q
is the hardcoded OSX equivalent of Alt+F4 and should be removed if it is unneeded as well. That should be verified by someone with OSX though.