Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Menus&Toolbars » Menu opens, but does not close (Bug?)
Menu opens, but does not close (Bug?) [message #59882] Thu, 18 May 2023 08:17 Go to next message
peterh is currently offline  peterh
Messages: 108
Registered: November 2018
Location: Germany
Experienced Member
Hi,

see the attached image.
Sometimes the menu in applications does not close.
It happens reliably from time to time with the "Addressbook" example and the "Menu" example.

However it seems to happen randomly and preferably directly after the Application was startet.

So it could be uninitialized memory somewhere in the GUI framework. Also it could be a race condition.
(These are just my uneducated guesses. I do not know what the reason is)

I found no way to reproduce it every time, the only way is to try it 10 to 20 times.

Run the "Menu" tutorial application. Click the menu, so it opens and move the mause pointer directly to the title bar of the window and move the window.
Try this 10 to 20 times. Then it happens. From time to time the menu does not close and stays on top, while the main window is moved.
This is the most reliable way to reproduce it, but it happens from time to time, when playing around with the application under unknown circumstances.
The menu does not close until a menu item is selected or another windows app is clicked.
(To make a screenshot, I pressed Ctrl-Print, to capture the whole screen)

index.php?t=getfile&id=6803&private=0

I am on Windows 11, 64 Bit. My Upp version is 16834 nightly build.
Compiler is 64 bit CLang.

  • Attachment: Menu.png
    (Size: 12.62KB, Downloaded 220 times)

[Updated on: Thu, 18 May 2023 09:34]

Report message to a moderator

Re: Menu opens, but does not close (Bug?) [message #59883 is a reply to message #59882] Thu, 18 May 2023 13:11 Go to previous messageGo to next message
jjacksonRIAB is currently offline  jjacksonRIAB
Messages: 221
Registered: June 2011
Experienced Member
I have a similar problem to that on Linux and FreeBSD if I alt+tab. Floating windows will still remain at the top of the screen and I have to move back into their boundaries and out to make them disappear.
If it's the same problem you have you should be able to reliably reproduce it by pressing alt+tab.
Re: Menu opens, but does not close (Bug?) [message #59884 is a reply to message #59883] Thu, 18 May 2023 14:41 Go to previous messageGo to next message
peterh is currently offline  peterh
Messages: 108
Registered: November 2018
Location: Germany
Experienced Member
Seems to happen more frequently after I used Alt-Tab.

It is however not precisely reproducible.

Also, the menu in this case was not closed, when I click other applications.

I took this screenshot normally with my preferred tool (Faststone). (Which requires several mouse clicks but has the advantage, it has more features and immediately after I took the shot, I can edit it before I save it into a file.)
index.php?t=getfile&id=6804&private=0

When the menu is detached in this way, it is still functional, as if it where running in another thread.
  • Attachment: Menu2.png
    (Size: 18.60KB, Downloaded 190 times)

[Updated on: Thu, 18 May 2023 15:31]

Report message to a moderator

Re: Menu opens, but does not close (Bug?) [message #59885 is a reply to message #59884] Thu, 18 May 2023 15:49 Go to previous messageGo to next message
peterh is currently offline  peterh
Messages: 108
Registered: November 2018
Location: Germany
Experienced Member
I found a way to exactly reproduce it:

1) Invoke the menu and position the mouse over it, without pressing mouse buttons.
2) Turn the mouse wheel. (This has no visible effect here, but will generate some Windows messages)
3) position the mouse somewhere else, but not over another menu.

Then the menu stays open and is detached.
As soon as the mouse is positioned over another menu item, or a menu function is invoked, the detached menu is closed, but not sooner.

(This is not the only way, but it is the most reliable way I know to trigger the problem for debugging purposes)

[Updated on: Fri, 19 May 2023 03:03]

Report message to a moderator

Re: Menu opens, but does not close (Bug?) [message #59886 is a reply to message #59884] Thu, 18 May 2023 17:04 Go to previous message
jjacksonRIAB is currently offline  jjacksonRIAB
Messages: 221
Registered: June 2011
Experienced Member
peterh wrote on Thu, 18 May 2023 14:41
Seems to happen more frequently after I used Alt-Tab.
When the menu is detached in this way, it is still functional, as if it where running in another thread.


I seem to vaguely remember having a similar problem with my own custom popup ctrl and I couldn't find a way to get it to receive events to close itself when the parent loses focus because it gains focus when created, automatically causing the parent to lose focus; so you end up in this weird catch 22 situation where you want to close the popup when the parent window loses focus to something other than the popup window itself.

Then there's the issue of doing it reliably in a cross-platform way. It's probably going to take someone who knows the windowing system internals better than I do to fix it and I'd like to hear after they fix it how exactly they did it Very Happy
Previous Topic: Accelerators stop after popup menu due to focus
Goto Forum:
  


Current Time: Sat May 25 11:02:32 CEST 2024

Total time taken to generate the page: 0.01646 seconds