forked from qt-creator/qt-creator
QmlDesigner: Fix keyboard focus on mac for 3D edit view
We used LSUIElement and QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM to hide the puppet process on macOS. Unfortunately such a process cannot get any keyboard focus. Change-Id: I73ae919a6a2fd5a733e92a37541baccddc135326 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Pasi Keränen <pasi.keranen@qt.io>
This commit is contained in:
@@ -28,7 +28,5 @@ be met: https://www.gnu.org/licenses/gpl-3.0.html.</string>
|
||||
<string>qml2puppet</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.qt-project.qtcreator.qml2puppet</string>
|
||||
<key>LSUIElement</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
@@ -132,8 +132,16 @@ int main(int argc, char *argv[])
|
||||
// Since we always render text into an FBO, we need to globally disable
|
||||
// subpixel antialiasing and instead use gray.
|
||||
qputenv("QSG_DISTANCEFIELD_ANTIALIASING", "gray");
|
||||
#ifdef Q_OS_OSX //This keeps qml2puppet from stealing focus
|
||||
#ifdef Q_OS_MACOS
|
||||
// We have to parse the arguments before Q[Gui]Application creation
|
||||
// Since the Qt arguments are not filtered out, yet we do not know the position of the argument
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
const char *arg = argv[i];
|
||||
//In previewmode and rendermode we hide the process
|
||||
if (!qstrcmp(arg, "previewmode") || !qstrcmp(arg, "rendermode"))
|
||||
qputenv("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM", "true");
|
||||
// This keeps qml2puppet from stealing focus
|
||||
}
|
||||
#endif
|
||||
|
||||
//If a style different from Desktop is set we have to use QGuiApplication
|
||||
|
Reference in New Issue
Block a user