Clicking back button that overlaps a Text/PatchItem crashes

Bugs that have been investigated and resolved somehow.

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.
Post Reply
User avatar
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

Post by GFD »

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.
Attachments
menudef.txt
(615 Bytes) Downloaded 29 times
_mental_
 
 
Posts: 3820
Joined: Sun Aug 07, 2011 4:32 am

Re: Clicking back button that overlaps a Text/PatchItem cras

Post by _mental_ »

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?
Last edited by _mental_ on Wed Oct 07, 2015 3:10 am, edited 3 times in total.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
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

Post by Graf Zahl »

Well, obviously it should NOT crash...
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Clicking back button that overlaps a Text/PatchItem cras

Post by Gez »

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.
_mental_
 
 
Posts: 3820
Joined: Sun Aug 07, 2011 4:32 am

Re: Clicking back button that overlaps a Text/PatchItem cras

Post by _mental_ »

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.
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.
I think it's not a big deal to change this order. Have no idea about side effects it may bring though.
User avatar
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

Post by GFD »

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.
_mental_
 
 
Posts: 3820
Joined: Sun Aug 07, 2011 4:32 am

Re: Clicking back button that overlaps a Text/PatchItem cras

Post by _mental_ »

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.
And no crashes, of course. Easy to fix and no potential side effects. Here is the pull request.
Post Reply

Return to “Closed Bugs [GZDoom]”