Opened 19 months ago

Last modified 9 months ago

#18518 accepted defect

wxDialog opened from taskbar popup menu option is displayed in the background only on Mac

Reported by: deepti Owned by: csomor
Priority: normal Milestone:
Component: wxOSX Version: 3.1.1
Keywords: Cc:
Blocked By: Blocking:
Patch: no



I have a wxDialog instance (with parent set to NULL). It is created on click of a popup menu option of wxTaskbarIcon instance.
On Show(), it ends up being displayed behind some other application windows that are open, and is not shown in the front. This works perfectly on Windows.

This same issue is even seen in the sample taskbar app under "samples" folder of wxWidgets. In this case, on clicking the "Restore main window" option, the dialog is not shown on top.. it sits behind some windows.
Our app has been developed very similar to this sample app.

It is very important for us to fix this issue, since our main application window never opens at the top of all windows.

Change History (7)

comment:1 Changed 19 months ago by oneeyeman

Which OSX version you are testing it on?
How did you configure wxWidgets?
What version of wxWidgets do you use? Are you able to try with Git master?

Thank you.

comment:2 Changed 10 months ago by csomor

  • Owner set to csomor
  • Status changed from new to accepted

comment:3 Changed 10 months ago by csomor

I will have to add a 'bring app to front' in an method, it is just one line, but we'll have to decide where. Just using wxTLW::Raise for this is rather not acceptable behavior under macOS,

comment:4 Changed 9 months ago by vadz

We could add some BringToFront(), of course, but, to be honest, Raise() seems the most logical to me. Of course it's a bad idea to raise the window without the user requesting it, but if somebody really wants to do it, they would call both Raise() and BringToFront() anyhow -- it's not like we could stop them. The only thing to do is to forbid this at the OS level, as MSW does...

To summarize, I think using Raise() would be simplest and not really that bad, we should just clearly document that it should only be called in response to an explicit user request.

comment:5 Changed 9 months ago by csomor

I'm not saying that people who want this behavior could not use it in an imperfect way.

But I'd like to make mis-use not the default, differentiate between bringing a frame to the front of all of the app's windows (which to me is Raise), but not messing with the application layering, or to bring the app to the front of everything ...

comment:6 Changed 9 months ago by vadz

We could have some wxApp::BringToFront() then perhaps, that would raise the main/top app window?

comment:7 Changed 9 months ago by csomor

thanks, that sound very good to me :-)

Note: See TracTickets for help on using tickets.