Skip to content

Welcome to Planet KDE

This is a feed aggregator that collects what the contributors to the KDE community are writing on their respective blogs, in different languages

Saturday, 12 October 2024

Here’s an overview of recent work around Android platform support for KDE Frameworks and KDE applications, most of which is a direct result of discussions and work at Akademy and the Matrix conference.

Notification permission fixes

Porting Itinerary and NeoChat to use the KNotification permission API identified two issues around permission checks and callbacks on permission changes that resulted in the application seeing the wrong permission state. That’s fixed now.

Retirement of the Qt 5 CI

With the 24.08 KDE Gear release all our Android apps are based on Qt 6, including their stable release branches. We have therefore started with retiring the Android Qt 5 CI/CD infrastructure, which should save us both maintenance and computing resources.

As Qt 5 is meanwhile lagging behind several Android SDK versions it’s no longer a viable platform for producing APKs that work on up-to-date devices anymore anyway.

Android CI has meanwhile been removed from the KDE Frameworks 5 maintenance branches as well as from a few other libraries that still used it. The removal of Gitlab CI templates, Craft caches and container images will follow.

In particular this means the invent-registry.kde.org/sysadmin/ci-images/android-qt515 container image is deprecated and will be removed eventually. Please get in touch if you are still using this externally. Poppler’s CI was such a case for example.

QML file installation

The QML module macros in ECM used to install QML files to disk, besides bundling those via the Qt resource system as well. While that is still needed on most platforms due to some specific code in Kirigami, it’s unnecessary on Android where we rely solely on the bundled data.

This resulted in unnecessary content in the APKs, which has been fixed and makes all our APKs a bit smaller now.

Translation lookup order

The probably most visible change is a fix for a long standing bug in KI18n’s multi-language fallback lookup order, which would result in applications showing a wild mix of languages under certain conditions.

This happened when the primary device language was set to English but the country to anything but the US or the UK and one or more secondary languages were also selected. While not strictly limited to Android, there’s two factors that made it particularly prone to happen there:

  • Newer Android versions allow language and country to be set fully independently, while on many other systems only certain predefined combinations are available.
  • The language setting doesn’t just impact application translations but also text input, so many more users have multiple languages configured.

KI18n first looks for a translation for the specific language/country pair and then just the language, before falling back to the next configured language/country pair. If no translation is found it’ll eventually use the English/US source text.

Conceptually this is not wrong, but the implementation missed the fact that there is no “country-less” English translation but only the English/US source text. A configuration of English/Canada and French/Canada therefore previously resulted in a French translation rather than an English one, as it does now.

This has been backported and should be available in all our APKs with 24.08.2 latest.

Runtime language change

Thanks to input from Fabian during Akademy there’s also significant progress on having applications react to system language changes at runtime.

This basically consists of three parts:

  • Propagate the native Android system configuration change to Qt, done in Qt CR 596175.
  • Reset cached values inside KI18n on system language changes, done in KI18n MR 124.
  • Trigger QML binding re-evaluation for i18n() calls on language changes, implemented in KI18n MR 127.

With those three changes applied and a few lines adjusted in the application code to make use of this large parts of the UI already follow system language changes automatically.

It’s far not perfect yet, as there’s more things that need to update in this case than just translated strings. Date/time formatting for example, as discussed in QTBUG-129727. But overall this is already much better than what I had expected and assumed to be feasible with realistic effort.

Dark mode support

As reported previously we have working support for dark mode since 24.08.1, thanks to Julius’ work on icon recoloring.

So far this required minimal changes to applications to enable it though. That has also been fixed, dark mode support is now automatically enabled for all applications using the Breeze style.

Outlook

There’s still more to do regarding Android platform integration. I’d say the two probably most pressing issues are the following:

  • On some devices the font size is unusably small, caused by the display scale factor being wrong. Based on some investigation during Akademy the current working theory is that this is a race condition in Qt’s code reading that information. I have no device/setup that reproduces this problem unfortunately.
  • Selecting files in the platform file dialog that are located on a cloud storage such as Nextcloud silently fails. That is, to the application selecting such a file looks as if the user had canceled the dialog. Here we know exactly why this happens (it’s explicit code in Qt doing this, for valid reasons), the challenge is rather to find a proper solution.

If you are interested in Android integration for KDE applications, feel free to join us in the #kde-android Matrix channel!

And I’d say it’s a pretty good release! As with all large sets of changes, there are a couple of regressions we’re tracking, particularly around the areas of external monitor brightness and multi-screen performance. They are being actively investigated. Other than those, so far all the issues have been fairly minor, requiring people to jump through various hoops to experience them. We’re still working on fixing them, of course! I’ll be writing up another post soon on these issues, discussing how they snuck into the final release, and what we can learn from the experience.

But in the meantime, here’s the Plasma team’s work from this week:

Notable UI Improvements

Removed some unintentional extra padding around everything on System Settings’ Touchpad page (me: Nate Graham, Plasma 6.2.1. Link):

Notable Bug Fixes

Fixed a regression in Plasma that caused pop-ups of widgets on a Plasma panel to get positioned partially off screen, but only if their parent panel was very small and positioned against on the left or top screen edge (Niccolò Venerandi, Plasma 6.2.1. Link)

Fixed a regression in the new “control all screens’ brightness” feature that caused the brightness slider for external screens to get duplicated with certain screens (Jakob Petsovits, Plasma 6.2.1. Link)

Fixed two minor window focus regressions caused by an intentional change in KWin’s multi-monitor focus behavior (Vlad Zahorodnii, Plasma 6.2.1. Link 1 and link 2)

Fixed a porting regression that caused the virtual desktop switcher OSD to not appear when it should have (Vlad Zahorodnii, Plasma 6.2.1. Link)

Fixed a porting regression that caused the first entry in the clipboard to temporarily not be removable after editing it (Fushan Wen, Plasma 6.2.1. Link)

Fixed a porting regression that caused auto-mounted encrypted disks to mount normally as expected, but not show up correctly in Plasma’s Disks & Devices widget (Bohdan Onofriichuk, Plasma 6.2.1. Link)

Fixed three Plasma crashes affecting the System Tray and Disks & Devices widget under various circumstances (Fushan Wen, Plasma 6.2.1. Link 1, link 2, and link 3)

Fixed a case where Plasma could crash in brightness-related code (Jakob Petsovits, Plasma 6.2.1. Link)

Fixed a bug in our KPipeWire library (which lives in Plasma) that caused screen recordings in Spectacle using the default VP9 video codec to be cut off at the end on slower systems (Arjen Hiemstra, Plasma 6.2.1. Link)

Fixed a bug that caused configuration pages of System Monitor widgets to not be scrollable when needed (Arjen Hiemstra, Plasma 6.2.1. Link)

Fixed an unusual bug that caused the system to fail to log out within the first 50 seconds after logging in, but only when the splash screen was disabled (David Edmundson, Plasma 6.2.1. Link 1 and link 2)

System Settings’ Wallpapers page now has a visible title as expected (Méven Car, Plasma 6.2.1. Link)

The Baloo file indexer service no longer tries to pointlessly index the content of .obj 3D model files (Someone going by the pseudonym “Archaeopteryx Lithographica”, Frameworks 6.8. Link)

Other bug information of note:

Performance & Technical

Further optimized Discover’s launch speed (Aleix Pol Gonzalez, Plasma 6.3.0 Link)

How You Can Help

If you’re a developer, work on fixing Plasma 6.2 regressions!

If you’re an enthusiastic user, don’t sweat them and upgrade anyway. It’s a fantastic release.

Otherwise, visit https://community.kde.org/Get_Involved to discover additional 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! Or consider donating instead! That helps too.

Friday, 11 October 2024

Let’s go for my web review for the week 2024-41.


Why I use KDE

Tags: tech, kde, foss, ux

Looks like we properly live by the “simple by default, powerful when needed” tagline. Now there are also challenges, this article gives a nice balanced view.

https://www.osnews.com/story/140538/why-i-use-kde/


It’s Not Easy Being Green: On the Energy Efficiency of Programming Languages

Tags: tech, programming, performance, energy

Nice paper which debunks the choice of the language as an important factor for energy efficiency. The previous papers had a too simple model, this one puts forth a more complete causal model. There are many factors at play regarding energy efficiency, the programming language itself is not really one of them.

https://arxiv.org/abs/2410.05460


Google’s new phones can’t stop phoning home

Tags: tech, google, android, surveillance

It’s really time to get as many people as possible out of those toxic ecosystems…

https://pluralistic.net/2024/10/08/water-thats-not-wet/#pixelated


It’s Time to Stop Taking Sam Altman at His Word - The Atlantic

Tags: tech, ai, machine-learning, gpt, business, scam

Indeed, we should stop listening to such people who are basically pushing fantasies in order to raise more money.

https://www.theatlantic.com/technology/archive/2024/10/sam-altman-mythmaking/680152/


The Static Site Paradox

Tags: tech, web, self-hosting, complexity

Excellent point, we made the web too complex for regular users. This is actually an issue in term of access and democracy for people to write content there.

https://kristoff.it/blog/static-site-paradox/


HTML for People

Tags: tech, web, html, self-hosting

There is hope! Nice intro for regular people who want to get into publishing a web site. Good way to bring some democracy back to the web.

https://htmlforpeople.com/


A modest critique of Htmx

Tags: tech, web, frontend, htmx

I don’t think I would side with the conclusion. It’s a worthwhile article to get a better idea of the pain points around htmx.

https://chrisdone.com/posts/htmx-critique/


My Wayland Your Wayland Our Wayland

Tags: tech, linux, wayland, foss, governance

Yes, the governance of Open Source projects can be tricky. This is part of the job though, and properly embraced we all go further. An example from the Wayland space.

https://www.supergoodcode.com/My-Wayland-Your-Wayland-Our-Wayland/


Modern PATH environment variable

Tags: tech, unix, system

Indeed, we should likely revisit what we put in our PATH environment variable. Some of it is old cruft which is now unnecessary.

https://blog.izissise.net/posts/env-path/


Iterating through matched characters in modern C++: views::filter and coroutine

Tags: tech, c++, coroutine, performance

Several ways to deal with the task, which are the performance implications? Clearly coroutines aren’t the best tool for the job here.

https://lemire.me/blog/2024/10/06/iterating-through-matched-characters-in-modern-c-viewsfilter-and-coroutine/


Approaches to concurrent programming

Tags: tech, multithreading

This is a neat broad introduction about the problems you will encounter when multiple threads are involved and how to approach them.

https://underlap.org/approaches-to-concurrent-programming


Why You Shouldn’t Forget to Optimize the Data Layout

Tags: tech, cpu, performance, memory

Data layout is essential for performance reasons. It is too often overlooked. If you want real speed you need to help the memory subsystem.

https://cedardb.com/blog/optimizing_data_layouts/


Building Real-Time Global Illumination

Tags: tech, gpu, graphics, shader

Another good tutorial about global illumination. Make sure to read part 2 as well.

https://jason.today/gi


Transforming colors with matrices

Tags: tech, colors, shader

Neat little introduction on color manipulation using matrices. Mentions the things to pay attention to.

https://lisyarus.github.io/blog/posts/transforming-colors-with-matrices.html


The Data Visualisation Catalogue

Tags: tech, data-visualization

Nice catalogue of ideas for data visualisation tasks.

https://datavizcatalogue.com/


This Post Is Not About Python

Tags: tech, tech-lead, engineering, decision-making

Nice post, and indeed it’s not about Python if you read until the end. It shows that it’s important to be able to make informed choices and not just pick your tech stack based on knee-jerk reactions.

https://jerf.org/iri/post/2024/not_about_python/


Put business logic in the application, not the database

Tags: tech, databases, design, performance

I’m not sure I’m sold on this one. Interesting food for thought but I’ll have to mull it over for a while I think. I’m concerned about the performance implications of querying like this.

https://www.infoworld.com/article/2269523/put-business-logic-in-the-application-not-the-database.html


Understanding and effectively mitigating code review anxiety

Tags: tech, codereview, psychology, cognition, anxiety, research

Still very early days on this topic, clearly more studies are required. Still this one is interesting and indicates are clear link between code review anxiety and code review avoidance. If you’re often procrastinating or rubber stamping code reviews, a workshop to reduce biases and showing you can manage your anxiety could improve things greatly.

https://link.springer.com/article/10.1007/s10664-024-10550-9


From software to reality?

Tags: tech, science

The latest Nobel prizes indeed say something about the presence of computer scientists in other fields. Do we risk to delve too much on theoretical model? For sure using computers helps a lot, we have to be careful about not loosing empirical validation in the process.

https://lemire.me/blog/2024/10/09/from-software-to-reality/



Bye for now!

Friday, 11 October 2024

KDE today announces the release of KDE Frameworks 6.7.0.

KDE Frameworks are 72 addon libraries to Qt which provide a wide variety of commonly needed functionality in mature, peer reviewed and well tested libraries with friendly licensing terms. For an introduction see the KDE Frameworks release announcement.

This release is part of a series of planned monthly releases making improvements available to developers in a quick and predictable manner.

New in this version

Breeze Icons
  • Delete 32px colorful folder action icon symlink. Commit. Fixes bug #478493
  • Add new knotes-symbolic.svg icon (22/32/48). Commit. Fixes bug #398901
  • Format system-suspend-inhibited, system-suspend-uninhibited. Commit.
  • Redesign system-suspend-inhibited, system-suspend-uninhibited. Commit.
  • Fix recoloring in applications-multimedia-symbolic and applications-engineering-symbolic. Commit. Fixes bug #492879
  • Add show-background icon. Commit. See bug #472863
Extra CMake Modules
  • Merge output targets from multiple qt6_target_qml_sources() calls. Commit.
  • Don't install QML files on Android. Commit.
  • Propagate OUTPUT_TARGETS of qt6_target_qml_sources to the caller. Commit.
  • Port Qt doc generation to qhelpgenerator. Commit.
  • Correctly forward the OUTPUT_TARGETS argument of qt6_add_qml_module(). Commit.
  • Set install destination for object files. Commit.
  • Upstream FindGLIB2.cmake changes from Qt. Commit.
  • KDEClangFormat: Ignore source files being in _install folder. Commit.
  • Reenable individual targets for clang-format to enable better status reporting an parallelization. Commit.
KArchive
  • K7zip: prevent crash when archive has no modification times for files. Commit.
KAuth
  • Silence false positive clazy checks. Commit.
KCMUtils
  • Drop obsolete includes and HAVE_X11. Commit.
  • Always show title and caption in tooltip if truncated. Commit.
KColorScheme
  • Follow system color scheme on Linux. Commit.
  • Fix build against a static Qt. Commit.
KConfig
  • Make unit tests work with a static Qt build. Commit.
KConfigWidgets
  • General/widgetStyle -> KDE/widgetStyle. Commit.
KCoreAddons
  • Make unit tests work with a static Qt build. Commit.
  • Kcoreaddonsplugin: Link against Qt6::Network. Commit.
  • Restore KProcess on Android. Commit.
  • Don't build kprocesstest for Android/iOS. Commit.
  • Fix build on ios. Commit.
KDBusAddons
  • Kdbusservice: Don't unregister service name slightly before exit. Commit. Fixes bug #492300
KDeclarative
  • Qpixmapitem: prevent a crash when there are no window yet. Commit.
KDocTools
  • Provide option to enable relocatable docbook files on non WIN32 platforms. Commit.
KGuiAddons
  • KCountryFlagEmoji: Improve fitting to the icon's bounding box. Commit.
  • KCountryFlagEmoji: Fix emoji representation for non-country codes. Commit.
  • KCountryFlagEmoji: Add test and demo cases for non-coutry codes. Commit.
  • Fix window insets foreground coloring on older Android versions. Commit.
  • Fix build with Qt < 6.7. Commit.
  • Fix color luma computation for Android window insets. Commit.
  • WaylandClipboard: fix QMimeData::urls() not working. Commit.
  • Update version for window insets API to match reality. Commit.
  • Add QML bindings for KWindowInsetsControllert. Commit.
  • Add KWindowInsetsController. Commit.
  • WaylandClipboard: make sure format list doesn't have duplicate items. Commit.
KHolidays
  • Holiday_si_sl: added missing Slovenian commemoration day. Commit.
KI18n
  • Make KTranscript work in static builds. Commit.
  • Make QML API unit test work with static Qt builds. Commit.
KImageformats
  • Fix endianness bug in PCX reader on big endian architectures. Commit.
  • Fixed read of BGR32 and RGB555 formats. Commit.
  • FIxed comparison of unsigned expression. Commit.
  • Raw: Getting the image size does not need unpacking. Commit.
KIO
  • [OpenFileManagerWindowJob] Fix crash when falling back to KRunStrategy. Commit. Fixes bug #486494
  • Previewjob: Use .cache as temp folder, delete temp file after use. Commit. Fixes bug #494096. See bug #494061
  • KFileItemActions: Try reading X-KDE-Show-In-Submenu as bool instead of string. Commit.
  • KFilePlacesView: have setUrl() handle trailing slashes in place URLs. Commit.
  • KFilePlacesItem: Use Solid to find home mount point. Commit.
  • Fileitem,file_unix: simplify types for stat. Commit.
  • Remove one level of three nesting in kdevtemplate. Commit.
  • Knewfilemenutest: cleanup. Commit.
  • Knewfilemenutest: test files and folders in ~/Templates. Commit.
  • ConnectionBackenp: fix passing errorString. Commit.
  • Knewfilemenu: Make ~/Templates work by simply placing files and folders there. Commit. Fixes bug #191632
  • KFilePlacesItem: Cache groupType. Commit.
  • Previewjob: avoid calling mkdir for path with two slashs. Commit.
Kirigami
  • Add since info for new API. Commit.
  • Re-enable cachegen on Android. Commit.
  • Create CMake config file only once all build parameters are known. Commit.
  • Fix unit tests when using a static build. Commit.
  • PlatformTheme: fix crash when item is being destroyed. Commit.
  • OverlaySheet: make default title vertically center aligned. Commit. Fixes bug #489357
  • Fix clang-format version imcompatibilities and avoid turning formatting of. Commit.
  • Dialog: Take header width into account, small fix for footerToolbar width. Commit.
  • Workaround on incorrect palette update. Commit. Fixes bug #493654
  • Platform: Check if weak pointer is expired in PlatformThemeChangeTracker ctor. Commit. Fixes bug #493652
  • Dialog: Use footer buttons width if its wider than content. Commit.
  • Fix sidebar text color in systemsettings. Commit.
  • Use disabled text colors also for inherit-ing Theme instances. Commit. Fixes bug #433256
  • Autotests/tst_theme: Add a test that verifies only one signal emission happens. Commit.
  • Autotests/tst_theme: Remove waiting for events. Commit.
  • Autotests/tst_theme: Explicitly mark root test objects as not inheriting. Commit.
  • Add PlatformThemeChangeTracker to BasicTheme::sync(). Commit.
  • Platform: Replace PlatformTheme::queueChildUpdate with ChangeTracker::Data flag. Commit.
  • Platform: Don't use queued signals for batching change signals in PlatformTheme. Commit.
  • Fix NavigationTabBar sizing on mobile. Commit.
  • ContextualHelpButton: Clip to avoid text overflow. Commit.
  • ContextualHelpButton: Fix flickering when the popup covers the button. Commit. Fixes bug #489688
  • ColumnView currently allows having a QObject item inside its children list. Commit.
  • ToolBarLayout: Add support for actions that are separators. Commit.
KNewStuff
  • Don't emit twice slotEntryChanged. Commit. See bug #492557
  • Qtquick: make sort/filter buttons like Discover/kcms. Commit.
KNotifications
  • Fix Android notification permission check. Commit.
  • Ensure notification permission request callback is run on the right thread. Commit.
KNotifyConfig
  • Port to Qt Multimedia. Commit.
  • Knotifyeventlist: Set the config paths in the right order. Commit.
KPackage
KRunner
  • Add querying property to RunnerManager. Commit.
  • Convert to newer REUSE.toml format. Commit.
KStatusNotifieritem
  • Document flatpak manifest requirements. Commit.
KSVG
KTextEditor
  • Port away from deprecated KPluralHandlingSpinBox. Commit.
  • Fix unexpected space indentation in Go var group. Commit. Fixes bug #487054
  • Read dir kateconfig on view creation. Commit. Fixes bug #489600
  • Fix pressing on } inserts two lines instead of one. Commit. Fixes bug #479717
  • Dont remove trailing spaces in markdown by default. Commit. Fixes bug #451648
  • Multicursors: Avoid indenting the sameline twice. Commit.
  • Blockmode: repair indent when the cursor is in the first column. Commit.
  • Multicursor: Fix indent with multiple cursors. Commit.
  • With latest syntax definition, more tests pass for ruby. Commit.
  • Use more views. Commit.
  • Avoid double signal emission. Commit.
  • Less deprecated calls, works locally. Commit.
  • Store multiline ranges spanning multiple blocks in TextBuffer. Commit.
  • Remove MovingRange caching in TextBlock. Commit.
  • Add hint the file might got moved. Commit. Fixes bug #476071
  • Dont create selection highlights with multiple selections. Commit.
  • Optimize killLine for multiple cursors. Commit.
  • Completion: Allow async population of documentation. Commit.
  • More const to avoid wrong use of these members. Commit.
  • Ensure modify the renderer that is used for printing. Commit. Fixes bug #465526. Fixes bug #488605. Fixes bug #487081. Fixes bug #483550
  • Fix text insertion with multiple cursors at same position. Commit. Fixes bug #492869
  • Add command names for "Remove Spaces" and "Keep Extra Spaces". Commit.
  • Minimap now follows the theme also for search matches. Commit.
  • Run clang-format. Commit.
  • Fix merging of selections in opposite directions. Commit. See bug #492869
  • Fix secondary cursor at boundary of selection doesn't get removed. Commit. See bug #492869
  • Fix warnings. Commit.
KTextWidgets
  • Use static regex for reusable objects. Commit.
  • Remove unused Q_D macro. Commit.
KUserFeedback
  • Build master ECM as part of the Flatpak build. Commit.
KWidgetsAddons
  • Fix crash with older Qt. Commit. Fixes bug #493060
  • Fix build against a static Qt. Commit.
  • KDateComboBox: emit dateEntered() on FocusOut. Commit.
Network Manager Qt
  • Correctly read manually-specified ipv6 addresses from Networkmanager. Commit. Fixes bug #476008. Fixes bug #453453
  • Simplify loops and avoid creating iterator on temporary. Commit.
  • Use static regex for reusable objects. Commit.
Purpose
  • [imgur] Restrict to actually supported MIME types. Commit.
  • Add extraJsonTranslationPaths.txt file for purpose specific translations. Commit.
  • Ensure KPlugin object contains no unstandardized keys. Commit.
QQC2 Desktop Style
  • Kquickstyleitem: Don't crash if colors changed and style option is null. Commit.
  • Kirigamiintegration: Track changes to PlatformTheme where needed. Commit.
  • TextFieldContextMenu: Open menu by keyPressed at TextField.cursorRectangle position. Commit.
Solid
  • Fstab: add missing signal override. Commit.
  • Fstab: Emit accessibilityChanged only when actually changed. Commit.
  • Get rid of implicit QString and QChar conversions. Commit.
  • Get rid of implicit QByteArray to const char* conversions. Commit.
  • [Fstab] Minor cleanups (new style connect, extraneous include). Commit.
  • [Fstab] Remove mntent wrapper macros. Commit.
  • [Fstab] Remove remnants of Solaris support. Commit.
Sonnet
  • Fail if none of the plugins can be build. Commit.
Syndication
  • Search for private link dependencies in static builds. Commit.
Syntax Highlighting
  • Upload the uncompressed files. Commit.
  • Odin: add missing items, fix attribute, add directive. Commit.
  • Swift: fix detection of end of protocol method declaration. Commit. Fixes bug #493459
  • Indexer: treats 1-character StringDetect as a DetectChar for unreachable rules and the merge suggestion. Commit.
  • Indexer: check that WordDetect does not contain spaces at the beginning and end of text. Commit.
  • Simplify installed xml syntax files to speed up reading. Commit.
  • Indexer: replace some QString with QStringView and QLatin1Char with char16_t literal. Commit.
  • Indexer: fix default value for char with LineContinuation. Commit.
  • Orgmode.xml: Fix orgmode syntax highlighting not ending properly. Commit.
  • Jira, Markdown, Org Mode: use rhtml syntax with erb language. Commit.
  • Haml: complete the syntax and fix the highlighting of Ruby line following the change in ruby.xml. Commit.
  • Ruby: fix %W, dot member, some parenthesis ; add ?c, escape char, etc. Commit. Fixes bug #488014
  • Gleam: Minor modifications to syntax and example file. Commit.
  • Remove truncase from Common Lisp. Commit.

Thursday, 10 October 2024

We have just switched on the upgrade for KDE neon to rebase on Ubuntu 24.04 LTS.

We do this every two years and the 22.04 LTS base was getting increasingly crusty with old Pipewire causing problems and packages like Krita not compiling at all.

Follow the Noble Upgrade instructions or just click the notification that should appear soon.

The Kubuntu Team is happy to announce that Kubuntu 24.10 has been released, featuring the new and beautiful KDE Plasma 6.1 simple by default, powerful when needed.

Codenamed “Oracular Oriole”, Kubuntu 24.10 continues our tradition of giving you Friendly Computing by integrating the latest and greatest open source technologies into a high-quality, easy-to-use Linux distribution.

Under the hood, there have been updates to many core packages, including a new 6.11 based kernel, KDE Frameworks 5.116 and 6.6.0, KDE Plasma 6.1 and many updated KDE gear applications.

Kubuntu 24.10 with Plasma 6.1

Kubuntu has seen many updates for other applications, both in our default install, and installable from the Ubuntu archive.

Applications for core day-to-day usage are included and updated, such as Firefox, and LibreOffice.

For a list of other application updates, and known bugs be sure to read our release notes.

Wayland as default Plasma session.

The Plasma wayland session is now the default option in sddm (display manager login screen). An X11 session can be selected instead if desired. The last used session type will be remembered, so you do not have to switch type on each login.

Download Kubuntu 24.10, or learn how to upgrade from 24.04 LTS.

Note: For upgrades from 24.04, there may a delay of a few hours to days between the official release announcements and the Ubuntu Release Team enabling upgrades.

We’re very happy to announce the latest release of Qt for Python 6.8. With every new release, we try to bring great things with Qt's new features and new trending ideas. For your convenience, you can check out what's new in Qt for Python 6.8 and what’s improved, along with the entire change log 

Kirigami Addons is out. This releases contains mostly code cleanup and minor improvements. There is netherless a few relevant changes. Thanks to everyone who contributed some code.

New KAppTemplate’s template

A new KAppTemplate is available as a good starting point for application that manage multimedia libraries. It is based on shared design of Peruse, Arianna and the WIP Calligra Launcher.

Hopefully it helps people who want to develop game launchers and other type of specialized multimedia applications.

 

More templates are planned (e.g. for chat applications), so stay tunned!

FormCard

FormCard is the part of Kirigami Addons that received the most changes in this release. First of all, FormCard now use more consistent spacing and padding, which slighly less horizontal padding. Descriptions for radio and checkbox delegates are also put underneath the delegate’s main text and checkbox, in an effort to make FormCard a bit more compact.

Before
After

Additionally FormComboBoxDelegate now lets you display an inline status similar to that is available in other FormCard’s delegates.

Finally FormCard.AboutKDE was renamed to FormCard.AboutKDEPage. This improve the naming consistency with other page compoenents. A compatibility wrapper on top of AboutKDEPage named AboutKDE is still available to not break any existing applications.

Deprecations

The Banner component is now deprecated. Kirigami.InlineMessage now has a position parameter which can be set to Header or Footer. Additionally with KDE Frameworks 6.8 Kirigami.InlineMessage will look exactly the same as Banner! So there is no more reasons for this component to exists in Kirigami Addons.

Other

Kirigami Addons supports static builds with a recent enough version of extra-cmake-modules.

Packager Section

You can find the package on download.kde.org and it has been signed with my GPG key.

Over 180 individual programs plus dozens of programmer libraries and feature plugins are released simultaneously as part of KDE Gear.

Today they all get new bugfix source releases with updated translations, including:

  • dolphin: Ignore trailing slashes when comparing place URLs (Commit)
  • kate: Fix session restore of tabs/views of untitled documents (Commit, fixes bug #464703, bug #462112 and bug #462523)
  • konsole: Fix a crash when sending OSC 4 (RGB) color outside the 256 range (Commit, fixes bug #494205)

Distro and app store packagers should update their application packages.

Wednesday, 9 October 2024

I've been fixing cursor problems on and off in the last few months. Here's a recap of what I've done, explanation of some cursor size problems you might encounter, and how new developments like Wayland cursor shape protocol and SVG cursors might improve the situation.

(I'm by no means an expert on cursors, X11 or Wayland, so please correct me if I'm wrong.)

Why don't we have cursors in the same size anymore?

My involvement with cursors started back in the end of 2023, when KDE Plasma 6.0 was about to be released. A major change in 6.0 was enabling Wayland by default. And if you enabled global scaling in Wayland, especially with a fractional scale like 2.5x, cursor sizes would be a mess across various apps (the upper row: Breeze cursors in Plasma 6.0 Beta 1, Wayland, 2.5x global scale, the lower row: Same cursors in Plasma 6.0):

Breeze cursors in Plasma 6.0 Beta 1, Wayland, 2.5x global scale

So I dug into the code of my favorite terminal emulator, Kitty, which at the time drew the cursor in a slightly smaller size than it should be (similar to vscode in the above image). I gained some understanding of the problem, and eventually fixed it. Let me explain.

How to draw cursors in the same size in different apps?

In X11, there used to be a standard set of cursors, but nowadays most apps use the XCursor lib to load a (user-specified) cursor theme and draw the cursor themselves. So in order to have cursors in the same theme and size across apps, we need to make sure that:

  1. Apps get the same cursor theme and size from the system.
  2. Apps draw the cursor in the same way.

The transition to Wayland created difficulties in both points:

1. Get the same cursor theme and size from the system

It used to be simple in X11: we have Xcursor.size and Xcursor.theme in xrdb, also XCURSOR_SIZE and XCURSOR_THEME in environment variables. Setting them to the same value would make sure that all apps get the same cursor theme and size.

But Wayland apps don't use xrdb, and they interpret XCURSOR_SIZE differently: in X11, the size is in physical pixels, but in Wayland it's in logical pixels. E.g., if you have a cursor size 24 and global scale 2x, then in X11, XCURSOR_SIZE should be 48, but in Wayland it should be 24.

The Wayland way is necessary. Imagine you have two monitors with different DPI, e.g. they are both 24" but monitor A is 1920x1080, while monitor B is 3840x2160. You set scale=1 for A and scale=2 for B, so UI elements would be the same size on both monitors. Then you would also want the cursor to be of the same size on both monitors, which requires it to have 2x more physical pixels on B than on A, but it would be the same logical pixels.

So Plasma 6.0 no longer sets the two environment variables, because XCURSOR_SIZE can't be simultaneously correct for both X11 and Wayland apps. But without them and xrdb, Wayland apps no longer have a standard way to get the cursor theme and size. Instead, different frameworks / toolkits have their own ways. In Plasma, KDE / Qt apps get them from the Qt platform integration plugin provided by Plasma, GTK4 apps from ~/.config/gtk-4.0/settings.ini (also set by Plasma), Flatpak GTK apps from the GTK-specific configs in XDG Settings Portal.

The last one is particularly weird, as you need to install xdg-desktop-portal-gtk in order fix Flatpak apps in Plasma, which surprised many. It might seem like a hack, but it's not. Plasma officially recommends installing xdg-desktop-portal-gtk, and this was suggested by GNOME developers.

But what for 3rd-party Wayland apps besides GTK and Qt? The best hope is to read settings in either the GTK or the Qt way, piggy-backing the two major toolkits, assuming that the DE would at least take care of the two.

(IMHO either Wayland or the XDG Settings Portal should provide a standard way for apps to get the cursor theme and size.)

That was part of the problem in Kitty. It used to read settings from the GTK portal, but only under a GNOME session. I changed it to always try to read from the portal, even if under Plasma. But that's not the end of the story...

2. Draw the cursor in the same way

It's practically a non-issue in X11, as the user usually sets a size that the cursor theme provides, and the app just draws the cursor images as-is. But if you do set a cursor size not available in the theme (you can't do that in the cursor theme settings UI, but you can manually set XCURSOR_SIZE), you'll open a can of worms: various toolkits / apps deal with it differently:

  1. Some just use the closest size available (Electron and Kitty at the time), so it can be a bit smaller.
  2. Some use the XCursor default size 24, so it's a lot smaller.
  3. Some scale the cursor to the desired size, and the scaling algorithm might be different, resulting in pixelated or blurry cursors; Also they might scale from either the default size or the closest size available, resulting in very blurry (GTK) or slightly blurry (Qt) cursors.

The situation becomes worse with Wayland, as the user now specifies the size in logical pixels, then apps need to multiply it by the global scale to get the size in physical pixels, and try to load a cursor in that size. (If the app load the cursor in the logical size, then either the app or the compositor needs to scale it, resulting in a blurry / pixelated cursor.) With fractional scaling, it's even more likely that the required physical size is not available in the theme (which typically has only 2~5 sizes), and you see the result in the picture above.

One way to fix it (and why I didn't do)

It can be fixed by moving the "when we can't load cursors in the size we need, load a different size and scale it" logic from apps / toolkits to the XCursor lib. When the app requests cursors in a size, instead of returning the closest size available, the lib could scale the image to the requested size. So apps would always get the cursor in the size they ask for, and their own different scaling algorithms won't get a chance to run.

Either the default behavior can be changed, or it can be hidden behind a new option. But I didn't do that, because I felt at the time that it would be difficult to either convince XCursor lib maintainers to make a (potentially breaking) change to the default behavior, or to go around convincing all apps / toolkits to use a new option.

My fix (or shall we say workaround)

Then it came to me that although I can't fix all these toolkits / apps, they seem to all work the same way if the required physical size is available in the theme - then they just draw the cursor as-is. So I added a lot of sizes to the Breeze theme. It only has size 24, 36 and 48 at the time, but I added physical sizes corresponding to a logical size 24 and all global scales that Plasma allows, from 0.5x to 3x, So it's 12, 18, 24 ... all the way to 72.

It was easy. The source code of the Breeze theme is SVG (so are most other themes). Then a build script renders it into images using Inkscape, and packages them to XCursor format. The script has a list of the sizes it renders in, so I added a lot more.

And it worked! If you choose Breeze and size 24, then (as in the bottom row in the picture above) various apps draw the cursor in the same size at any global scale available in Plasma.

But this method has its limitations:

  1. We can't do that to 3rd-party themes, as we don't have their source SVG.
  2. It only works if you choose the default size 24. If you choose a different size, e.g. 36, and a global scale 3x, then the physical size 36x3=108 is not available in the theme, and you see the mess again. But we can't add sizes infinitely, as explained in Vlad's blog, the XCursor format stores cursor images uncompressed, so the binary size grows very fast when adding larger sizes.

Both limitations can be lifted with SVG cursors. But before getting to that, let's talk about the "right" way to fix the cursor size problem:

The "right" fix: Wayland cursor shape protocol

The simple and reliable way to get consistent cursors across apps is to not let apps draw the cursor at all. Instead, they only specify the name of the cursor shape, and the compositor draws the cursor for them. This is how Wayland cursor shape protocol works. Apps no longer need to care about the cursor theme and size (well, they might still need the size, if they want to draw custom cursors in the same size as standard shapes), and since the compositor is the only program drawing the cursor, it's guaranteed to be consistent for all apps using the protocol.

(It's quite interesting that we seem to went a full circle back to the original server-defined cursor font way in X11.)

Support for this protocol leaves a lot to improve, though. Not all compositors support it. On the client side, both Qt and Electron have the support, but GTK doesn't.

There are merge requests for GTK and Mutter, but GNOME devs request some modifications in the Wayland protocol before merging them, and the request seems to be stuck for some months. I hope the recent Wayland "things" could move it out of this seemingly deadlock.

Anyway, with this protocol, only the compositor has to be modified to support a new way to draw cursors. This makes it much easier to change how cursors work. So we come to:

SVG cursors

Immediately after the fix in Breeze, I proposed this idea of shipping the source SVG files of the Breeze cursor theme to the end user, and re-generate the XCursor files whenever the user changes the cursor size or global scale. This way, the theme will always be able to provide the exact size requested by apps. (Similar to the "modify XCursor lib" idea, but in a different way.) It would remove the limitation 2 above (and also limitation 1 if 3rd-party themes ship their source SVGs too).

With SVG cursors support in KWin and Breeze, I plan to implement this idea. It would also allow the user to set arbitrary cursor size, instead of limited to a predefined list.

Problems you might still encounter today

Huge cursors in GTK4 apps

It's a new problem in GTK 4.16. If you use the Breeze cursor theme and a large global scale like 2x or 3x, you get huge cursors:

Huge cursors in GTK4 apps

It has not limited to Plasma. Using Breeze in GNOME would result in the same problem. To explain it, let me first introduce the concept of "nominal size" and "image size" in XCursor.

Here is GNOME's default cursor theme, Adwaita:

Adwaita cursors

"Nominal size" is the "cursor size" we are talking about above. It makes the list of sizes you choose from in the cursor theme settings UI. It's also the size you set in XCURSOR_SIZE. "Image size" is the actual size of the cursor image. "Hot spot" is the point in the image where the cursor is pointing at.

Things are a bit different in the Plasma default cursor theme, Breeze:

Breeze cursors

Unlike Adwaita, the image size is larger than the nominal size. That, combined with a global scale, triggers the bug in GTK4. Explanation of the bug.

XCursor allows the image size to be different from the nominal size. I don't know why it was designed this way, but my guess is so you can crop the empty part of the image. This both reduces file size, and reduces flicking when the cursor changes (with software cursors under X11). But the image size can also be larger than the nominal size, and Breeze (and a lot of other themes) uses this feature.

You can see in the above images that the "arrow" of nominal size 24 in Breeze is actually similar in size to the same nominal size in Adwaita. But the "badge" in Breeze is further apart, so it can't fit into a 24x24 image. That's why Breeze is built this way. In a sense, "nominal size" is similar to how "font size" works, where it resembles the "main part" of a character in the font, but some characters can have "extra parts" that go through the ceiling or floor.

This problem is already fixed in the main branch of GTK 4, but it's not backported to 4.16 yet, probably because the fix uses a Wayland feature that Mutter doesn't support yet. So at the moment, your only option is to use a different cursor theme whose "nominal size" and "image size" are equal.

Smaller cursors in GTK3 apps (most notably, Firefox)

The cursor code in GTK3 is different from GTK4, with its own limitations. You might find the cursor to be smaller than in other apps, and if you run the app in a terminal, you might see warnings like:

cursor image size (64x64) not an integer multiple of scale (3)

GTK3 doesn't support fractional scales in cursors. So if you have cursor size 24 and global scale 2.5x or 3x, it will use a scale 3x and try to load a cursor with a nominal size 24x3=72. And it requires the image size to be an integer multiple of the scale. So if your theme doesn't have a size 72, or it does but the image size is not multiple of 3, GTK3 fallbacks to a smaller unscaled cursor.

End words

OK, this is a long post. Hope I can bring you more cursor goodies in Plasma 6.3 and beyond.