summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qprocess_win.cpp2
-rw-r--r--src/plugins/platformthemes/gtk3/qgtk3theme.cpp17
-rw-r--r--src/plugins/platformthemes/gtk3/qgtk3theme.h2
3 files changed, 19 insertions, 2 deletions
diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp
index 05c9d6594c..fa9efcb1ce 100644
--- a/src/corelib/io/qprocess_win.cpp
+++ b/src/corelib/io/qprocess_win.cpp
@@ -102,7 +102,7 @@ static void qt_create_pipe(Q_PIPE *pipe, bool isInputPipe)
// ### The user must make sure to call qsrand() to make the pipe names less predictable.
// ### Replace the call to qrand() with a secure version, once we have it in Qt.
_snwprintf(pipeName, sizeof(pipeName) / sizeof(pipeName[0]),
- L"\\\\.\\pipe\\qt-%X", qrand());
+ L"\\\\.\\pipe\\qt-%lX-%X", long(QCoreApplication::applicationPid()), qrand());
DWORD dwOpenMode = FILE_FLAG_OVERLAPPED;
DWORD dwOutputBufferSize = 0;
diff --git a/src/plugins/platformthemes/gtk3/qgtk3theme.cpp b/src/plugins/platformthemes/gtk3/qgtk3theme.cpp
index 6447776f25..077955eb4e 100644
--- a/src/plugins/platformthemes/gtk3/qgtk3theme.cpp
+++ b/src/plugins/platformthemes/gtk3/qgtk3theme.cpp
@@ -153,7 +153,7 @@ bool QGtk3Theme::usePlatformNativeDialog(DialogType type) const
case ColorDialog:
return true;
case FileDialog:
- return true;
+ return useNativeFileDialog();
case FontDialog:
return true;
default:
@@ -167,6 +167,8 @@ QPlatformDialogHelper *QGtk3Theme::createPlatformDialogHelper(DialogType type) c
case ColorDialog:
return new QGtk3ColorDialogHelper;
case FileDialog:
+ if (!useNativeFileDialog())
+ return nullptr;
return new QGtk3FileDialogHelper;
case FontDialog:
return new QGtk3FontDialogHelper;
@@ -185,4 +187,17 @@ QPlatformMenuItem* QGtk3Theme::createPlatformMenuItem() const
return new QGtk3MenuItem;
}
+bool QGtk3Theme::useNativeFileDialog()
+{
+ /* Require GTK3 >= 3.15.5 to avoid running into this bug:
+ * https://bugzilla.gnome.org/show_bug.cgi?id=725164
+ *
+ * While this bug only occurs when using widget-based file dialogs
+ * (native GTK3 dialogs are fine) we have to disable platform file
+ * dialogs entirely since we can't avoid creation of a platform
+ * dialog helper.
+ */
+ return gtk_check_version(3, 15, 5) == 0;
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platformthemes/gtk3/qgtk3theme.h b/src/plugins/platformthemes/gtk3/qgtk3theme.h
index 52036680c6..abc5dbfd17 100644
--- a/src/plugins/platformthemes/gtk3/qgtk3theme.h
+++ b/src/plugins/platformthemes/gtk3/qgtk3theme.h
@@ -59,6 +59,8 @@ public:
QPlatformMenuItem* createPlatformMenuItem() const Q_DECL_OVERRIDE;
static const char *name;
+private:
+ static bool useNativeFileDialog();
};
QT_END_NAMESPACE