File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -92,14 +92,21 @@ inline bool createAppRunHook(appdir::AppDir &appDir) {
92
92
return false ;
93
93
}
94
94
95
+ // Old Qt versions only ship gtk2, new versions only gtk3. No Qt version had both.
96
+ const bool haveGtk3 = bf::exists (appDir.path () / " usr/plugins/platformthemes" / " libqgtk3.so" );
97
+
95
98
ofs << " # generated by linuxdeploy-plugin-qt" << std::endl
96
99
<< std::endl
97
- << " # try to make Qt apps more \" native looking\" , if possible" << std::endl
98
- << " # see also https://github.com/AppImage/AppImageKit/issues/977#issue-462374883" << std::endl
99
- << " # and https://github.com/AppImage/AppImageKit/issues/977#issue-462374883" << std::endl
100
+ << " # try to make Qt apps more \" native looking\" on Gtk-based desktops, if possible" << std::endl
101
+ << " # on other desktops, use the XDG Desktop Portal plugin instead to get native dialogs" << std::endl
102
+ << " # see https://github.com/AppImage/AppImageKit/issues/977#issue-462374883" << std::endl
103
+ << " # and https://github.com/linuxdeploy/linuxdeploy-plugin-qt/pull/63" << std::endl
100
104
<< " case \" ${XDG_CURRENT_DESKTOP}\" in" << std::endl
101
105
<< " *GNOME*|*gnome*|*XFCE*)" << std::endl
102
- << " export QT_QPA_PLATFORMTHEME=gtk2" << std::endl
106
+ << " export QT_QPA_PLATFORMTHEME=" << (haveGtk3 ? " gtk3" : " gtk2" ) << std::endl
107
+ << " ;;" << std::endl
108
+ << " *)" << std::endl
109
+ << " export QT_QPA_PLATFORMTHEME=xdgdesktopportal" << std::endl
103
110
<< " ;;" << std::endl
104
111
<< " esac" << std::endl;
105
112
You can’t perform that action at this time.
0 commit comments