This week in KDE: real fake session restore

Welp, the mega-release is pretty much carved in stone now, and set for a release in four days! Lots of people have worked really hard on it for over a year, and we hope you love it! Nevertheless, I’m sure our diligent QA-obsessed users will waste no time in finding all the issues we missed, and we’ll work as hard as we can to fix them.

But once those are fixed too, the focus will eventually begin to shift once more towards features. And we have big ideas for new features to ship in Plasma 6.1 and beyond! With the architectural work done over the past year, a lot of very exciting possibilities have been unlocked. I think we’re going to see Plasma 6 as a pretty amazing springboard for next-gen stuff very quickly.

And to start things off, we have two nice new features that are landing in Plasma 6.1 already:

New Features

Even though we don’t have real session restore on Wayland yet (it’s still waiting for the protocol to be finalized), now we have the next best thing: fake session restore that simply re-opens apps you had open at the last logout and relies on them to have internally saved their own state appropriately. This works on X11 too (where apps that remember their window positions can do that as well), and it applies to all windows not covered by real session restore. As a result, now all your apps should always re-launch properly on login, rather than only the random-seeing assortment of session-restore-supporting apps re-launching on login. This feature is controlled by the existing setting that turns on or off session restore (David Edmundson, Plasma 6.1. Link)

In the Overview and Present windows effect, the way that windows are arranged is no longer configurable between two imperfect options: now there is only one layout algorithm and it’s waaaaaaay better than the old one! Windows are now arranged much more regularly and it ditches the very haphazard feeling of the old default algorithm, fixing multiple bugs causing weird window layouts including the infamous “stairway to heaven” arrangement (Yifan Zhu, Plasma 6.1. Link 1, link 2, link 3, link 4, link 5):

UI Improvements

When dragging a file or folder over another folder in Dolphin with the option turned on that opens the folder if you hold the dragged file there for a moment, the hovered folder now displays a little animation showing it open a bit (Felix Ernst, Dolphin 24.05. Link):

Headsets that report their battery status properly now benefit from a nice icon in all the places in Plasma that can show battery status (Severin Von Wnuck-Lipinski Plasma 6.1. Link)

The desktop context menu has lost its “Refresh” action which was infrequently used and did not actually fix most problems of missing icons that people might want to use it for. This makes the context menu lean and mean, and now nobody will have reason to say it’s “bloated” ever again! You can still manually refresh with F5 if needed (me: Nate Graham, Plasma 6.1. Link):

Bug Fixes

When connecting an iPhone or other Apple mobile device to your machine using a cable, and that phone has a name with an apostrophe in it (e.g. “Konqi’s iPhone”), now it works (Kai Uwe Broulik, kio-extras 24.02. Link)

Fixed the most common KWin crash on X11, which was commonly seen when the screen arrangement changed (Xaver Hugl, Plasma 5.27.11. Link)

Changing the Address, Name Style, Paper Size, or Phone Numbers settings on System Settings’ Region & Language page now actually takes effect (Timo Velten, Plasma 5.27.11. Link)

Fixed an issue that could cause the screen to turn black with only a movable cursor after switching from one virtual terminal to another one with certain graphics hardware (Jakob Petsovits, Plasma 5.27.11. Link)

Wind speed is now properly refreshed over time in forecasts provided by EnvCan in the Weather widget (Ismael Asensio, Plasma 5.27.11. Link)

Fixed a bug that could causing dragging-and-dropping Task manager icons to sometimes stop working (Fushan Wen, Plasma 6.0. Link)

KWin’s Zoom effect can now fully zoom into all areas of complex multi-screen setups (Michael VanOverbeek, KWin 6.0. Link)

A process named “ksmserver-logout-greeter” no longer shows up in your Task Manager while the logout screen is visible (Akseli Lahtinen, Plasma 6.0. Link)

Fixed a visual glitch that could cause window outlines to become slightly disconnected from their windows at certain window sizes when using certain fractional scale factors (Akseli Lahtinen, Plasma 6.0.1 Link)

Fixed a visual glitch that could cause windows on rotated displays to be briefly rotated incorrectly after becoming visible when using the “Glide” effect (Vlad Zahorodnii, Plasma 6.0.1. Link)

Fixed a case where KWin could crash when using the relatively old 340-series of NVIDIA drivers (Vlad Zahorodnii, Plasma 6.0.1. Link)

Fixed a way that Plasma could crash when manually restarted using systemd (Harald Sitter, Plasma 6.1. Link)

The shortcut chooser in the panel configuration dialog now respects your Plasma style’s color scheme as expected (Marco Martin, Frameworks 6.0. Link)

Toast-style notifications sent by Kirigami-based apps no longer visually overflow when they have a large amount of text in them (Jack Hill, Frameworks 6.0. Link)

Other bug information of note:

Performance & Technical

Improved Dolphin’s startup time by between 2% and 17% (Felix Ernst, Dolphin 24.05. Link)

Automation & Systematization

Added an autotest to ensure the proper functionality of text field context menus in QtQuick-based software (Fushan Wen, link)

…And Everything Else

This blog only covers the tip of the iceberg! If you’re hungry for more, check out https://planet.kde.org, where you can find more news from other KDE contributors.

How You Can Help

Thanks to you, our Plasma 6 fundraiser has been a crazy success! I originally thought the goal of 500 new KDE e.V. supporting members was over-optimistic, but you’ve all proven me happily wrong. We’re now up to an amazing 850 members. Thank you everyone for the confidence you’ve shown in us; we’ll try not to screw it up! 🙂 For those who haven’t donated to become members yet, spreading the wealth via this fundraiser is a great way to share the love. 🙂

If you’re a developer… sheesh, take a break for a few days. You’ve earned it!

Otherwise, visit https://community.kde.org/Get_Involved to discover other ways to be part of a project that really matters. Each contributor makes a huge difference in KDE; you are not a number or a cog in a machine! You don’t have to already be a programmer, either. I wasn’t when I got started. Try it, you’ll like it! We don’t bite!

36 thoughts on “This week in KDE: real fake session restore

  1. “I think we’re going to see Plasma 6 as a pretty amazing springboard for next-gen stuff very quickly.”

    What do you by this, do I understand correctly, that we will not have to wait long for the release of Plasma 7?

    Like

    1. @Nich What I mean is that I think the next few Plasma releases (e.g. 6.1, 6.2, 6.3, and so on) are going to include a lot of great stuff that either people have been wanting for years (catch-up) or that they didn’t even know that wanted (innovation).

      @shawnsterp note that Dolphin isn’t a part of Plasma.

      Liked by 1 person

  2. This morning I read of session restore on Windows never working properly, and I sort of felt that it was at best iffy for KDE, too. It all depends on the app supporting it correctly, which is, according to my gut, only ever the case with core apps, and even there it feels a bit bug ridden, because serializing all of the in-memory state is actually a hard problem (just because there is so much of it). On top, it is rarely at the top of a developer’s priority list, me included, given the relative benefit compared to other work they can do.

    Some more generic solution not depending on app support would be really cool. Something like checkpoint restore in user space (CRIU)… but I’m honestly not enough into this stuff to actually judge whether this makes sense.

    Like

    1. The more generic solution you’re ruminating upon is exactly what’s just been implemented!

      I don’t think it is exactly what Florian suggested since

      It’s not a smart solution, there’s nothing that brings back the exact
      same session or handles multiple windows.

      David Edmunson

      and

      fake session restore that simply re-opens apps you had open at the last logout and relies on them to have internally saved their own state appropriately

      while CRIU

      can freeze a running container (or an individual application) and checkpoint its state to disk. The data saved can be used to restore the application and run it exactly as it was during the time of the freeze.

      CRIU (https://criu.org/Main_Page)

      Like

    2. Yes, indeed. My (not so qualified) suggestion from the sideline basically boils down to:

      Take a memory snapshot of the process, write it to disk, reboot (or whatever), then load the memory back into some address space and let it run from the exact same instructions where it was before taking the snapshot. It doesn’t require a Wayland protocol or any app or library support.

      Unfortunately, there are 500 details to get right about file descriptors, memory mappings, sockets and other kernel state, but there is at least a decent chance of getting there, contrary to implementing session management in all past, present and future programs correctly, which includes stuff never built to run under KDE or Gnome or any other compositor implementing the Wayland session management protocol (think WINE, or Java, or .Net).

      Just to be clear, it’s a very long shot for an ideal future, I am not expecting anyone to actually implement it, and I am thankful for every bit of more consistent session handling! (and all the other cool features we get from you guys 😉 )

      Like

    3. If we’re going to implement something fiddly, it might as well be a real session restore governed by a standard protocol, or else we’ll be fighting weird bugs forever. I do understand that this isn’t ideal for a different reason–because it requires apps to opt in–but experience shows that this is ultimately better than trying to be smart with apps and doing things to them they they don’t expect. Then you end up with weird bugs caused by apps doing things that are unusual, and work normally, but break in your weird special environment.

      Like

  3. On the topic of sessions: will it at some point be possible to have multiple Plasma sessions active for the same user, such that one can have a local session, and also simultaneously one or more remote (VNC) sessions?

    So far I have been using an XFCE session for remote access, but installing another desktop environment clogs up menus with duplicate apps for everything.

    Liked by 1 person

  4. Nate,

    Okay, and Plasma 7, can it come out in the next few years, or again only in 10 years?
    Are there any further design changes planned for Plasma 6.1, 6.2?
    And this year, will there be 1 more update, or 3 in total?
    It seems to me that 2 is better than 3, and it is desirable that in the future updates will be released in spring and autumn to synchronize releases with distributions
    Thanks

    Like

    1. The Plasma main version corresponds to the used Qt version: Plasma 5 -> Qt5, Plasma 6 -> Qt6, Plasma 7 -> Qt7

      That means it will be released some time after Qt7 will have been released, which is yet not even on the horizon.

      Like

    2. Yes, so far the Plasma version number is just the Qt version number, so it tells you what version of Qt Plasma was built with. There are discussions about de-coupling this, so that potentially we could have a Plasma 7 in 2 or 3 years, then a Plasma 8 2 or 3 years after that, and so on. But it’s just a discussion right now; nothing has been decided.

      Like

    1. AFAIK there is currently no way to get Plasma 6.0 on Ubuntu, other than building it yourself (including Qt 6.6!) with kdesrc-build (that’s what I did btw.). It is even uncertain if there will be a PPA with Plasma 6.0 in upcoming 24.04, since there is still no upload of Qt 6.6.x, and feature freeze is approaching in a few days.

      So if you don’t want to build yourself, you need to use another distro to get Plasma 6.0 (Neon Stable is most similar to Ubuntu).

      Like

  5. When distros roll out packages for major Plasma updates, how can we identify and cleanup old dependencies that are needed no more?

    Like

  6. Can not wait to play with this in KDE neon!

    I’m also happy to see that there was a fix to accommodate the old 340-series of NVIDIA drivers because I intend to upgrade my friend’s iMac to Plasma 6.

    Liked by 1 person

  7. Hello! Could you please tell me how configure touchpad gestures with the new wayland session? I previously use libinput-gestures but now they seem conflicting. Any config files?

    Like

  8. I definitely can’t live without these:

    swipe up 3 xdotool key Home
    swipe down 3 xdotool key End
    swipe left 3 xdotool key alt+Right
    swipe right 3 xdotool key alt+Left
    swipe left_up 3 xdotool key F5
    swipe right_up 3 xdotool key ctrl+t

    😦

    Like

    1. Then feel free to continue using the X11 session, where 3rd-party customizable touchpad gestures and xdotool are still supported.

      Like

  9. Oh wow! I thought it was irreversible… thank you very much! I’m an idiot 🙂

    Could you also tell is there an approximate date when gestures configuration will be available? Next major update or it could be implemented in 6.0 series? Thank you!

    Like

    1. I would expect it to be sometime within the Plasma 6 series, but beyond that, I can’t make a more specific prediction, sorry.

      Like

  10. I found all of the glitches that people have mentioned HOWEVER this is the most amazing technological leap from the KDE developers, I’m so blown away! There’s so much more that’s right than what’s wrong, and now my Wayland session now works perfectly, kudos!

    Liked by 1 person

    1. Okay this is all under KDE neon user edition…

      • the restart and shutdown items in the app launcher didn’t work so I had to issue a sudo reboot from Konsole
      • pressing Meta-L to lock the desktop made my screen go black and I had to blindly type my password to get back to the desktop
      • invoking Krunner doesn’t work unless I first started it from the command line
      • some windows appeared with very small dimensions initially
      • the font I use in Konsole, “Inconsolata”, did not appear to render correctly, with partially overlapping glyphs, whereas it never had this issue before; after tinkering, I discovered that I had to turn off this option: Edit Current Profile -> Appearance -> Complex Text Layout -> ASCII characters. I never even knew what that was until now)
      • Juk crashes when indexing music with an assert (ASSERT failure in QList::operator[]: “index out of range”, file /usr/include/x86_64-linux-gnu/qt6/QtCore/qlist.h, line 436)
      • Dragon would appear but wouldn’t play videos (had to remove phonon4qt5 & phonon4qt5-backend-vlc and then install qt6-phonon-backend-vlc)
      • Spectacle was grabbing part of itself when I told it to capture the active window, but I haven’t been able to reproduce this

      That’s about it. But yeah, just small stuff. There is so much amazing work here, I’m really stoked! And now my Wayland works flawlessly where it did not for all of 5.27. Everything even feels snappier, so I’m very happy 😊

      Like

    2. Yeah, I had a feeling. 1, 3, and 7 are Neon packaging bugs that you won’t see in other distros, unfortunately (or fortunately?).

      2 is troubling and we have scattered reports of it, but no one can reproduce it yet. Do you have NVIDIA hardware?

      4 is a side effect of stored window sized being reset. So, a pre-existing issue, but one we should fix anyway. Can you provide a list of which windows were affected? This needs to be fixed on a window-by-window basis.

      Not sure about 6, 7, and 8.

      Liked by 1 person

    3. Yes, it looks like the neon packaging bugs are worked out as of today–no issues after I did an update.

      2 is troubling and we have scattered reports of it, but no one can reproduce it yet. Do you have NVIDIA hardware? …

      Yes, I do, but it’s a laptop with integrated Radeon graphics and that’s what I’ve been using; I can’t get Nvidia working right now. I’ll try to narrow it down.

      4 is a side effect of stored window sized being reset. So, a pre-existing issue, but one we should fix anyway. Can you provide a list of which windows were affected? This needs to be fixed on a window-by-window basis.

      Ugh. Because it happened right after I rebooted into 6.0 and I was so keen to see what was new, I wasn’t paying a huge amount of attention to which window was small. I just stretched them back out and moved on. I believe Konsole and Kate were affected, but I’m not confident. And since I’m not on Btrfs disk, so I can’t go back and replay the install, sorry :/

      Not sure about 6, 7, and 8.

      That’s okay, I’ll report them as bugs.

      Like

Leave a reply to Florian Cancel reply