When m_use_mouse is 2, clicking on both the back button and a TextItem or PatchItem at the same time crashes the engine.
The attached example replaces the main menu, and uses PatchItems in Doom, Chex, and Strife, and TextItems in Heretic and Hexen. With certain resolutions, clicking only the bottom-half of the back button will crash the engine, since only that part will overlap with a Text/PatchItem.
Clicking back button that overlaps a Text/PatchItem crashes
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
- GFD
- Posts: 347
- Joined: Mon May 31, 2010 7:42 pm
- Preferred Pronouns: He/Him
- Location: Canada
- Contact:
Clicking back button that overlaps a Text/PatchItem crashes
- Attachments
-
- menudef.txt
- (615 Bytes) Downloaded 29 times
Re: Clicking back button that overlaps a Text/PatchItem cras
Closing of menu happened first, and then the game crashes on attempt to enter submenu while there is no menu at all.
I'm curious, what behavior did you expect if it doesn't crash? How should it work if two contradictory actions occurred at the same time?
I'm curious, what behavior did you expect if it doesn't crash? How should it work if two contradictory actions occurred at the same time?
Last edited by _mental_ on Wed Oct 07, 2015 3:10 am, edited 3 times in total.
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Clicking back button that overlaps a Text/PatchItem cras
Well, obviously it should NOT crash...
Re: Clicking back button that overlaps a Text/PatchItem cras
It should only do one action for one click, processing the action from the top layer and skipping any other lower layer. The back button should probably be on the bottom layer as a matter of principle, since it's something the engine adds in depending on user options and there are other ways to back out of a menu.
Re: Clicking back button that overlaps a Text/PatchItem cras
The crash itself can be fixed easily. I'm fine with the proposed behavior, however back button is drawn and (more importantly) is handled before mouse event.Gez wrote:It should only do one action for one click, processing the action from the top layer and skipping any other lower layer. The back button should probably be on the bottom layer as a matter of principle, since it's something the engine adds in depending on user options and there are other ways to back out of a menu.
I think it's not a big deal to change this order. Have no idea about side effects it may bring though.
- GFD
- Posts: 347
- Joined: Mon May 31, 2010 7:42 pm
- Preferred Pronouns: He/Him
- Location: Canada
- Contact:
Re: Clicking back button that overlaps a Text/PatchItem cras
I would say the back button should definitely be the top layer, since otherwise it may become impossible to navigate menus exclusively with the mouse. Besides, it's extremely unlikely that any element would be hidden entirely behind a back button, so this way both elements would be interactable.
Re: Clicking back button that overlaps a Text/PatchItem cras
Let's keep it simple:
- If back button is highlighted with the mouse pointer and left button is clicked, back action is triggered.
- If back button isn't highlighted and left button is clicked, menu item is activated.
