Bug 474681 - SDDM kwin_wayland ignores set screen resolution
Summary: SDDM kwin_wayland ignores set screen resolution
Status: REOPENED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: unspecified
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-19 06:52 UTC by tagwerk19
Modified: 2023-09-22 09:14 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
kscreen/output - Virtual-0 (QXL) (254 bytes, text/plain)
2023-09-22 09:00 UTC, tagwerk19
Details
kscreen/output - Virtual-1 (Virtio) (312 bytes, text/plain)
2023-09-22 09:01 UTC, tagwerk19
Details
SDDM screen - As seen when using X11 (145.91 KB, image/png)
2023-09-22 09:03 UTC, tagwerk19
Details
SDDM screen - As seen with Wayland and QXL video (109.93 KB, image/png)
2023-09-22 09:06 UTC, tagwerk19
Details
SDDM screen - As seen with Wayland and Virtio video (114.68 KB, image/png)
2023-09-22 09:07 UTC, tagwerk19
Details
User Session - After logging on with X11 (266.21 KB, image/png)
2023-09-22 09:08 UTC, tagwerk19
Details
User Session - After logging on with Wayland and Virtio Video (273.59 KB, image/png)
2023-09-22 09:11 UTC, tagwerk19
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tagwerk19 2023-09-19 06:52:17 UTC
SUMMARY:

    SDDM presents a 1024/768 logon screen on KVM guests (when set to use Wayland),
    ignoring any previously chosen screen size.

    After logon, Plasma uses the size set in System Settings > Display and Monitor.

    Originally encountered in Fedora38:

        https://bugzilla.redhat.com/show_bug.cgi?id=2196435

    but can be reproduced in Neon Unstable

STEPS TO REPRODUCE:

    Switch SDDM to use Wayland by copying:

        [General]
        DisplayServer=wayland
        GreeterEnvironment=QT_WAYLAND_SHELL_INTEGRATION=layer-shell
        InputMethod=

        [Wayland]
        CompositorCommand=kwin_wayland --no-global-shortcuts --no-lockscreen --inputmethod maliit-keyboard --locale1

    as given in
        https://bugzilla.redhat.com/show_bug.cgi?id=2196435#c1

    into
        /etc/sddm.conf

    Configure your chosen screen size, logout or reboot....

OBSERVED RESULTS:

    You get a 1024/768 size SDDM logon screen.

    (It does not seem to matter whether you are using QXL or Virtio video
    or whether you select an X11 or Wayland session.)

EXPECTED RESULTS:

    Depends.

    In a simple case with a single screen, setting the screen size in
    System Settings > Display and Monitor should set the size SDDM uses.

    Manually adding width and height to the CompositorCommand

       CompositorCommand=kwin_wayland --no-global-shortcuts --no-lockscreen --inputmethod maliit-keyboard --locale1 --width 1440 --height 900

    should (probably?) act as a workround.

SOFTWARE/OS VERSIONS

    Neon Unstable
    Plasma: 5.27.80
    Frameworks: 5.240.0
    Qt: 6.6.0

ADDITIONAL INFORMATION

    With X11, you can set the preferred mode manually by creating a

        /etc/share/X11/xorg.conf.d/50-monitor.conf

    containing:

        Section "Monitor"
               Identifier   "Virtual-0"
               Option "PreferredMode" "1440x900"
        EndSection
        Section "Monitor"
               Identifier   "Virtual-1"
               Option "PreferredMode" "1440x900"
        EndSection

    If you are using QXL video, then SDDM picks up the "Virtual-0" config,
    if Virtio then the "Virtual-1" one (although this may be shown as "Red Hat,
    Inc. QEMU Monitor" under System Settings > Display and Monitor)

    Ref: https://bugs.kde.org/show_bug.cgi?id=420169#c8
Comment 1 Zamundaaa 2023-09-19 11:26:58 UTC
You need to synchronize the user settings to sddm in the sddm settings. This is not something that's currently done automatically
Comment 2 tagwerk19 2023-09-19 20:15:54 UTC
(In reply to Zamundaaa from comment #1)
> You need to synchronize the user settings to sddm in the sddm settings. This
> is not something that's currently done automatically
In
    System Settings > Startup and Shutdown > Login Screen (SDDM) 
and
    Apply Plasma Settings?

On Neon Unstable, this inserts some "themeing" information into /etc/sddm.conf.d/kde_settings.conf. I don't think there's anything there about screen size.

If I logout/reboot, I still get the 1024/768 logon screen.

This does seem related to having "DisplayServer=wayland" (as is set in F38), reopening if that's OK....
Comment 3 Zamundaaa 2023-09-19 20:36:02 UTC
Yes. It doesn't only add theming settings to that config, but it also copies KScreen configs to the sddm user directory (so into /var/lib/sddm/.local/share/kscreen) that KWin is then supposed to pick up.
If it does copy those files for you but it still doesn't set the correct mode, then maybe something is broken specifically for virtual machines
Comment 4 tagwerk19 2023-09-19 21:11:15 UTC
(In reply to Zamundaaa from comment #3)
> ... so into /var/lib/sddm/.local/share/kscreen ...
That's cheating! It's hidden folder! 8-)

> ... If it does copy those files for you but it still doesn't set the correct mode ...
Looks like I've got two json files under
    /var/lib/sddm/.local/share/kscreen/output

The info, for both Virtual-0 and Virtual-1, looks similar to that in my:
    /etc/share/X11/xorg.conf.d/50-monitor.conf

> ... then maybe something is broken specifically for virtual machines ...
I've only tried this on VMs, so yes it could be specific. Let me try moving the VM to a different host
Comment 5 tagwerk19 2023-09-22 09:00:13 UTC
Created attachment 161794 [details]
kscreen/output - Virtual-0 (QXL)
Comment 6 tagwerk19 2023-09-22 09:01:24 UTC
Created attachment 161795 [details]
kscreen/output - Virtual-1 (Virtio)
Comment 7 tagwerk19 2023-09-22 09:03:55 UTC
Created attachment 161796 [details]
SDDM screen - As seen when using X11

Without any sddm.conf setup, maybe falling back to X
Comment 8 tagwerk19 2023-09-22 09:06:11 UTC
Created attachment 161797 [details]
SDDM screen - As seen with Wayland and QXL video

A corner of the screen anyway...
Comment 9 tagwerk19 2023-09-22 09:07:21 UTC
Created attachment 161798 [details]
SDDM screen - As seen with Wayland and Virtio video

Same corner, slightly larger logon screen...
Comment 10 tagwerk19 2023-09-22 09:08:52 UTC
Created attachment 161799 [details]
User Session - After logging on with X11

The full 1440/900 screen size...
Comment 11 tagwerk19 2023-09-22 09:11:03 UTC
Created attachment 161800 [details]
User Session - After logging on with Wayland and Virtio Video

Screen size for both X11 and Wayland has been set to 1440/900 in system settings - and seems to work
Comment 12 tagwerk19 2023-09-22 09:14:23 UTC
(In reply to tagwerk19 from comment #4)
> ... Let me try moving the VM to a different host ...
That was far messier than I had expected but I've now got a consistant setup; Fedora 38 KVM host with Fedora 38 (plus Neon Unstable) guests.

The behaviour changes and seems to point to something VM related.

    If SDDM is configured for Wayland and VM set up with QXL video, the SDDM screen is 1024/768.
    With Virtio video, the screen is "nearly" 1440/900, not full screen but the aspect ratio looks better.

I've attached the kscreen/output files and some screenshots of (corners of) the SDDM screen: With SDDM using X, with it using Wayland and QXL and Virtio video, and after logon, with X11 and Wayland Virtio.