From 730800d66068e380fe1bbb01ace8b55e367042f8 Mon Sep 17 00:00:00 2001 From: oqyude Date: Thu, 5 Nov 2026 21:17:03 +0300 Subject: [PATCH] =?UTF-8?q?sddm:=20=D0=BF=D0=BE=D1=87=D0=B8=D0=BD=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D1=82=D0=B5=D0=BC=D1=83=20WhiteSur=20=D0=BF?= =?UTF-8?q?=D0=BE=D1=81=D0=BB=D0=B5=20plasma-workspace=206.8=20(=D1=8D?= =?UTF-8?q?=D0=BA=D1=80=D0=B0=D0=BD=20=D0=B2=D1=85=D0=BE=D0=B4=D0=B0=20ryd?= =?UTF-8?q?iwo)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit plasma-workspace 6.8.1 убрал VirtualKeyboardLoader из org.kde.breeze.components, а SDDM-тема WhiteSur (whitesur-kde 2024-11-18) всё ещё его инстанцирует. Гритер не мог загрузить Main.qml: Main.qml:316:9: VirtualKeyboardLoader is not a type Fallback to embedded theme и экран входа молча деградировал до встроенной плоской заглушки. - overlays/patch-whitesur-sddm.pl: заменить VirtualKeyboardLoader на Keyboards.KWinVirtualKeyboard (API актуальной breeze-темы), сохранив интерфейс inputPanel (keyboardActive/showHide), который используется в других местах Main.qml - overlays/pkgs.nix: overlay на whitesur-kde, гоняет патч по sddm/*/Main.qml - theming.nix: включить whitesur-cursors (kwin писал `Failed to load cursor theme "WhiteSur-cursors"`) - kde.nix: sddm.extraPackages = plasma-desktop + qtsvg (требование пакета) Проверено на rydiwo (поколение 91, display-manager перезапущен): Fallback to embedded theme — 0 раз, VirtualKeyboardLoader is not a type — 0, гритер создал вью на реальном выходе (DSI-1, 1324x828). --- modules/desktop/environment/kde.nix | 8 ++++ modules/desktop/theming.nix | 3 +- overlays/patch-whitesur-sddm.pl | 62 +++++++++++++++++++++++++++++ overlays/pkgs.nix | 18 +++++++++ 4 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 overlays/patch-whitesur-sddm.pl diff --git a/modules/desktop/environment/kde.nix b/modules/desktop/environment/kde.nix index c3fb200..6cf9683 100644 --- a/modules/desktop/environment/kde.nix +++ b/modules/desktop/environment/kde.nix @@ -23,6 +23,14 @@ sddm = { enable = true; theme = "WhiteSur-light"; + # Required by the WhiteSur SDDM themes (see the note in + # pkgs/by-name/wh/whitesur-kde/package.nix): the greeter needs the + # org.kde.breeze.components QML module from plasma-desktop and qtsvg + # for the theme's SVG assets. + extraPackages = with pkgs; [ + kdePackages.plasma-desktop + kdePackages.qtsvg + ]; wayland = { enable = true; compositor = "kwin"; diff --git a/modules/desktop/theming.nix b/modules/desktop/theming.nix index a285070..8f08d65 100644 --- a/modules/desktop/theming.nix +++ b/modules/desktop/theming.nix @@ -8,8 +8,9 @@ systemPackages = with pkgs; [ #qogir-kde #qogir-theme - #whitesur-cursors qogir-icon-theme + whitesur-cursors # WhiteSur look-and-feel sets this cursor; without it + # kwin logs `Failed to load cursor theme "WhiteSur-cursors"` whitesur-gtk-theme whitesur-icon-theme whitesur-kde diff --git a/overlays/patch-whitesur-sddm.pl b/overlays/patch-whitesur-sddm.pl new file mode 100644 index 0000000..3cdab26 --- /dev/null +++ b/overlays/patch-whitesur-sddm.pl @@ -0,0 +1,62 @@ +#!/usr/bin/env perl +# +# Patch the WhiteSur SDDM theme for plasma-workspace >= 6.6. +# +# The WhiteSur theme (whitesur-kde 2024-11-18) is a fork of the breeze SDDM +# theme and instantiates `VirtualKeyboardLoader`. That type used to be exported +# by the `org.kde.breeze.components` QML module shipped in plasma-workspace, but +# it was removed in favour of the `org.kde.plasma.workspace.keyboardlayout` +# KWin virtual-keyboard integration. +# +# Without this patch sddm-greeter-qt6 fails to load Main.qml: +# Main.qml:316:9: VirtualKeyboardLoader is not a type +# Fallback to embedded theme +# and the login screen silently degrades to the plain built-in theme. +# +# Replace the loader with the same API the current breeze theme uses +# (Keyboards.KWinVirtualKeyboard), keeping the `inputPanel` object name and its +# `keyboardActive` / `showHide()` interface used elsewhere in Main.qml. +# +# Usage: perl patch-whitesur-sddm.pl sddm/*/Main.qml +use strict; +use warnings; + +my $stub = <<'STUB'; + Item { + id: inputPanel + visible: false + + readonly property bool keyboardActive: Keyboards.KWinVirtualKeyboard.visible + + function showHide() { + if (Keyboards.KWinVirtualKeyboard.visible) { + Keyboards.KWinVirtualKeyboard.active = false; + } else { + Keyboards.KWinVirtualKeyboard.forceActivate(); + } + } + } +STUB + +for my $file (@ARGV) { + open my $in, '<', $file or die "open $file: $!"; + local $/; + my $src = <$in>; + close $in; + + # Nothing to do for themes that do not use the old loader. + next if $src !~ /VirtualKeyboardLoader/; + + $src =~ s{^[ \t]*VirtualKeyboardLoader \{.*?^[ \t]*\}[ \t]*\n}{$stub}ms + or die "$file: could not locate the VirtualKeyboardLoader block\n"; + + if ($src !~ /keyboardlayout as Keyboards/) { + $src =~ s{(import org\.kde\.plasma\.plasma5support [^\n]*\n)} + {$1import org.kde.plasma.workspace.keyboardlayout as Keyboards\n} + or die "$file: could not locate the plasma5support import\n"; + } + + open my $out, '>', $file or die "write $file: $!"; + print $out $src; + close $out; +} diff --git a/overlays/pkgs.nix b/overlays/pkgs.nix index b40a4d5..e34f19f 100644 --- a/overlays/pkgs.nix +++ b/overlays/pkgs.nix @@ -5,4 +5,22 @@ self: super: { rovr = inputs.self.packages.x86_64-linux.rovr; pcbu-desktop = inputs.self.packages.x86_64-linux.pcbu-desktop; + + # The SDDM themes shipped by whitesur-kde (2024-11-18) are forks of the + # breeze greeter theme and still instantiate `VirtualKeyboardLoader`, a type + # that plasma-workspace >= 6.6 removed from org.kde.breeze.components in + # favour of the KWin virtual-keyboard integration. sddm-greeter-qt6 refuses + # to load such a theme and silently falls back to the plain embedded one: + # Main.qml:316:9: VirtualKeyboardLoader is not a type + # Fallback to embedded theme + # (seen on rydiwo). Rewrite the loader to the API the current breeze theme + # uses; see overlays/patch-whitesur-sddm.pl. + whitesur-kde = super.whitesur-kde.overrideAttrs (old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ super.perl ]; + postPatch = (old.postPatch or "") + '' + for f in sddm/*/Main.qml; do + ${super.perl}/bin/perl ${./patch-whitesur-sddm.pl} "$f" + done + ''; + }); }