From e94d1c91e9eaf92b5b33a1dbff89dc72ff1e8cce Mon Sep 17 00:00:00 2001 From: Javier Serrano Polo Date: Mon, 11 Feb 2019 20:03:50 +0100 Subject: [PATCH] Move QT_X11_NO_NATIVE_MENUBAR to code (#4818) Set Qt::AA_DontUseNativeMenuBar Remove QT_X11_NO_NATIVE_MENUBAR from desktop launcher --- cmake/linux/lmms.desktop | 2 +- src/core/main.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/linux/lmms.desktop b/cmake/linux/lmms.desktop index 4f8000d29..2ef4c8148 100644 --- a/cmake/linux/lmms.desktop +++ b/cmake/linux/lmms.desktop @@ -8,7 +8,7 @@ Comment=Music sequencer and synthesizer Comment[ca]=Producció fàcil de música per a tothom! Comment[fr]=Production facile de musique pour tout le monde ! Icon=lmms -Exec=env QT_X11_NO_NATIVE_MENUBAR=1 lmms %f +Exec=lmms %f Terminal=false Type=Application Categories=Qt;AudioVideo;Audio;Midi; diff --git a/src/core/main.cpp b/src/core/main.cpp index a71461799..cc9cb4f2a 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -252,6 +252,10 @@ int main( int argc, char * * argv ) return EXIT_FAILURE; } #endif +#ifdef LMMS_BUILD_LINUX + // don't let OS steal the menu bar. FIXME: only effective on Qt4 + QCoreApplication::setAttribute( Qt::AA_DontUseNativeMenuBar ); +#endif #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #endif