-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move QT_X11_NO_NATIVE_MENUBAR to code #4818
Conversation
|
Make a proposal. |
@jasp00 thanks for the trick, this will come in useful. For this particular setting, I recommend we remove the env and use code instead, thanks to @PhysSong's findings here: #488 (comment) |
@jasp00 |
I do not see a way to override |
I think @tresf meant void AppMenuPlatformMenuBar::createMenuBar()
{
static bool firstCall = true;
static bool envSaysNo = !qgetenv("QT_X11_NO_NATIVE_MENUBAR").isEmpty();
static bool envSaysBoth = qgetenv("APPMENU_DISPLAY_BOTH") == "1";
if (!m_menuBar->parentWidget()) {
return;
}
m_adapter = 0;
if (!firstCall && !envSaysBoth && QApplication::testAttribute(Qt::AA_DontUseNativeMenuBar)) {
return;
}
if (envSaysNo) {
if (firstCall) {
firstCall = false;
m_nativeMenuBar = NMB_DisabledByEnv;
QApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, true);
}
return;
} bool AppMenuPlatformMenuBar::isNativeMenuBar() const
{
if (m_nativeMenuBar == NMB_DisabledByEnv) {
return false;
}
if (m_nativeMenuBar == NMB_Auto) {
return !QApplication::instance()->testAttribute(Qt::AA_DontUseNativeMenuBar);
}
return m_nativeMenuBar == NMB_Enabled;
}
Something like this?
|
... but the error message is irrelevant because we should be using the API, or remove it entirely since it does nothing for Qt5. |
Okay. Now I'm fine with keeping the error message as-is. |
I'm confused. The error message wouldn't be needed if using |
@tresf I was talking about the error message we should use if we stick to |
Ready. |
Just incase Qt5 eventually honors this
Travis-CI shows failed, but that's just the Debian jobs. Appears to be failing, not related to the codebase at all. Merging. |
Set Qt::AA_DontUseNativeMenuBar Remove QT_X11_NO_NATIVE_MENUBAR from desktop launcher
Enable
QT_X11_NO_NATIVE_MENUBAR
by default. Clean up the desktop entry.