lol

Merge pull request #136071 from jtojnar/gnome-qpa

nixos/gnome: enable platform integration for Qt

authored by

Jan Tojnar and committed by
GitHub
07978cdd a97f4534

+38 -22
+9
nixos/doc/manual/from_md/release-notes/rl-2111.section.xml
··· 1088 1088 but instead use more of the YAML-specific syntax. 1089 1089 </para> 1090 1090 </listitem> 1091 + <listitem> 1092 + <para> 1093 + GNOME desktop environment now enables 1094 + <literal>QGnomePlatform</literal> as the Qt platform theme, 1095 + which should avoid crashes when opening file chooser dialogs 1096 + in Qt apps by using XDG desktop portal. Additionally, it will 1097 + make the apps fit better visually. 1098 + </para> 1099 + </listitem> 1091 1100 </itemizedlist> 1092 1101 </section> 1093 1102 </section>
+2
nixos/doc/manual/release-notes/rl-2111.section.md
··· 312 312 - Nginx will use the value of `sslTrustedCertificate` if provided for a virtual host, even if `enableACME` is set. This is useful for providers not using the same certificate to sign OCSP responses and server certificates. 313 313 314 314 - `lib.formats.yaml`'s `generate` will not generate JSON anymore, but instead use more of the YAML-specific syntax. 315 + 316 + - GNOME desktop environment now enables `QGnomePlatform` as the Qt platform theme, which should avoid crashes when opening file chooser dialogs in Qt apps by using XDG desktop portal. Additionally, it will make the apps fit better visually.
+7
nixos/modules/services/x11/desktop-managers/gnome.nix
··· 372 372 xdg.portal.enable = true; 373 373 xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; 374 374 375 + # Harmonize Qt5 application style and also make them use the portal for file chooser dialog. 376 + qt5 = { 377 + enable = mkDefault true; 378 + platformTheme = mkDefault "gnome"; 379 + style = mkDefault "adwaita"; 380 + }; 381 + 375 382 networking.networkmanager.enable = mkDefault true; 376 383 377 384 services.xserver.updateDbusEnvironment = true;
+11 -14
pkgs/development/libraries/qgnomeplatform/default.nix
··· 2 2 , lib 3 3 , fetchFromGitHub 4 4 , nix-update-script 5 + , cmake 5 6 , pkg-config 6 - , gtk3 7 + , adwaita-qt 7 8 , glib 9 + , gtk3 8 10 , qtbase 9 - , qmake 10 - , qtx11extras 11 11 , pantheon 12 12 , substituteAll 13 13 , gsettings-desktop-schemas ··· 15 15 16 16 mkDerivation rec { 17 17 pname = "qgnomeplatform"; 18 - version = "0.6.1"; 18 + version = "0.8.0"; 19 19 20 20 src = fetchFromGitHub { 21 21 owner = "FedoraQt"; 22 22 repo = "QGnomePlatform"; 23 23 rev = version; 24 - sha256 = "1mwqg2zk0sfjq54vz2jjahbgi5sxw8rb71h6mgg459wp99mhlqi0"; 24 + sha256 = "C/n8i5j0UWfxhP10c4j89U+LrpPozXnam4fIPYMXZAA="; 25 25 }; 26 26 27 27 patches = [ ··· 33 33 ]; 34 34 35 35 nativeBuildInputs = [ 36 + cmake 36 37 pkg-config 37 - qmake 38 38 ]; 39 39 40 40 buildInputs = [ 41 + adwaita-qt 41 42 glib 42 43 gtk3 43 44 qtbase 44 - qtx11extras 45 45 ]; 46 46 47 - postPatch = '' 48 - # Fix plugin dir 49 - substituteInPlace decoration/decoration.pro \ 50 - --replace "\$\$[QT_INSTALL_PLUGINS]" "$out/$qtPluginPrefix" 51 - substituteInPlace theme/theme.pro \ 52 - --replace "\$\$[QT_INSTALL_PLUGINS]" "$out/$qtPluginPrefix" 53 - ''; 47 + cmakeFlags = [ 48 + "-DGLIB_SCHEMAS_DIR=${glib.getSchemaPath gsettings-desktop-schemas}" 49 + "-DQT_PLUGINS_DIR=${placeholder "out"}/${qtbase.qtPluginPrefix}" 50 + ]; 54 51 55 52 passthru = { 56 53 updateScript = nix-update-script {
+8 -7
pkgs/development/libraries/qgnomeplatform/hardcode-gsettings.patch
··· 1 - diff --git a/common/gnomehintssettings.cpp b/common/gnomehintssettings.cpp 2 - index 9860e57..40fa6ec 100644 3 - --- a/common/gnomehintssettings.cpp 4 - +++ b/common/gnomehintssettings.cpp 5 - @@ -80,9 +80,17 @@ void gtkMessageHandler(const gchar *log_domain, 6 - GnomeHintsSettings::GnomeHintsSettings() 7 - : QObject(0) 1 + diff --git a/src/common/gnomesettings.cpp b/src/common/gnomesettings.cpp 2 + index 717cc9b..ee255ea 100644 3 + --- a/src/common/gnomesettings.cpp 4 + +++ b/src/common/gnomesettings.cpp 5 + @@ -150,10 +150,18 @@ GnomeSettingsPrivate::GnomeSettingsPrivate(QObject *parent) 6 + : GnomeSettings(parent) 8 7 , m_usePortal(checkUsePortalSupport()) 8 + , m_canUseFileChooserPortal(!m_usePortal) 9 9 - , m_gnomeDesktopSettings(g_settings_new("org.gnome.desktop.wm.preferences")) 10 10 - , m_settings(g_settings_new("org.gnome.desktop.interface")) 11 + , m_fallbackFont(new QFont(QLatin1String("Sans"), 10)) 11 12 { 12 13 + g_autoptr(GSettingsSchemaSource) schemaSource = nullptr; 13 14 + g_autoptr(GSettingsSchema) gnomeDesktopSchema = nullptr;
+1 -1
pkgs/top-level/all-packages.nix
··· 18510 18510 18511 18511 qrupdate = callPackage ../development/libraries/qrupdate { }; 18512 18512 18513 - qgnomeplatform = libsForQt514.callPackage ../development/libraries/qgnomeplatform { }; 18513 + qgnomeplatform = libsForQt5.callPackage ../development/libraries/qgnomeplatform { }; 18514 18514 18515 18515 randomx = callPackage ../development/libraries/randomx { }; 18516 18516