Skip to content

Saturday, 9 November 2024

This week was full of major feature work and UI polishing, in addition to a lot of bug-fixing! I'm pretty sure everyone will find something to be excited about here:

Notable New Features

You can now swap the functions of drawing tablet pen buttons if you like the function performed by one of the buttons, but not which button activates it. (Joshua Goins, 6.3.0. Link)

Info Center now shows all of your GPUs, not just one of them. And they are now indicated in a fancy way! (Harald Sitter, 6.3.0. Link 1 and link 2)

Discover now shows you when apps are either packaged directly by their developer, or verified by a trusted third party. (Aleix Pol Gonzalez, 6.3.0. Link)

The Printers widget now shows each printer's print queue inline, right there in the widget! (Kai Uwe Broulik, 6.3.0. Link)

The Task Manager widget now lets you configure whether the "I'm playing audio" icons that appear in the corner of tasks can be clicked to mute the audio. In addition, the audio controls now always appear in the window preview thumbnails, and can't be accidentally disabled. (Petar Margetic, 6.3.0. Link)

When you've set up your system to reboot into the bootloader menu the next time it reboots (and not the firmware screen; that case was already handled), the logout screen how indicates this. (Nikolay Kochulin, 6.3.0. Link)

Notable UI Improvements

When you put a pie chart style System Monitor widget on a really skinny panel, the percentage circle in the center now looks nice, rather than being jagged and overly bold. (Arjen Hiemstra, 6.2.4. Link)

Made the progress indicators on Discover's Updates page more readable. (Nate Graham, 6.2.4. Link)

The Keyboard Indicator widget now indicates when modifier keys are "latched" or "locked", as they can be when using certain accessibility settings. (Nicolas Fella, 6.3.0. Link)

Removed the "Settings" launcher menu category! Now all of its contents have been moved into the "System" category. This reduces the number of categories that don't offer meaningful grouping. (Nate Graham, 6.3.0. Link)

The Printers widget now shows a little busy spinner for any printers that are currently printing, to make them easier to pick out among others when there are a lot of printers available. (Kai Uwe Broulik. 6.3.0. Link)

Widgets placed on the desktop are now very slightly translucent, just like the popups of widgets placed on the panel. (Marco Martin, 6.3.0. Link)

When for some reason the system time zone is set incorrectly or not set at all, the Digital Clock widget now tells you what's going on and offers you the chance to fix it yourself instead of just being broken. (Niccolò Venerandi, 6.3.0. Link)

Added a distinct Breeze icon for System Settings' Shortcuts page. (Joshua Goins, Frameworks 6.9. Link)

Improved the Breeze icon shown on password dialogs. (Kai Uwe Broulik, Frameworks 6.9. Link)

Notable Bug Fixes

Fixed a case where KWin would crash when plugging in external screens. (Xaver Hugl, 6.2.3. Link)

Fixed a regression caused by a version 0.22 of the power-profiles-daemon service that caused power profiles to not be registered properly by Plasma's Power and Battery widget until you manually restarted the Powerdevil service. (Méven Car, 6.2.3. Link)

Discover's auto-update feature once again works for Flatpak apps. (Harald Sitter, 6.2.4. Link)

The speaker test window on System Settings' Audio page now always fits its content, no matter what the name of the device or its audio profile may be. (Ismael Asensio, 6.2.4. Link)

Fixed a strange issue that would make GTK 4 apps look too dark when using HDR mode. Now they're a bit too light, but this is a GTK 4 bug. (Xaver Hugl, 6.2.4. Link)

Plasma panels in "fit content" mode are now compatible with flexible spacers; placing one on a panel no longer causes it to slowly grow to its full width when Plasma starts up — which was hilarious, but wrong. (Niccolò Venerandi, 6.2.4. Link)

Fixed a small visual glitch in KWin's Overview effect that caused windows dragged-and-dropped onto the desktop bar to strangely glide off screen. (Marco Martin, 6.2.4. Link)

Did a major code refactor and bug-fixing spree for desktop icon positioning, which fixes almost all of the outstanding bug reports about icons moving around, and also adds autotests to validate the fixes! You can read more about it here, too. (Akseli Lahtinen, 6.3.0. Link)

Alt key accelerators for items in the Global Menu widget now work on Wayland. (Nicolas Fella, 6.3.0. Link)

Performing a major system update using Discover no longer makes a pointless and invisible authentication prompt appear behind the logout window when you try to reboot to complete the update. (Alessandro Astone, PackageKit 1.3.1. Link)

Other bug information of note:

Notable in Performance & Technical

The feature to let you record the screen without re-approval if it's the same as one you did last time now also works when using rectangular region recordings. (David Redondo, 6.3.0. Link)

Implemented support for the Wayland system bell protocol. (David Redondo, 6.3.0. Link)

How You Can Help

KDE has become important in the world, and your time and contributions have helped us get there. As we grow, we need your support to keep KDE sustainable.

You can help KDE by becoming an active community member and getting involved somehow. Each contributor makes a huge difference in KDE — you are not a number or a cog in a machine!

You don’t have to be a programmer, either. Many other opportunities exist:

You can also help us by donating to our yearly fundraiser! Any monetary contribution — however small — will help us cover operational costs, salaries, travel expenses for contributors, and in general just keep KDE bringing Free Software to the world.

To get a new Plasma feature or a bugfix mentioned here, feel free to push a commit to the relevant merge request on invent.kde.org.

Friday, 8 November 2024

A few weeks ago Qt 6.8 was released, delivering many fixes and improvements for our software. Some of them were contributed by yours truly, and in this post I want to highlight some of them.

They relate to graphics tablet/stylus input on Wayland. Before we go into the fixes let’s have a quick overview of the flow of tablet input events on Wayland:

The genesis of input events is in the kernel driver for the particular tablet, which talks to the hardware (via USB, bluetooth etc). The kernel passes events to userspace via the evdev system. On the userspace side a Wayland compositor reads those events. Most compositors leverage libinput for this, a library that transforms raw evdev events into something more usable for the compositor while applying some cleaning and configuration. The compositor then delivers events to native Wayland applications using the tablet-v2 protocol. For legacy XWayland applications the compositor uses this protocol to send events to XWayland, which translates them into things X11 apps understand. The compositor can apply useful transformations to the input, like which area of the screen the tablet is mapped to, changing the pressure curve of the pen, or binding buttons to keyboard shortcuts.

The application then processes the events, potentially leveraging a UI toolkit like Qt. Qt creates QTabletEvent object for incoming Wayland events and delivers those to all UI elements. In case no UI element reacts to the event Qt will synthesize a mouse event from the tablet event and deliver that to the UI elements. That way most controls like buttons and menus don’t need special code to handle tablet input. Only when doing very low-level input handling or when needing tablet-specific interactions (like reacting to different pressure values) application developers need to explicitly handle tablet events in their code. Most UI toolkits will work somewhat similar to this. If an application doesn’t react to tablet input at all please file a bug against the application.

Qt Wayland had support for tablet input for a few years now, so what exactly needed fixing? The first thing is cursors. In Wayland the application tells the compositor which cursor to use. This can be done either by specifying a surface (i.e. an image) or a named cursor shape. Guess which one Qt used? That’s right: Neither. It just didn’t specify a cursor at all. The result depends on the compositor: KWin would display a cross-hair cursor as a fallback, which is ~okay, but not the cursor the application developer asked for. On other compositors I’ve tested there will be no cursor visible at all, which isn’t okay at all. For Qt 6.8 I implemented the missing cursor support, so now tablets get the same cursor as mouse input (unless of course the application developer wants a different cursor for tablet input).

Another thing that affected mostly non-Plasma users is client-side decorated windows. On Plasma Qt applications usually use the server-side decoration provided by KWin, but e.g. on GNOME Qt is responsible for drawing and handling window decorations. For this Qt features a plugin system so different decorations with different look-and-feels can be swapped out. Unfortunately those decorations didn’t handle tablet input at all, so it wasn’t possible to move around or close windows using a tablet stylus. I fixed this by pretending the tablet input is mouse input to the decorations, which was a simple yet effective solution for the issue. If there is ever a need for decorations to treat tablet input different to mouse input we can revisit this.

Talking about moving windows, a feature most KDE apps have (even if off-by-default these days) is dragging any empty area to move the window. This wasn’t working when using a stylus. Why? For that we need to look at how this works on a Wayland level. The xdg-shell protocol (the one responsible for most application windows) has a move request that asks the compositor to start a move interaction for the window. As part of the request the application must pass a serial, which is a number that corresponds to the last input event the application has received. To avoid applications suddenly deciding to move in the background compositors usually only allow move requests as a result of direct user input, so this serial must match the last input event. Qt wraps this move request inside the QWindow::startSystemMove function. The problem was that Qt didn’t keep track of the serial it received as part of tablet input, so when starting the move it would pass a wrong serial and the compositor (rightfully) refused the move. A few extra lines later the serial was tracked properly and moving windows with a stylus worked, just in time for Nate to disable the feature by default.

The same problem also affected drag-and-drop. When starting a drag with a stylus Qt now passes the correct serial, making drag-and-drop work (at least on the Qt side, there currently is a bug on the KWin side that prevents this from working).

The last fix for today relates to how applications react to the tablet events. Sometimes applications process clicks differently depending on what keyboard modifiers are pressed. For example pressing Ctrl while clicking on files in Dolphin allows to select multiple files. For this to work Qt conveniently delivers the active modifiers with every input event. Alas for tablet input the modifiers got lost along the way, so it wasn’t possible to select multiple files using a stylus. One small fix later it works as expected.

That’s all the Wayland tablet related fixes for today. If you find more issues in Qt/KDE apps related to tablet input on Wayland please report them on bugs.kde.org and I’ll look into them.

That’s not all there is about Wayland tablet improvements though. Fully in the spirit of the “We care about your input!” Goal there are exiting things happening on the KWin/Plasma side that I’ve been involved in. Stay tuned for more!

In my position of Software Platform Engineer at KDE I work on common building blocks for KDE software, like Qt and KDE Frameworks. This work is possible thanks to your generous donations. Check out our end-of-the-year fundraiser if you’d like to see more work like this.

Make sure you commit anything you want to end up in the KDE Gear 24.12
releases to them

Next Dates:

  •   November 14, 2024: 24.12 freeze and beta (24.11.80) tagging and release
  •   November 28, 2024: 24.12 RC (24.11.90) tagging and release
  •   December  5, 2024: 24.12 tagging
  •   December 12, 2024: 24.12 release


https://community.kde.org/Schedules/KDE_Gear_24.12_Schedule

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


Voted in America? This Site Doxed You

Tags: tech, democracy

I didn’t know the voting rolls were public record in the US… this is a really bad idea.

https://www.404media.co/voted-in-america-this-site-doxed-you/


One weird trick to get the whole planet to send abuse complaints to your best friend(s)

Tags: tech, networking, security, protocols

Looks like there are people out there to get Tor relays down… and they found a smart networking trick I’d expect to not work anymore.

https://delroth.net/posts/spoofed-mass-scan-abuse/


XMPP: the forgotten gem of Instant Messaging

Tags: tech, xmpp, ux

Could XMPP make a come back if the user experience was better?

https://adele.pages.casa/md/blog/xmpp-the-forgotten-gem-of-instant-messaging.md


A conceptual model of ATProto and ActivityPub

Tags: tech, protocols, fediverse, governance, decentralized

Interesting explanation of the different visions and governance behind ActivityPub and ATProto.

https://fediversereport.com/a-conceptual-model-of-atproto-and-activitypub/


A Map of Sync

Tags: tech, syncing, data

Interesting dimensions to use when classifying syncing solutions and to see which ones will meet your constraints.

https://stack.convex.dev/a-map-of-sync


DuckDB over Pandas/Polars

Tags: tech, databases, data-science

A good reminder that I should probably evaluate DuckDB for some of my tooling.

https://pgrs.net/2024/11/01/duckdb-over-pandas-polars/


Why systemd is a problem for embedded Linux

Tags: tech, systemd, embedded

This is a good point. systemd is kind of turning into a monoculture, but what are we loosing? Indeed, right now things could be better on deeply embedded systems (I insist on the “deep embedded” here which is often more limited in resources). Unlike the author I think they could be improved and they don’t quite apply to a good chunk of recent embedded platforms though.

https://kevinboone.me/systemd_embedded.html


How the New sqlite3_rsync Utility Works

Tags: tech, databases, sqlite, tools, syncing

If you wonder how the protocol is designed and how the actual implementation works, this is a nice introduction. Clearly it’s helped by the size of that program which is fairly small.

https://nochlin.com/blog/how-the-new-sqlite3_rsync-utility-works


C++, Complexity, and Compiler Bugs

Tags: tech, c++, complexity

Good illustration of how the C++ language complexity is out of hands.

https://azeemba.com/posts/cpp-complexity-compiler-bugs.html


Having fun with modern C++ – Daniel Lemire’s blog

Tags: tech, c++

Still, C++ improved in recent years. The problem is that we tend to stick too much to the old constructs we already know and that things keep piling up but nothing is removed.

https://lemire.me/blog/2024/11/02/having-fun-with-modern-c/


smolweb HTML specification

Tags: tech, html, accessibility, low-tech, complexity

A nice subset of HTML to ensure better accessibility and reduced complexity.

https://smolweb.org/specs/index.html


Tags: tech, web, frontend, html

Each has a use, they shouldn’t be conflated. It makes for poor user experience and accessibility otherwise.

https://marijkeluttekes.dev/blog/articles/2024/11/04/html-link-or-button-that-is-the-question/


Long Distance Relationships

Tags: tech, remote-working, management, product-management

A bit biased toward stable product teams only. Still, there are good tips which are more widely applicable here. This gives a good idea of the management of a distributed team of remote workers.

https://matt.blwt.io/post/long-distance-relationships/



Bye for now!

I spent past three weeks working on refactoring and fixing legacy code (the oldest of which was from 2013) that handled positioning Plasma desktop icons, and how this data was saved and loaded.

Here's the merge request if you're curious: plasma-desktop: Refactor icon positioner saving and loading

The existing code worked sometimes, but there were some oddities like race conditions (icon positioning happens in weird order) and backend code mixed in with frontend code.

Now I am not blaming anyone for this. Code has tendency to get a bit weird, especially over long periods of time, and especially in open source projects where anyone can tinker with it.

You know how wired earbuds always, always get tangled when you place them in a drawer or your pocket or something for few seconds? Codebases do the exact same thing, when there are multiple people writing on things, fixing each others' bugs. Everyone has a different way of thinking, so it's only natural that things over time get a bit tangled up.

So sometimes you need someone to look at the tangled codebase and try to clear it up a bit.

Reading code is the hardest part

When going through old code, especially some that has barely any comments, it can take a very long time to understand what is actually going on. I honestly spent most of my time trying to understand how the thing even works, what is called when, where the icons positions are updated, and so on.

When I finally had some understanding of what was happening, I could start cleaning things up. I renamed a lot of the old methods to be hopefully more descriptive, and moved backend code — like saving icon positions — from the frontend back to backend.

Screens and icons

Every screen (PC monitor, TV…) tends to have it's own quirks. Some, when connected with display-port adapter, tell your PC it's disconnected if your PC goes to screen saving mode. Some stay connected, but show a blank screen.

One big issue with the icon positions was that when screen got turned off, it thought there was no screen anymore and started removing items from the desktop.

That's fair. Why show desktop icons on a screen that is non-existent? But when you have a monitor that tells your PC, "Okay I'm disconnecting now!" when the PC says it's time to sleep, wrong things would happen.

This condition is now handled by having a check that if the screen is in use or not. Now when screen is not in use, we just do nothing with the icons. No need to touch them at all.

Stripes and screen resolution

Our icon positioning algorithm uses something called "stripes."

Every resolution has it's amount of stripes. Stripes contain an array of icons, or blank spots.

So if your screen resolution is, let's say, 1920x1080, we calculate how many stripes and how many items per stripe will fit on that screen.

Stripe1: 1 2 3 4 5 6 7
Stripe2: 1 2 3 4 5 6 7
Stripe3: 1 2 3 4 5 6 7

And so on..

But when you change your screen resolution or scale factor, how many icon stripes you have and how many icons fit on each stripe will change.

So if you have one of those screens that looks to the system like it's been unplugged when it goes into sleep mode, previously the stripe amount would change to 1 row, 1 column. And the icon positioner would panics and shove all icons in that 1,1 slot.

Then when you'd turn the screen back on, the icon positioner would wonder what just happened and restore the proper stripe number and size. But by that point it would have lost all our positioning coordinate data during the shoving of icons in that one miniscule place, so instead it would reset the icon positions… and this leaves users wondering why their desktop icon arrangement is now gone.

Here we have to also check for the screen being in use or not. But there were other problems.

Saving icon positions

The prior code saved the icon positions every time the positions changed. Makes sense.

But it didn't account for the screen being off… so the icon positions would get saved while the desktop was in a faulty state. This also causes frustration because someone arranges the icons how they wish, but then screen does something weird and they're now saved in wrong places again.

Our icon positions were updated after almost every draw call, if the positions changed. So this would mean the saving would happen rather often and no matter what moved them.

We had to separate the user action from computer action. If computer moves the icons, we ideally do not save their positions, unless something drastic has happened like resolution change.

The icon positions are saved per resolution, so if you move icons around while they're displayed on a 3440x1440 screen and then change the resolution to 1920x1080, both will have their own arrangements. This part of the codebase did not previously work, and it would always override the old configuration, which caused headache.

So now we only save icon positions when:

  • The user adds or removes a desktop icon
  • The user moves a desktop icon
  • The user changes the desktop resolution

This makes the icon position saving much less random, since it's done only after explicit user actions.

Margin errors

The last thing that caused headaches with the icon positioning was that the area available on the desktop for icons was determined before panels were loaded. When the panels loaded, they would reduce the amount of space for desktop icons, and that area would constantly resize until everything is ready.

In previous code, this would cause icons to move, which updates positions, which then saves their positions.

So let's say you arrange your icons nicely, but the next time you boot into plasma, your panels start shoving the poor icon area around and the icons have to move out of the way… and now they're all in the wrong places.

This was already partially fixed by not saving when the computer moves the icons around: we just load the icon positions when the screen is in use and we are done with listing the icons on the desktop. Part of the margin changes happen when screen is off.

We still need to fix the loading part; ideally we load the icon area last, so that it gets the margins it expects and doesn't shuffle around while panels are still appearing. But it was out of scope for this merge request.

Conclusions

It may not sound like much, but this was a lot of work. I spent days just thinking about this problem, trying to understand what is happening now and how to improve it.

Luckily with a lot of help from reviewers and testers I got things to work much better than it used to. I am quite "all-over-the-place" when I solve problems so I appreciate the patience they had with me and my questions. :D

What I mostly wished for when working on this were more inline code comments. You don't need to comment the obvious things, but everything else could use something. It's hard to gauge what is obvious and what is not, but that kind of answers the question: If you don't know if it's obvious or not, it's likely not, so add some comment about it.

I do hope that the desktop icons act more reliably after all these changes. If you spot bugs, do report them at https://bugs.kde.org.

Thanks for reading! :)

PS. The funniest thing to me about all of this is that I do not like having any icons on my desktop. :'D

Friday, 8 November 2024

KDE today announces the release of KDE Frameworks 6.8.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

Baloo
  • [excludeMimeTypes] Exclude model/obj and text/rust from content indexing. Commit. See bug #488533
Bluez Qt
  • Simplify PendingCallPrivate. Commit.
Breeze Icons
  • Add mimetype icons for text/x-typst. Commit.
  • Monochromize not-explicitly-colorized symbolic folder icons. Commit. Fixes bug #494721
  • Add CI for static builds on Linux. Commit.
  • Unify common parts of index.theme for breeze and breeze-dark. Commit.
  • Sync index.theme changes from breeze to breeze-dark. Commit. Fixes bug #494399
  • Rename spinbox-* icons to value-*. Commit.
Extra CMake Modules
  • FindKF6: Print custom message when required components are not found. Commit.
  • Add a directory check when appending a module dir to qmlimportscanner. Commit.
  • Add Python bindings. Commit.
  • Break enums onto multiple lines. Commit.
  • Set import paths for QML modules to all CMake search paths. Commit.
  • Remove the old/unused SIP-based Python binding generation infrastructure. Commit.
  • ECMGeneratePkgConfigFile: try to deduce additional include dirs. Commit.
  • Fix custom definitions for generated pkgconfig files. Commit.
  • Fix QM loader unit tests with a static Qt. Commit.
  • Don't fall back to qmlplugin dump on static Qt builds. Commit.
  • Retire Qt5 Android CI. Commit.
  • Automatically install dependent targets of QML modules in static builds. Commit.
  • Allow to specify an export set for targets installed by finalize_qml_module. Commit.
  • Don't check websites in Appstream tests. Commit.
KArchive
  • Add CI for static builds on Linux. Commit.
  • [k7zip] Correctly handle pack sizes > INT_MAX. Commit.
KBookmarks
KCalendarCore
  • Fix Duration's operator- accidentally adding instead of subtracting. Commit.
  • Add CI for static builds on Linux. Commit.
KCMUtils
  • Fix compilation with Qt 6.9 (dev). Commit.
KCodecs
  • Add test for passing unknown codec to codecForName. Commit.
  • Fix buffer overflow in Codec::codecForName. Commit.
KColorScheme
  • Reset palette to default-constructed one when scheme is unset. Commit.
  • Don't call activateSchemeInternal in init unless really needed. Commit.
  • Add CI for static builds on Linux. Commit.
KCompletion
KConfig
  • Kwindowconfig: If sizes are same as default, revert them to default when saving. Commit. See bug #494377
  • Add CI for static builds on Linux. Commit.
  • Correctly install QML module in a static build. Commit.
KConfigWidgets
  • Add CI for static builds on Linux. Commit.
KContacts
  • Fix IM protocol resource data initialization in static builds. Commit.
KCoreAddons
  • Make KJob::elapsedTime const. Commit.
  • Fix absolute path generation into (not installed) header. Commit.
  • KPluginMetaData: reduce string allocation. Commit.
  • Update git blame ignore file. Commit.
  • Reformat code with clang-format. Commit.
  • Kjob: add elapsedTime() returns the ms the job ran. Commit.
  • Add CI for static builds on Linux. Commit.
  • Install QML module correctly when building statically. Commit.
  • ExportUrlsToPortal: use QScopeGuard::dismiss for the success code path. Commit.
KDocTools
KFileMetaData
  • UserMetadata: complete Windows implementation. Commit.
KGlobalAccel
  • Add WITH_X11 option to re-enable X11 code after runtime cleanup. Commit.
  • Add CI for static builds on Linux. Commit.
KGuiAddons
  • Add namespace for Android as required by newer gradle versions. Commit.
  • Add CI for static builds on Linux. Commit.
  • Correctly install static QML modules. Commit.
KHolidays
  • Fix misunderstanding of All Saints Day in Swedish calendar. Commit.
  • Add CI for static builds on Linux. Commit.
KI18n
  • Allow explicit setting of Python3 fallback executible path. Commit.
  • Use raw pointer for some pimpl'd public classes. Commit.
  • Add missing include. Commit.
  • Trigger binding reevaluation on language change. Commit.
  • Propagate QML dependency for a static build with KTranscript enabled. Commit.
  • Add CI for static builds on Linux. Commit.
  • Reduce temporary allocations. Commit.
  • Modernize member initialization. Commit.
  • Fix container size type narrowing warnings. Commit.
  • Remove commented-out KLocale leftovers. Commit.
  • Align argument names between definition and declaration. Commit.
  • Re-evaluate the languages we translate to on QEvent::LanguageChange. Commit.
  • Cleanup KLocalizedContext d-ptr handling. Commit.
  • Special-case the language fallback for country-less English. Commit.
  • Use QStringView for locale splitting. Commit.
KIconThemes
  • Port to KStandardActions. Commit.
  • Postpone spawning KColorSchemeManager instance. Commit.
  • Add CI for static builds on Linux. Commit.
  • Init mimeType icons on demand. Commit.
  • Set up KColorSchemeManager on Android as well. Commit.
  • Reduce temporary allocations. Commit.
KImageformats
  • TGA: Fixed GrayA image loading error. Commit.
  • Exr: Fix read/write with openexr 3.3. Commit. Fixes bug #494571
  • JXL improvements. Commit.
  • JXR: Fixed image reading on sequential devices. Commit.
  • Simplified read/verify header process. Commit.
KIO
  • Minor: use existing variables which contain these strings. Commit.
  • Fix crash from HTTPProtocol::del() which calls with inputData=nullptr. Commit.
  • Port away from Qt::Core5Compat when using Qt 6.7 or newer. Commit.
  • Remove unused KConfigWidgets dependency. Commit.
  • Port to KStandardActions. Commit.
  • Add missing KColorScheme link. Commit.
  • Add missing include. Commit.
  • Include DBus error in log when communication with kpasswdserver fails. Commit.
  • Update git blame ignore file. Commit.
  • Reformat code with clang-format. Commit.
  • Copyjob/transferjob: use KJob::startElapsedTimer. Commit.
  • Http worker: handle dav[s] protocol. Commit. Fixes bug #365356
  • [KFileFilterCombo] Fix setting 'All' filter as default. Commit.
  • KNewFileMenu: Prevent using home directory as template directory. Commit. Fixes bug #494679
  • [KFileFilter] Ignore label when comparing filters. Commit.
  • [KFileFilter] Remove excess spaces in logging. Commit.
  • [KFileFilterCombo] More verbose logging when not finding a filter. Commit.
  • [http] Inline handleRedirection into the metaDataChanged slot. Commit.
  • [webdav] Handle redirections which add trailing slashes. Commit. See bug #484580
  • Copyjob: prefer custom struct over std::pair. Commit.
  • PreviewJob: use standard thumbnailer caching is disabled. Commit.
  • KDirListerTest: improve test stability. Commit.
  • Tests: Make sure KIO::UDSEntryList can be compared. Commit.
  • Expose UDSEntry equal operator to KIO namespace. Commit.
  • Core/copyjob: report speed when copying multiple files. Commit. See bug #391199
  • KPreview: store standard thumbnails in /tmp subfolder. Commit.
  • Preview: better clean after standard thumbnailer. Commit. Fixes bug #493274
  • Openurljob.cpp: Avoid opening files in endless loop if mimetype is set to open with xdg-open. Commit. Fixes bug #494335
  • [KFilePlacesView] Improve automatic resize heuristic. Commit. Fixes bug #449544
  • Workerinterface: remove unused #include. Commit.
  • Add translation context to admin security warning. Commit.
  • Kfileitem: linkDest prevent readlink error when file is not a symlink. Commit.
  • Check that admin worker was installed by root. Commit.
  • Clean up Properties dialog to follow HIG, improve UX, remove frames and fix padding regression. Commit. Fixes bug #484789
  • TrashSizeCache: Use correct flags for QDirIterator. Commit. See bug #479283
Kirigami
  • TitleSubtitle: Don't explicit set renderType. Commit.
  • Upper mound for overlaysheet width. Commit.
  • SelectableLabel: fix a11y properties. Commit.
  • Fix Kirigami Application (Qt6) template. Commit. Fixes bug #494478
  • SelectableLabel: Use onPressedChanged. Commit. See bug #481293
  • Reformat code with clang-format. Commit.
  • Icon: Always respect the animated property. Commit. Fixes bug #466357
  • Adjust tst_qicon for desktop theme. Commit.
  • Fix loading desktop theme. Commit. Fixes bug #491294
  • Fix presumable typos confusing background and foreground colors. Commit. See bug #491294
  • Always print Theme file loading errors. Commit. See bug #491294
  • SelectableLabel: override default padding values more completely. Commit. Fixes bug #495256
  • Fix icon for positive state of InlineMessage. Commit.
  • SelectableLabel: fix binding loop warning on cursorShape. Commit.
  • ScrollablePage: Add properties to set if the scrollbars are interactive. Commit.
  • SelectableLabel: use property alias instead of direct binding, expose more through aliases. Commit.
  • Dialog: fix multiple binding loops (again). Commit.
  • Make the close button actually close. Commit.
  • Layout: Reverse the stacking order of items inserted into ToolBarLayout. Commit. See bug #490929
  • Modify SelectableLabel to use TextEdit instead. Commit. See bug #493581
  • Cleanup and fix static QML module installation. Commit.
  • Disable PageRow gesture on android. Commit.
  • Make OverlaySheet look exactly like Dialog. Commit. Fixes bug #489357
  • Top align icon in multiline InlineMessage. Commit.
KItemModels
  • Install QML module correctly when building statically. Commit.
  • Fix QML unit tests when building against a static Qt. Commit.
  • Make unit tests independent of QtWidgets. Commit.
  • Don't hardcode library type. Commit.
  • Kbihash: adapt to source incompatible change in Qt. Commit.
KJobWidgets
  • Hide arrowButton in KWidgetJobTracker on startup. Commit.
  • Add dedicated WITH_X11 option to avoid automagic. Commit.
KNewStuff
  • Make sure the action's dialog closes. Commit. Fixes bug #492998
  • Put qnetworkreplys in a self-aborting unique_ptr. Commit. See bug #492998
  • Parent the xml loader's httpjob. Commit. See bug #492998
  • Filecopyworker: try to gracefully quit the thread. then terminate it. Commit. See bug #492998
KNotifications
  • Typo--. Commit.
  • Add namespace for Android as required by newer gradle. Commit.
  • Add CI for static builds on Linux. Commit.
KParts
  • Define undeprecated Capabilities key in JSON metadata, define JSON schema, remove obsolete key. Commit.
KQuickCharts
  • Add CI for static builds on Linux. Commit.
  • Correctly install static QML modules. Commit.
KStatusNotifieritem
  • Fix absolute path generation in (not installed) header. Commit.
  • Typo--. Commit.
KTextEditor
  • Vi mode: Don't infinite loop in searcher. Commit.
  • Remove unused var. Commit.
  • Fix ignores. Commit.
  • Less deprecated stuff used. Commit.
  • Don't temporarily clear document URL during openUrl(). Commit.
  • Only discard completion if the cursor was at the end of line. Commit.
  • Update git blame ignore file. Commit.
  • Reformat code with clang-format. Commit.
  • Fix implicit conversion of Qt::Key in Qt 6.9. Commit.
  • Try to avoid unwanted completions. Commit.
  • Fix session restore of file type. Commit. Fixes bug #492201
  • Make ViewPrivate::displayRangeChanged public. Commit.
  • Set DocumentPrivate::m_reloading to false only if loading. Commit.
  • Give a more proper name to the test. Commit.
  • Fix multiblock range handling when unwrapping line. Commit. Fixes bug #494826
  • Fix line removal not handled properly in KateTemplateHandler. Commit. Fixes bug #434093
  • Inline blocksize into buffer. Commit.
  • Improve MovingRangeTest::benchCheckValidity. Commit.
  • Improve TextRange::checkValidity performance. Commit.
  • Do all testing in clean temp dirs. Commit.
  • Add a swap file test. Commit.
  • Add benchmarks for moving stuff. Commit.
  • Use std::vector for cursor storage. Commit.
  • Allow disabling editorconfig. Commit. Fixes bug #471008
KTextTemplate
  • Import i18n scripts from grantlee. Commit. Fixes bug #492237
  • Fix "now" tag to allow single quoted strings. Commit.
KTextWidgets
KUnitConversion
  • Add CI for static builds on Linux. Commit.
KWallet
  • Don't exclude deprecated functions from build. Commit. Fixes bug #493356
KWidgetsAddons
  • Fix time entry in locales with mixed-case AM/PM suffixes. Commit.
  • Add CI for static builds on Linux. Commit.
  • Don't use Oxygen style in KSeparator. Commit.
  • KMessageWidget: Improve accessibility. Commit.
KXMLGUI
  • Simplify code: use erase remove. Commit.
  • Fix window position not being restored. Commit. Fixes bug #493401
Prison
  • Add CI for static builds on Linux. Commit.
QQC2 Desktop Style
  • TextArea: Make placeholder wrap. Commit.
Solid
  • Restore MediaChanged handling for Audio CDs. Commit.
  • Support reproducible builds by omitting host paths in bison/yacc outputs. Commit.
  • [udisks] Don't add/remove devices in slotMediaChanged. Commit. See bug #464149
  • Port implicit QByteArray, QChar and QString conversions in iokit. Commit.
  • Drop unfinished Power API. Commit.
  • Fstabwatcher: use libmount monitor on Linux. Commit.
  • Fstabhandling: use libmount in Linux. Commit.
Sonnet
  • Add linux-qt6-static CI. Commit.
  • Remove ASPELL runtime dependency from plugin building check. Commit.
  • Provide SONNET_NO_BACKENDS option to deactivate build failures with no backends. Commit.
Syndication
  • Add CI for static builds on Linux. Commit.
Syntax Highlighting

Thursday, 7 November 2024

The last maintenance release of the 24.08 series is out. We fixed some issues, so project opening should be working again.

 

  • Fix crash caused by incorrect codec passed on opening subtitle. Commit. Fixes bug #495410.
  • Fix shadowed variable causing incorrect clip removal on project opening, fix crash opening project with timeline clip missing in bin. Commit. See bug #493486.
  • Fix qml crash building timeline with Qt 6.8 – ensure context property exists before setting source. Commit. See bug #495335.
  • Fix generate proxy when frame size is above a value not using the current project setting. Commit.
  • Fix shadow variable causing clip removal on project opening. Commit.
  • Fix monitor seek to prev/next keyframe not working in rotoscoping. Commit.
  • Fix missing build-in LUT files not correctly fixed on project open. Commit. See bug #494726.
  • Fix clip jobs like stabilize creating invalid folders. Commit.
  • Fix freeze loading project with invalid folder id. Commit.
  • Don’t invalidate timeline preview when replacing an audio clip in bin. Commit.
  • Ensure monitor is cleared and ruler hidden when no clip or a folder is selected in bin. Commit.

The post Kdenlive 24.08.3 released appeared first on Kdenlive.

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:

  • neochat: Adjustments to make it work with the newly released libquotient 0.9 (Commit)
  • kdevelop: MesonManager: remove test suites when a project is closing (Commit, fixes bug #427157)
  • kdenlive: Fix a qml crash building timeline with Qt 6.8 (Commit, fixes bug #495335)

Distro and app store packagers should update their application packages.

Wednesday, 6 November 2024

While I do have a Qt git build on my machine that I use for development, I usually only test individual applications and functionality but hardly ever run my full Plasma session on it. This means that for day-to-day use I typically only get to enjoy new Qt features once they have actually been released.

Message Box “Close Document: The document has been modified. Do you want to save your changes or discard them?” ontop of a KWrite editor window that is darkened because the prompt is modal
Proper modal dialogs under Wayland (note the darkened editor window) thanks to XDG Dialog and the new Qt 6.8

One feature I talked about in the very last issue of “On the road to Plasma 6” is a nice API for XDG Foreign. To recap: it’s a Wayland protocol that lets an application export a window to another one so it can can attach a window to it. For example, the XDG Desktop Portal wants to attach the “Open File” dialog as if it were coming from the application that requested it.

Of course we don’t want to write low-level Wayland code and instead have an easy to use API for it. The KWindowSystem::setMainWindow function does just that: hand in a window and the token you received from the other application (created through KWaylandExtras::exportWindow) and it takes care of everything else. Presumably, you want to set the parent window before showing your dialog to make absolutely sure it’s set up properly.

However, Qt did not have an API to tell us when the underlying XDG Toplevel (think: a regular desktop-y window with a title bar and what not) had been created. We were only told when the basic wl_surface was created, which was too early, or the window was exposed/shown, at which point it was already flashing up in the user’s task bar. Hence, I added a new QWaylandWindow::surfaceRoleCreated (and corresponding surfaceRoleDestroyed) signal. Utilizing that, the aforementioned KWindowSystem API now works perfectly.

Another major addition to Qt Wayland that I have been looking forward to very much is support for the XDG Dialog protocol. While a window could have always had a parent (e.g. a popup menu or settings dialog parented to the application’s main window), there was no concept of a “modal” dialog. Therefore, we did not support the “dim parent” effect under Wayland that darkens a window to indicate it cannot be interacted with. More importantly, KWin couldn’t take it into account for its focus handling either. It happily let you focus a blocked window but the application would then just ignore your input.

Thumbnail of two confirmation boxes “This window contains multiple tabs. Are you sure you want to close the window?“ side by side, “Confirmation” window title overlaid ontop of the thumbnail.
There’s only one Dolphin running here!

This was most noticeable for me when Alt+Tab’ing back and forth, for example using the “Open File” dialog in one application and then trying to switch to the other to verify where the file was actually located. Instead of cycling between the file dialog and the other application, it would alternate between the file dialog and the blocked main window.

Sadly, even when I upgraded to Qt 6.8 the situation didn’t improve. I noticed that Alt+Tab actually showed the dialog twice. This looked like a bug and sure enough comparing it to the Plasma 5.27 LTS session on my other computer proved that it used to work at some point. At first I didn’t spot anything obvious until I noticed a small typo that must have slipped in during some major refactoring. Instead of not including the main window when it had a modal child, it included the modal child once again! Sure enough, adding an exclamation mark (the logical NOT operator in C++) did the trick.

If you want to support more good people such as myself, consider donating to the KDE End of Year Fundraiser!

Tuesday, 5 November 2024

This one required a few other features to be implemented first, so let’s jump right in.

Matching reference luminances

A big part of what a desktop compositor needs to get right with HDR content is to show SDR and HDR content properly side by side. KWin 6.0 added an SDR brightness slider for that purpose, but that’s only half the equation - what about the brightness of HDR content?

When we say “HDR”, usually that refers to a colorspace with the rec.2020 primaries and the perceptual quantizer (PQ) transfer function. A transfer function describes how to calculate a real brightness value from the “electrical” signal encoded in the content - PQ specifically has encoded values from 0 to 1 and brightness values from 0 to 10000 nits. For reference, your typical office monitor does around 300 or 400 nits at maximum brightness setting, and many newer phones can go a bit above 1000 nits.

Now if we want to show HDR content on an HDR screen, the most straight forward thing to do would be to just calculate the brightness values, write them to the screen and be done with it, right? That’s what KWin did up to Plasma 6.1, but it’s far from ideal. Even if your display can show the full range of requested brightness values, you might want to adjust the brightness to match your environment - be it brighter or darker than the room the content was optimized for - and when there’s SDR things in HDR content, like subtitles in a video, that should ideally match other SDR content on the screen as well.

Luckily, there is a preexisting relationship between HDR and SDR that we can use: The reference luminance. It defines how bright SDR white is - which is why another name for it is simply “SDR white”.

As we want to keep the brightness slider working, we won’t map SDR content to the reference luminance of any HDR transfer function though, but instead we map both SDR and HDR content to the SDR brightness setting. If we have an HDR video that uses the PQ transfer function, that reference luminance is 203 nits. If your SDR brightness setting is at 406 nits, KWin will just multiply the brightness of the HDR video with a factor of 2.

This doesn’t only mean that we can make SDR and HDR content fit together nicely on HDR screens, but it also means we now know what to do when we have HDR content on an SDR screen: We map the reference luminance from the video to SDR white on the screen. That’s of course not enough to make it look nice though…

Tone mapping

Especially with HDR presented on an SDR screen, but also on many HDR screens, it will happen that the content brightness exceeds the display capabilities. To handle this, starting with Plasma 6.2, whenever the HDR metadata of the content says it’s brighter than the display can go, KWin will apply tone mapping.

Doing this tone mapping in RGB can result in changing the content quite badly though. Let’s take a look by using the most simple “tone mapping” function there is, clipping. It just limits the red, green and blue values separately to the brightness that the screen can show.

If we have a pixel with the value [2.0, 0.0, 2.0] and a maximum brightness of 1.0, that gets mapped to [1.0, 0.0, 1.0] - which is the same purple, just in darker. But if the pixel has the values [2.0, 0.0, 1.0], then that gets mapped to [1.0, 0.0, 1.0], even though the source color was significantly more red!

To fix that, KWin’s tone mapping uses ICtCp. This is a color space developed by Dolby, in which the perceived brightness (aka Intensity) is separated from the chroma components (Ct = blue-yellow, Cp = red-green), which is perfect for tone mapping. KWin’s shaders thus transform the RGB content to ICtCp, apply a brightness mapping function to only the intensity component, and then convert back to RGB.

The result of that algorithm looks like this:

RGB clippingKWin 6.2’s tone mappingMPV’s tone mapping
HDR image with clippingHDR image with KWin's tonemappingHDR image with MPV's tone mapping

As you can see, there’s still some color changes going on in comparison to MPV’s algorithm; this is partially because the tone mapping curve still needs some more adjustments, and partially because we also still need to do similar mapping for colors that the screen can’t actually show. It’s already a large improvement though, and does better than the built-in tone mapping functionality in many HDR screens.

When tone mapping HDR content on SDR screens, we always end up reducing the brightness of the overall image, so that we have some brightness values to map the really bright highlights in the video to - otherwise everything just slightly over the reference luminance would look like an overexposed blob of color, as you can see in the “RGB clipping” image. There are ways around that though…

HDR on SDR laptop displays

To explain the reasoning behind this, it helps to first have a look at what even makes a display “HDR”. In many cases it’s just marketing nonsense, a label that’s put on displays to make them seem more fancy and desirable, but in others there’s an actual tangible benefit to it.

Let’s take OLED displays as an example, as it’s considered one of the display technologies where HDR really shines. When you drive an OLED at high brightness levels, it becomes quite inefficient, it draws a lot of power and generates a lot of heat. Both of these things can only be dealt with to a limited degree, so OLED displays can generally only be used with relatively low average brightness levels. They can go a lot brighter than the average in a small part of the screen though, and that’s why they benefit so much from HDR - you can show a scene that’s on average only 200 nits bright, with the sky in the image going up to 300 nits, the sun going up to 1000 nits and the ground only doing 150 nits.

Now let’s compare that to SDR laptop displays. In the case of most LCDs, you have a single backlight LED for the whole screen, and when you move the brightness slider, the power the backlight is driven at is changed. So there’s no way to make parts of the screen brighter than the rest on a hardware level… but that doesn’t mean there isn’t a way to do it in software!

When we want to show HDR content and the brightness slider is below 100%, KWin increases the backlight level to get a peak brightness that matches the relative peak brightness of that content (as far as that’s possible). At the same time it changes the colorspace description on the output to match that change: While the reference luminance stays the same, the maximum luminance of the transfer function gets increased in proportion to the increase in backlight brightness.

The results is that SDR white gets mapped to a reduced RGB value, which is at least supposed to exactly counteract the increase of brightness that we’re applying with the backlight, while HDR content that goes beyond the reference luminance gets to use the full brightness range.

Increasing the backlight power of course doesn’t come without downsides; black levels and power usage both get increased, so this is only ever active if there’s HDR content on the screen with valid HDR metadata that signals brightness levels going beyond the reference luminance.

As always, capturing HDR content with a phone camera is quite difficult, but I think you can at least sort of see the effect:

without backlight adjustmentwith backlight adjustment
without backlight adjustmentwith backlight adjustment

This feature has been merged into KWin’s git master branch and will be available on all laptop displays starting with Plasma 6.3. I really recommend trying it for yourself once it reaches your distribution!