wxDialog is displayed in the background only on Mac
wxDialog is displayed in the background only on Mac
Hi,
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.
I had brought up this issue earlier as well. But haven't found a solution yet.
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.
So, is this issue solvable?
Setting the flag to wx_STAY_ON_TOP solves the problem, but will not be so useful, since there are other UI options and on click of these options, newer wxDialog instances need to be displayed on top of the first.
Please help!
1. wx version is 3.1.1 (issue is seen even on 3.1.0)
2. OS is Mac High Sierra 10.12
3. wx was configured using the following command:
./configure --disable-shared --enable-unicode --with-libjpeg=builtin --with-libpng=builtin --with-cocoa CXXFLAGS="-std=c++11 -stdlib=libc++ " OBJCXXFLAGS="-std=c++11 -stdlib=libc++" LDFLAGS="-stdlib=libc++"
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.
I had brought up this issue earlier as well. But haven't found a solution yet.
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.
So, is this issue solvable?
Setting the flag to wx_STAY_ON_TOP solves the problem, but will not be so useful, since there are other UI options and on click of these options, newer wxDialog instances need to be displayed on top of the first.
Please help!
1. wx version is 3.1.1 (issue is seen even on 3.1.0)
2. OS is Mac High Sierra 10.12
3. wx was configured using the following command:
./configure --disable-shared --enable-unicode --with-libjpeg=builtin --with-libpng=builtin --with-cocoa CXXFLAGS="-std=c++11 -stdlib=libc++ " OBJCXXFLAGS="-std=c++11 -stdlib=libc++" LDFLAGS="-stdlib=libc++"
Re: wxDialog is displayed in the background only on Mac
Hi,
What type of dialog is it - a custom one or a standard one?
Also - why do you need a non-modal dialog? It is better to use wxFrame for it...
Thank you.
What type of dialog is it - a custom one or a standard one?
Also - why do you need a non-modal dialog? It is better to use wxFrame for it...
Thank you.
Re: wxDialog is displayed in the background only on Mac
Hi @ONEEYEMAN,
Thank you for your response.
It is a custom dialog derived from wxDialog.
I just tried it with wxFrame and it still does not work, unless the wxSTAY_ON_TOP attribute is used.
And the behavior is the same in the sample app under "samples" as well.
Is there any other way to go about this, without using the wxSTAY_ON_TOP ?
Thank you for your response.
It is a custom dialog derived from wxDialog.
I just tried it with wxFrame and it still does not work, unless the wxSTAY_ON_TOP attribute is used.
And the behavior is the same in the sample app under "samples" as well.
Is there any other way to go about this, without using the wxSTAY_ON_TOP ?
Re: wxDialog is displayed in the background only on Mac
Hi,
Try to rebuild the library and pass the option "--with-macosx-version-min=10.9" (without quotes).
After rebuilding try to replicate it inside the dialogs sample.
Thank you.
Try to rebuild the library and pass the option "--with-macosx-version-min=10.9" (without quotes).
After rebuilding try to replicate it inside the dialogs sample.
Thank you.
Re: wxDialog is displayed in the background only on Mac
Hi @ONEEYEMAN,
thank you for your response.
That option should go into the ./configure command, am i correct ?
Thanks in advance.
thank you for your response.
That option should go into the ./configure command, am i correct ?
Check whether the issue resolves in the sample taskbar app - is this what you imply?After rebuilding try to replicate it inside the dialogs sample.
Thanks in advance.
Re: wxDialog is displayed in the background only on Mac
Hi,
Yes, this is correct. That's why I said - rebuuild the library.
Yes - whatever sample you used for testing before.
Re: wxDialog is displayed in the background only on Mac
Hello @ONEEYEMAN,
I did try with the option "--with-macosx-version-min=10.9".
However, there is no change in behavior.
I recall having solved a similar issue even with Electron app, only on Mac.
The Electron app's window just would not be shown on top, until the following logic was written in the app.
if (process.platform == 'darwin') {
mainWindow.setAlwaysOnTop(true, "floating", 5);
mainWindow.setVisibleOnAllWorkspaces(true);
mainWindow.setFullScreenable(false);
}
The last parameter in "setAlwaysOnTop" indicates the number of other windows that can be open underneath. If 6 other windows/apps are open and then my Electron app is open, it will still not show it on top (since the parameter has been set to 5 above).
I observed a somewhat similar behavior even with the wxWidgets app. If there is one other window open, my app and the sample app still do show up on top. But if there are 2 or more other windows already open, then my app goes underneath them.
Do we have something similar to "setAlwaysOnTop" in wxWidgets?
I did try with the option "--with-macosx-version-min=10.9".
However, there is no change in behavior.
I recall having solved a similar issue even with Electron app, only on Mac.
The Electron app's window just would not be shown on top, until the following logic was written in the app.
if (process.platform == 'darwin') {
mainWindow.setAlwaysOnTop(true, "floating", 5);
mainWindow.setVisibleOnAllWorkspaces(true);
mainWindow.setFullScreenable(false);
}
The last parameter in "setAlwaysOnTop" indicates the number of other windows that can be open underneath. If 6 other windows/apps are open and then my Electron app is open, it will still not show it on top (since the parameter has been set to 5 above).
I observed a somewhat similar behavior even with the wxWidgets app. If there is one other window open, my app and the sample app still do show up on top. But if there are 2 or more other windows already open, then my app goes underneath them.
Do we have something similar to "setAlwaysOnTop" in wxWidgets?
Re: wxDialog is displayed in the background only on Mac
Can someone please help me with this issue please ?
Re: wxDialog is displayed in the background only on Mac
Did you build an application bundle?
https://wiki.wxwidgets.org/WxMac-specif ... ion_bundle
If yes and if it happens with an unmodified sample, please open a bug report at http://trac.wxwidgets.org
https://wiki.wxwidgets.org/WxMac-specif ... ion_bundle
If yes and if it happens with an unmodified sample, please open a bug report at http://trac.wxwidgets.org
Use the source, Luke!
Re: wxDialog is displayed in the background only on Mac
Hi @doublemax,
The application bundle is in place and it's been working for many years now.
It happens even with the sample taskbar app. So, will need to raise a ticket for this.
Thank you for your reply.
The application bundle is in place and it's been working for many years now.
It happens even with the sample taskbar app. So, will need to raise a ticket for this.
Thank you for your reply.
Re: wxDialog is displayed in the background only on Mac
Hi @doublemax,
I have opened the ticket https://trac.wxwidgets.org/ticket/18518
But could you give me an idea of a timeline for the resolution? Depending on that we could decide whether i should wait for the fix, or go ahead with a work-around.
Thank you again!
I have opened the ticket https://trac.wxwidgets.org/ticket/18518
But could you give me an idea of a timeline for the resolution? Depending on that we could decide whether i should wait for the fix, or go ahead with a work-around.
Thank you again!
Re: wxDialog is displayed in the background only on Mac
Impossible to tell. Anywhere from a week to never. Especially since there are few people working on OSX.But could you give me an idea of a timeline for the resolution?
Use the source, Luke!