Blame SOURCES/qt-everywhere-opensource-src-4.8.5-do-not-close-apps-on-gnome-shutdown-dialog.patch

1b28bb
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
1b28bb
index acb115f..5316c40 100644
1b28bb
--- a/src/gui/kernel/qapplication.cpp
1b28bb
+++ b/src/gui/kernel/qapplication.cpp
1b28bb
@@ -3525,21 +3525,24 @@ void QApplication::commitData(QSessionManager& manager )
1b28bb
 {
1b28bb
     emit commitDataRequest(manager);
1b28bb
     if (manager.allowsInteraction()) {
1b28bb
-        QWidgetList done;
1b28bb
-        QWidgetList list = QApplication::topLevelWidgets();
1b28bb
-        bool cancelled = false;
1b28bb
-        for (int i = 0; !cancelled && i < list.size(); ++i) {
1b28bb
-            QWidget* w = list.at(i);
1b28bb
-            if (w->isVisible() && !done.contains(w)) {
1b28bb
-                cancelled = !w->close();
1b28bb
-                if (!cancelled)
1b28bb
-                    done.append(w);
1b28bb
-                list = QApplication::topLevelWidgets();
1b28bb
-                i = -1;
1b28bb
+        const QString desktopEnv = qgetenv("XDG_CURRENT_DESKTOP");
1b28bb
+        if (!desktopEnv.startsWith(QLatin1String("GNOME"))) {
1b28bb
+            QWidgetList done;
1b28bb
+            QWidgetList list = QApplication::topLevelWidgets();
1b28bb
+            bool cancelled = false;
1b28bb
+            for (int i = 0; !cancelled && i < list.size(); ++i) {
1b28bb
+                QWidget* w = list.at(i);
1b28bb
+                if (w->isVisible() && !done.contains(w)) {
1b28bb
+                    cancelled = !w->close();
1b28bb
+                    if (!cancelled)
1b28bb
+                        done.append(w);
1b28bb
+                    list = QApplication::topLevelWidgets();
1b28bb
+                    i = -1;
1b28bb
+                }
1b28bb
             }
1b28bb
+            if (cancelled)
1b28bb
+                manager.cancel();
1b28bb
         }
1b28bb
-        if (cancelled)
1b28bb
-            manager.cancel();
1b28bb
     }
1b28bb
 }
1b28bb