Planet KDE

Subscribe to Planet KDE feed Planet KDE
Planet KDE | English
Updated: 4 hours 16 min ago

GitHub 2FA

Mon, 2023-03-20 19:00

GitHub is rolling out 2FA, and Calamares is one of the repositories I maintain there. Calamares seems like kind-of-important infrastructure for some things (e.g. Microsoft’s own Linux distro). Enabling 2FA was remarkably painless because I already had a bunch of 2FA stuff set up for KDE’s Invent. Invent is a GitLab instance and all-round more pleasant, frankly. Enabling 2FA was funny because the first thing FreeOTP (the 2FA authenticator I use) said was “weak crypto settings” when scanning the GitHub QR code. Good job, folks.

So Calamares is still on GitHub. Thanks to Kevin I’m reminded that GH is like an addiction. Also that there have been calls to leave GH for years. As a maintainer-with-no-time of a repo, there are still no concrete plans to move. KDE Invent still seems like a non-starter because of translations workflow.

Anyway, rest assured that the Calamares repo is now 2FA-safe. And that a 3.3 release will happen someday.

Categories: FLOSS Project Planets

My experience taking part in Season of KDE

Sat, 2023-03-18 10:23
My experience taking part in Season of KDE Background and motivations.

The year : 2020. Covid-19 has reached Europe, and a high-school student finds himself trapped home with a lot more free time than usual. So, of course, he spends the first week playing video games practically non-stop. However, he soon gets slightly bored by it, and begins to follow an online tutorial about programming in c++ with an introduction to the Qt framework.

Fast-forward to 2022. In the meantime, I had made the switch to Linux, and I had continued to make small c++/Qt programs in my free time. I decided that it would be nice to put my knowledge to practice, and do something useful for the community. KDE was a natural choice, as I really enjoy Plasma and the KDE apps, and I already had some experience with c++ and Qt.

What is Season of Kde ?

“Season of KDE is an outreach program hosted by the KDE community. The Season of KDE provides an opportunity for people to do mentored projects for KDE.”

- https://community.kde.org/SoK/About

The Adventure Begins !

The first challenge was to choose what to do. Coming from the outside, it is hard to know what projects are in active development, and where help is needed. This is one of the big advantages of SoK, as developers can submit project ideas, so mentees can just pick what interests them. However, I ultimately chose not to work on a proposed project, but to work on AudioTube. AudioTube is a YouTube Music client I had discovered a short while before, and which, most importantly, is in active development and I had some Ideas on features I could implement.

I got in touch with the developers and found some amazing persons who where willing to mentor my project, namely Jonah Brüchert, Carl Schwan and Devin Lin.

After having written the project proposal and set up a development environment, everything was ready to start !

The first merge request

I wanted to start with something simple. Adding the ability to remove songs from the playback history. Just adding an item to a popup menu and writing a small backend, what could be hard about that ? Wait, this application uses qml ? No widgets ?

qml crash-course

It turned out the ui side was still pretty easy, I just had to copy-paste some lines of code and change some keywords. The backend was a little bit more challenging, requiring some sql and a separate c++ class to handle when the menu item should be displayed, but nothing undoable

And then it was time to submit my first ever merge request (and getting aquainted with git and gitlab !).

Later merge requests

As a natural continuation to this first success, I began to work on making it possible to remove old search queries to the database. The search queries were handled by a model-view pattern. It turned out that the model was reset and reloaded every time a change was made to it, so I made it possible to change the model and the underlying database separately.

I also implemented a volume slider, a “clear playlist” button, the ability to play the favourite and most played songs as a playlist, enabled keyboard navigation of search propositions, and introduced support for the mpris standard, making it possible to control AudioTube from the system tray.

Useful lessons

If you hesitate to start contributing to an open source project because you have no previous experience in development, I can only encourage you to give it a shot. It isn’t really complicated. Also, it is very fun and there are lots of people who will gladly help you to get started. You might want to consider the following tips (most of them should also be valid outside of SoK and KDe) :

  • Start small. In the first merge request, you will need to get accustomed to many new tools and a new code base. So first make some small, easy changes to get the hang of it and gradually move to more complex, exiting new features.
  • When you encounter a new tool, learn only what you need for your current task. You don’t need to go through the whole git book before you can make your first contribution. If you learn only what you currently need, you’ll be able to get started much faster, and you can learn more every time you use that tool.
  • Don’t hesitate to ask for help. It is always good to try to solve problems yourself, but if you’re stuck somewhere, consider asking more experienced contributors. You’ll most probably learn something along the way.
  • If you want to start out in KDE, you’ll find useful information at https://community.kde.org/Get_Involved. Also, the #kde-welcome:kde.org matrix room is intended for new developers.
Closing thoughts

Getting new contributors is absolutely crucial for a healthy, long-living open source project. It is therefore important to make the onboarding process as easy as possible. Season of KDE achieves this by providing project ideas and facilitating the process of finding mentors to help. So, if you are already a contributor and have a nice idea for a project, please consider submitting it next year at SoK and maybe propose to mentor it. Or put it in the junior job list. And thanks for being patient with us newbies who make stupid mistake and ask obvious questions ;)
I also want to thank everybody who makes Season of KDE possible, especially my mentors.

Categories: FLOSS Project Planets

This week in KDE: “More Wayland fixes”

Fri, 2023-03-17 23:07

It’s become almost a running joke on Phoronix at this point, but this week we do indeed have more Wayland fixes! …And other things as well, including some good UI improvements to various KDE apps in addition to the background work of Qt 6 porting that is continuing full steam ahead, and reaching a position of increasing stability. Come see!

User Interface Improvements

Ark’s welcome screen is now richer with features, to be more like the one in Kate (Eugene Popov, Ark 23.04. Link):

Made a few UI improvements to Elisa, such as showing a “Quit” menu item in the hamburger menu when using the System Tray icon feature, correctly returning to the prior window state when exiting full screen mode, and resetting the playback position slider to the beginning when the playlist is manually cleared (Nikita Karpei and me: Nate Graham, Elisa 23.04. Link 1, link 2, and link 3)

Okular’s default toolbar layout has now been tweaked a bit, and now includes the “View Mode” menu by default and also shows the zoom and view buttons on the left side, with the tools on the right side (me: Nate Graham, Okular 23.04. Link 1 and link 2):

When “Fix it for me!”-style actions in the Samba sharing wizard fail, you’re now shown an appropriate error message explaining what went wrong (me: Nate Graham, kdenetwork-filesharing 23.08. Link)

Plasma now exposes global actions for “Restart” and “Shut Down” so you can add keyboard shortcuts to trigger them. We already had the “without confirmation” versions of these actions, but these new ones will ask for confirmation first (me: Nate Graham, Plasma 6.0. Link)

When importing VPN configurations, any errors are now shown in the UI so you can figure out what went wrong and maybe fix it yourself (Nicolas Fella, Plasma 5.27.3. Link)

While downloading new Flatpak apps, Discover now reports the status as “Downloading” correctly (Aleix Pol Gonzalez, Plasma 5.27.4. Link)

If your keyboard has an Emoji key, pressing it now opens the Emoji Picker window (Konrad Borowski, Plasma 5.27.4. Link)

Info Center has adopted a flattened sidebar structure so pages no longer live in sub-categories. This should make it easier and faster to access everything (Oliver Beard, Plasma 6.0. Link):

When you synchronize your Plasma settings to SDDM, it now also syncs the cursor size (me: Nate Graham, Plasma 6.0. Link)

We no longer misleadingly use Filelight’s icon for the 3rd-party GParted app in the Breeze icon theme (me: Nate Graham, Frameworks 5.105. Link)

Significant Bugfixes

(This is a curated list of e.g. HI and VHI priority bugs, Wayland showstoppers, major regressions, etc.)

Fixed a source of crashes in System Settings when importing VPN configuration files (Nicolas Fella, Plasma 5.27.3. Link)

Fixed another source of clipboard-related crashes in Plasma (Fushan Wen, Plasma 5.27.4. Link)

Significantly improved robustness of screen arrangements when using a multi-monitor setup that includes monitors with identical EDID values (Xaver Hugl, Plasma 5.27.3. Link)

Significantly improved robustness of Plasma containments’ mapping to screens when using multi-monitor setups (David Edmundson, Plasma 5.27.3. Link)

Fixed the way GTK apps scale themselves in the Plasma Wayland session when using multiple screens with different physical DPI values (Luca Bacci, Plasma 5.27.4. Link)

In the Plasma Wayland session, Plasma no longer quits (not crashes!) when an app sends a window title that’s wayyyyy too long (David Edmundson, Plasma 5.27.4. Link)

In the Plasma Wayland session, screen recording and Task Manager thumbnails now work properly for users of NVIDIA GPUs with the proprietary drivers (Jan Grulich, Plasma 5.27.4. Link)

Other bug-related information of interest:

Automation & Systematization

Added a UI test for Discover to test installing and uninstalling apps from the PackageKit backend (Harald Sitter. Link)

Changes not in KDE that affect KDE

In its native Wayland mode, Firefox no longer has an invisible animation that forces the screen to constantly repaint, causing KWin to unnecessarily consume excessive CPU resources (Emilio Cobos Álvarez, Firefox 113, Link)

…And everything else

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

How You Can Help

If you’re a user, upgrade to Plasma 5.27! If your distro doesn’t offer it and won’t anytime soon, consider switching to a different one that ships software closer to its developer’s schedules.

If you’re a developer, consider working on known Plasma 5.27 regressions! You might also want to check out our 15-Minute Bug Initiative. Working on these issues makes a big difference quickly!

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

And finally, KDE can’t work without financial support, so consider making a donation today! This stuff ain’t cheap and KDE e.V. has ambitious hiring goals. We can’t meet them without your generous donations!

Categories: FLOSS Project Planets

Web Review, Week 2023-11

Fri, 2023-03-17 07:51

Let’s go for my web review for the week 2023-11.

MoonRay Production Renderer

Tags: tech, foss, 3d, movie

This is a huge! DreamWorks Animation releasing its rendering pipeline as free software.

https://openmoonray.org/


Who reads your email?

Tags: tech, email, decentralized, self-hosting

This is very very centralized. No good surprise here unfortunately… and still email is really tough to fully self-host.

https://www.netmeister.org/blog/mx-diversity.html


Microsoft just laid off one of its responsible AI teams

Tags: tech, ai, microsoft, ethics, gpt

Well, people asking relevant questions slow you down obviously… since the goal about the latest set of generative models is to “move them into customers hands at a very high speed” this creates tension. Instead of slowing down they seem hell bent at throwing ethics out of the window.

https://www.platformer.news/p/microsoft-just-laid-off-one-of-its


GPT-4’s successes, and GPT-4’s failures - by Gary Marcus

Tags: tech, ai, gpt, ethics, science

The lack of transparency is staggering… this is purely about hype and at that point they’re not making any effort to push science forward anymore.

https://garymarcus.substack.com/p/gpt-4s-successes-and-gpt-4s-failures


Vim Best Practices For IDE Users

Tags: tech, tools, ide, vim

Very thorough overview of everything you can do with vim but also your IDE vim emulation.

https://betterprogramming.pub/50-vim-mode-tips-for-ide-users-f7b525a794b3


What a good debugger can do

Tags: tech, debugging, tools

I find debuggers to be underused at quite a few places. A shame when you see what they can do nowadays, and they keep improving!

https://werat.dev/blog/what-a-good-debugger-can-do/


Git Worktree: Enhance your Git Workflow

Tags: tech, tools, git

An often forgotten feature of git. That said it is very convenient when we need to juggle several branches at the same time. This can save some time and space.

https://www.dylanpaulus.com/posts/git-worktree


macige • mobile app CI workflow generator

Tags: tech, ci, mobile

Early days but could turn out useful when it gets more complete. Good way to easily have a CI pipeline targeting mobile platforms.

https://macige.tramline.app/


GitHub - huytd/comby-search: A code search tool based on Comby

Tags: tech, tools, refactoring

Looks like it completes Comby nicely for the search only case.

https://github.com/huytd/comby-search


Remote Synthesis | The Price Developers Pay for Loving Their Tools Too Much

Tags: tech, react, culture, tools

Excellent post about getting too invested in a single tool. We can loose flexibility in the process. Also in the case of React, I didn’t realize until now that half of the web developers have never known a time when React didn’t exist!

https://remotesynthesis.com/blog/the-price-of-developer-tools/


In Defense of Crusty Old Swiss Army Knives // Zach Goldstein

Tags: tech, django, htmx, react, frontend, backend

Nice exploration of Django + HTMX + web components for a CRUD use case. Interesting insights and highlights some of the limitations with HTMX.

https://zachgoldstein.engineering/posts/crusty-knives/crusty-knives/


Choose boring tools – Eduards Sizovs

Tags: tech, architecture, complexity

Definitely this. If it’s too fancy and fashionable you’re likely to pay it in later with the undue complexity it introduced.

https://sizovs.net/boring/


Debugging Architects - The Architect Elevator

Tags: tech, system, architecture, organization

Indeed, it’s important for architects to get their “hands dirty”. Organizations where it’s not the case prevent their architects to challenge their assumptions pushing them to stay in their ivory tower. It’s a good way for bad decisions to pile up over time.

https://architectelevator.com/transformation/debugging-architect/


Jade Rubick - Advice for new directors

Tags: tech, management

Interesting advises for higher management roles. The information gathering and the distorsion fields are key factors to have in mind to not loose perspective. Otherwise it’s when you’ll start doing more harm than good.

https://www.rubick.com/advice-for-new-directors/


Research: Do People Really Get Promoted to Their Level of Incompetence?

Tags: management, hr, career

Interesting, this seems to empirically confirm the Peter Principle, at least in sales. Also shows that companies are trying to workaround it. Dual career ladders seem to be an interesting path for this.

https://hbr.org/2018/03/research-do-people-really-get-promoted-to-their-level-of-incompetence


No heroes needed

Tags: tech, team, management, project-management

Definitely this as well. Having “heroes” brings obscurity and hide the problems, this prevents management from knowing and handling the issues. This also create lots of missed opportunities for collective learning and improvements.

https://rpadovani.com/no-heroes


Nearly 40% of software engineers will only work remotely | TechTarget

Tags: tech, remote-working, hr, hiring

The report is very US centric. Still it looks like the future standard for developer jobs will be more and more remote.

https://www.techtarget.com/searchhrsoftware/news/365531979/Nearly-40-of-software-engineers-will-only-work-remotely


See the First Complete Map of an Insect’s Brain | Smart News| Smithsonian Magazine

Tags: science, neuroscience

Very import milestone for brain mapping. Far from more complex animals of course and an insane amount of work each time. Still the common fruit fly is already revealing interesting new facts about neurology.

https://www.smithsonianmag.com/smart-news/see-the-first-complete-map-of-an-insects-brain-180981778/


Shoshikantetsu

Tags: culture, japan

Interesting japanese term. “Complete what was originally intended”. A few more proposed at this end of this short post.

https://asnewman.github.io/shoshikantetsu


Bye for now!

Categories: FLOSS Project Planets

A Big Thank You Community! KDE Snaps resumed and More.

Thu, 2023-03-16 18:07
Snowy Sunrise Witch Wells, Az

After my last post a few things have happened. First, I want to thank all of you for your support, monetary and moral. The open source community is amazing and I love being a part of it. We are surviving thanks to all of you. Despite my failed interview, a new door has opened up and I am happy to announce that Canonical is funding me to work part time for a period of 3 months on KDE Snaps! While not the full time role I was hoping for, I’ll take it, and who knows, maybe they will see just how awesome I am!

I started back to work on these last Tuesday. So far I have made good progress and even have a working Core22 snap!

Work done on upstream snapcraft ( tool used to make snaps ):

New content pack version, fixed an issue with snapcraft remote-build choking on part with /sdk, fixed regex as our naming scheme has changed:

https://github.com/snapcore/snapcraft/pull/4069

Ran into a new bug with snapcraft expand-extensions and so I must now enter all of this information manually into snapcraft.yaml until fixed, bug report here:

https://bugs.launchpad.net/snapcraft/+bug/2011719

And without further ado, our first core22 snap is Dragonplayer Version 22.12.3 available in the snap store. Many more coming soon!

KDE Dragon media player

With a new month upon us, I must ask for help again, I will not see any money for this work until next month. Please consider a dontation. Thank you from the bottom of our hearts.

https://gofund.me/c9cc02ed

Categories: FLOSS Project Planets

Qt Creator 10 RC released

Thu, 2023-03-16 07:29

We are happy to announce the release of Qt Creator 10 RC!

Categories: FLOSS Project Planets

Adapting Standard Usage Scenario Scripts For KDE Applications: My Journey As A Season Of KDE Mentee

Tue, 2023-03-14 20:00
My Journey into the KDE Community: From Season of KDE Application to Mentee

The notification about the Season of KDE program arrived like a ray of sunshine on a dreary day, and I eagerly clicked on it to see what opportunities it held. Amidst the many exciting project ideas, the Blue Angel Certification Preparation for KDE applications stood out to me as a challenge worth pursuing. I took the first step towards realizing my goal by engaging in a conversation with the community and making some initial contributions to FEEP. On January 24th, the selected candidates were announced. My heart was pounding as I scanned the list of names, and when I saw mine, I let out a cheer! Being accepted as a mentee in the KDE community was a great start to the year 2023. ✨

For the project, I will be using emulation tools such as xdotool and KDE Eco Tester to finish preparation of usage scenario scripts needed to measure KDE applications such as Kate and GCompris. To help guide my work, my mentor and I created a to-do list based on my proposed timeline and we selected the KDE infrastructure to manage the checklist of tasks. This was my first exposure to the diverse range of applications and platforms provided by KDE for the community. 🤌

Continuing Work on Standard Usage Scenarios

My first task was writing a brief summary of how the emulation tools work and explaining their usage. This summary was later added to the tools documentation in the FEEP repository. 📝

To prepare an application for Blue Angel eco-certification, I am continuing work on Karanjot Singh's Standard Usage Scenario (SUS) for Kate. For this work I am utilizing xdotool to execute the scenario, which runs a series of tasks considered typical when using this software. It is worth noting that the scripts to be executed should have a minimum duration of 5 minutes to meet the Blue Angel requirements.

When testing the existing script and obtaining the logs, I proposed that the manual efforts to determine the elapsed time could be automated. For this purpose I developed the KDE-SUS Log Formatter, which is currently under review at the FEEP repository. This was not originally included in the to-do list, but my mentor and I recognized the tool's significance in simplifying the documentation process and I proceeded to develop it. 💻

Figure : Running the Kate usage scenario. (Image from Rudraksh Karpe published under a CC-BY-SA-4.0 license.)

🎉 We then set our sights on the KDE Eco Tester tool and the SUS for Gcompris, a versatile educational software suite for children. To accomplish this, I first learned more about the tool, which is developed by KDE Eco contributors Emmanuel Charruau, Karanjot Singh, and now Mohamed Ibrahim, the mentee for the KDE Eco Tester project in SoK23. The tool provides an easy and robust emulation tool based on xdotool. With KDE Eco Tester I am adapting the existing SUS for GCompris in order to make the script at least five minutes long while representing typical usage of the app. I plan to update Kate's usage scenario to also be scripted using KDE Eco Tester. In the process, I will provide feedback on the tool's usability and user experience to the developers.

Although the work is still ongoing, I have encountered some challenges along the way. I am facing challenges such as resizing the GCompris window to 830x830, and when running the old SUS script dealing with UI changes from a GCompris update. We also discovered that the response time for some actions can be slow, which causes problems when running the script. Thanks to the help of Emmanuel and Mohamed, we were able to identify and address these challenges, and the project is continuing to move forward. A special thank you goes out to Mohamed for his valuable contributions and support as I work on GCompris! Below is a GIF demonstrating the tasks being tested using KDE Eco Tester for GCompris.

Figure : Running the GCompris usage scenario. (Image from Rudraksh Karpe published under a CC-BY-SA-4.0 license.)

Working with KDE has been a pleasure. Everyone has been kind, knowledgeable, and supportive throughout the process, making my journey a smooth and enjoyable one. I am determined to overcome the challenges and provide a detailed account of my experience in upcoming blog posts. ☀️

Stay tuned!

Categories: FLOSS Project Planets

KBibTeX 0.9.3.2 released

Tue, 2023-03-14 15:56

KBibTeX 0.9.3.2 got released, tar-balls are available at KDE’s download mirrors. This is the last release of the 0.9.x branch. Next is 0.10, where I will prepare release candidate tar-balls in the next few days and hopefully we will see a final release 0.10.0 this Spring.

A number of issues got fixed, including but not limited to:

  • Bugs 463398, 459150, 464607, and 464606.
  • Various online searches got revamped and should work again.
  • Building against newer Qt versions (thanks to Albert Astals Cid)

See the full ChangeLog for all the details.

Some spoilers about what is happening in the ‘master’ branch: I have been working on an exporter to Microsoft Word’s bibliography XML. Writing scientific manuscripts with references in Word is a painful experience, but this exporter allows you to continue to use your favorite BibTeX editor even under dire circumstances.

Categories: FLOSS Project Planets

KDE Plasma 5.27.3, Bugfix Release for March

Mon, 2023-03-13 20:00

Tuesday, 14 March 2023. Today KDE releases a bugfix update to KDE Plasma 5, versioned 5.27.3.

Plasma 5.27 was released in February 2023 with many feature refinements and new modules to complete the desktop experience.

This release adds two weeks' worth of new translations and fixes from KDE's contributors. The bugfixes are typically small but important and include:

  • Dr Konqi: Add emoji picker to mappings. Commit.
  • Klipper: remove duplicate items when loading from history. Commit. Fixes bug #466236. See bug #465225
  • Powerdevil: Suspend by default on AC profile. Commit.
View full changelog
Categories: FLOSS Project Planets

digiKam 7.10.0 is released

Sun, 2023-03-12 20:00
Dear digiKam fans and users, After three months of active maintenance and other bugs triage, the digiKam team is proud to present version 7.10.0 of its open source digital photo manager. See below the list of most important features coming with this release. Bundles Internal Component Updates As with the previous releases, we take care about upgrading the internal components from the Bundles. Microsoft Windows Installer, Apple macOS Package, and Linux AppImage binaries now hosts:
Categories: FLOSS Project Planets

FreeBSD 12.3 EoL

Sat, 2023-03-11 18:00

FreeBSD 12 is the “previous” series of releases. FreeBSD 13 is the “stable” series as of today (march 2023) and FreeBSD 14 is “current”, e.g. upcoming somewhen. The major versions of FreeBSD tend to bring larger changes – such as a newer base compiler, or a sudden improvement in system header-file compatibility. The previous series releases use clang 13, for instance, while stable uses clang 14. FreeBSD 12 is poorly supported by the KDE-FreeBSD team, and that’s on purpose.

Chasing compiler versions, and more importantly, C++ standard library versions, is frustrating work. Maintaining backwards compatibility has real costs – especially when most of KDE development is done with some recent gcc on Linux.

Case in point is qxmpp, which does not build on FreeBSD 12.3, like so:

src/client/QXmppHttpFileSharingProvider.cpp:163:90: error: no viable constructor or deduction guide for deduction of template arguments of 'weak_ptr' QObject::connect(state->upload.get(), &QXmppHttpUpload::progressChanged, [stateRef = std::weak_ptr(state), reportProgress = std::move(reportProgress)]()

The error message is re-formatted a little for readability, but it comes down to a lambda with a binding not being able to deduce some type. Chasing that means building and re-building and applying some serious C++ knowledge to the qxmpp codebase.

Building the same code on FreeBSD 12.4 “just works”. The STL has been updated, and so we reach the situation that the cheapest (in terms of developer time on the KDE-FreeBSD team) and easiest way to deal with this problem is just to say:

FreeBSD 12.3 is no longer supported by the KDE-FreeBSD team. Update to 12.4 or 13.1 or later.

For what it’s worth, there are similar problems with STL versioning with libquotient (tuple constructor) and nheko (no concepts header). Right now, that means that we are actively declaring older OS releases as “unsupported” in order to keep the maintainence burden (particularly: developing new patches specifically for older FreeBSD + clang versions which upstream is unlikely to find interesting) low.

Categories: FLOSS Project Planets

This week in KDE: Qt apps survive the Wayland compositor crashing

Sat, 2023-03-11 00:07

Thanks to the heroic work of David Edmundson, Qt apps (including all KDE software) in Plasma 6 will now survive when the Wayland compositor crashes! This is huge! And work is ongoing to add this functionality to other common app toolkits, such as GTK.

Beyond that, Plasma 6 porting work continues, with more and more people using it daily. Not me yet, because I’m a scaredy-cat about this kind of instability and am waiting for it to converge a bit more But hopefully soon! Meanwhile, check out what else happened:

New Features

Konsole Now works on Windows! In addition to making the app possible to potentially distribute on Windows, this means that Windows-distributed KDE apps that have an embedded Konsole view like Kate can now actually embed Konsole itself, instead of an inferior terminal view (Waqar Ahmed and Christoph Cullmann, Konsole and Kate 23.04. Link 1 and Link 2)

It’s now possible to configure the Kickoff Application Launcher to use a grid layout for everything, not just the Favorites view (Tanbir Jishan, Plasma 6.0. Link):

User Interface Improvements

Spectacle now always shows a notification when taking a background-mode rectangular region screenshot (with Meta+Shift+PrintScreen by default) and also no longer quits if its main window happened to be open while any such notification disappears (Noah Davis, Spectacle 23.04. Link 1 and link 2)

For new users (not existing users), the system will now sleep after 15 minutes of inactivity by default, and will generate correct power profiles for convertible laptops (Plasma 5.27.3, me: Nate Graham, Link 1 and link 2)

On Discover’s app pages, the rows of buttons now become columns for narrow windows or the mobile interface, and their layout is streamlined and improved as well (Emil Velikov, Plasma 5.27.3. Link):

Welcome Center now has a mobile-friendly layout. The content itself is still fairly desktop-focused, but this will soon change as well! (me: Nate Graham, Plasma 6.0. Link):

In the Plasma Wayland Session, the Ctrl+Alt+Scroll up/down shortcut that switches virtual desktops has been changed to Meta+Alt+Scroll up/down to avoid blocking app-specific shortcuts and also generally comply with the standard that global actions use the Meta key (me: Nate Graham, Plasma 6.0. Link)

Improved how the SDDM login screen works with a touchscreen in the Plasma Wayland session: touch input works at all, tapping the Virtual Keyboard button now opens it, and the keyboard layout list can now be scrolled with a swipe (Aleix Pol Gonzalez and me: Nate Graham, Plasma 5.27.3 and Frameworks 5.104. Link 1, link 2, and link 3)

Significant Bugfixes

(This is a curated list of e.g. HI and VHI priority bugs, Wayland showstoppers, major regressions, etc.)

KRuler now works properly on Wayland, and can now be moved or resized like on X11 (Shenleban Tongying, KRuler 23.04. Link)

Fixed another way the powerdevil power management subsystem could crash with certain multi-screen setups (Aleix Pol Gonzalez, Plasma 5.27.3. Link)

Fixes a way that apps could crash in the Plasma Wayland session when a display goes to sleep (Aleix Pol Gonzalez, Plasma 5.27.3. Link)

Night Color now works on ARM-powered devices that don’t support “Gamma LUTs” but do support “Color Transform Matrices”! It still doesn’t work on NVIDIA GPUs because they don’t support either of them (Vlad Zahorodnii, Plasma 5.27.3. Link)

Red and blue color channels are no longer sometimes swapped while screencasting in the Plasma Wayland session (Aleix Pol Gonzalez, Plasma 5.27.3. Link)

Image buttons in Breeze-themed GTK apps are now displayed correctly (Janet Blackquill, Plasma 5.27.3. Link)

Fixed two major crashes in Plasma related to actions that would show window thumbnails in the Task Manager (Fushan Wen, Frameworks 5.104. Link)

When using KDE apps outside of Plasma, they should no longer get a weird color scheme that interferes with the color scheme set by the target platform (Jan Grulich, Frameworks 5.105. Link)

Other bug-related information of interest:

Automation & Systematization

Re-organized https://develop.kde.org/docs to have a more straightforward structure and make it easier to find stuff (Carl Schwan. Link)

Wrote some documentation about KRunner metadata (Alexander Lohnau, Link)

Web Presence

https://kde.org/for/scientists is now live! This web page showcases the best KDE software to use for professional, technical, scientific purposes, including by NASA and Barcalona’s ALBA Synchrotron.

https://develop.kde.org/frameworks/kirigami has been overhauled to showcase the latest state-of-the-art in KDE’s Kirigami app development framework:

Thanks to Carl Schwan, the KDE Promo team, and many others for making these impactful changes happen!

…And everything else

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

How You Can Help

If you’re a user, upgrade to Plasma 5.27! If your distro doesn’t offer it and won’t anytime soon, consider switching to a different one that ships software closer to its developer’s schedules.

If you’re a developer, consider working on known Plasma 5.27 regressions! You might also want to check out our 15-Minute Bug Initiative. Working on these issues makes a big difference quickly!

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

And finally, KDE can’t work without financial support, so consider making a donation today! This stuff ain’t cheap and KDE e.V. has ambitious hiring goals. We can’t meet them without your generous donations!

Categories: FLOSS Project Planets

KDE Ships Frameworks 5.104.0

Fri, 2023-03-10 19:00

Saturday, 11 March 2023

KDE today announces the release of KDE Frameworks 5.104.0.

KDE Frameworks are 83 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
  • extactor: add KAboutData
Breeze Icons
  • Add draw-number
Extra CMake Modules
  • Load translations for application-specific language also on Win and Mac (bug 464694)
  • ECMGenerateExportHeader: fix duplicated addition of deprecation macros code
  • Find wayland.xml from wayland-scanner.pc
KConfig
  • Don't include screen connector names in screen position/size data (bug 460260)
  • Fix multimonitor window size restoration (bug 460260)
  • Sort connector names for multi-screen size/position keys (bug 460260)
KConfigWidgets
  • KConfigDialogManager: Fix logs formatting
KCoreAddons
  • Deprecate KPluginMetaData::initialPreference
  • Convert BugReportUrl in desktoptojson (bug 464600)
  • exportUrlsToPortal: stop fusing remote urls (bug 457529)
  • Show deprecation warning about desktoptojson tool
KDeclarative
  • Guard nullable property access, and bind instead of assigning once
  • AbstractKCM: Rewrite padding expressions to be more readable
  • Add import aliases, bump internal import versions as needed
  • Drop unused QML imports
  • [managedconfigmodule] Fix deprecation comments
  • [configmodule] Deprecate constructor without metadata
  • [configmodule] Deprecate setAboutData
KDocTools
  • Install version header
KFileMetaData
  • Mobi extractor: only extract what is asked (bug 465006)
KGlobalAccel
  • Skip reloading global registry settings instead of asserting
KHolidays
  • Add holidays for Dominican Rebublic (bug 324683)
  • Kf5 add cuba holidays (bug 461282)
  • holidayregion variable 'regionCode' shadows outer function
KI18n
  • KI18nLocaleData target: add include dir for version header to interface
  • Load translations for application-specific language also on Win and Mac (bug 464694)
KIconThemes
  • Properly mark panel icon group as deprecated
  • Deprecate KIconLoader overloads in KIconButton and KIconDialog
KIdleTime
  • wayland: Guard wayland object destructors (bug 465801)
KIO
  • DeleteOrTrashJob: when trashing a file in trash:/ delete it instead (bug 459545)
  • Set bug report URL for Windows Shares KCM (bug 464600)
  • OpenFileManagerWindowJob: fix opening multiple instances under Wayland [KF5] (bug 463931)
  • Add missing URLs in KCMs for reporting bugs (bug 464600)
  • kshorturifilter: return directly if cmd is empty
  • [kprocessrunner] Use aliased desktop file name for xdg-activation
Kirigami
  • Dialog: Don't let user interact with footer during transitions
  • For styling and recoloring, use down property instead of pressed
  • Fix mistyping of Kirigami.Settings.isMobile
KItemModels
  • KDescendantProxyModel: Do not remove indexes from mapping before announcing the removal
KNewStuff
  • DownloadItemsSheet: Fix scrolling (bug 448800)
KPackage Framework
  • Check pluginId contains '/' before using it as package type (bug 449727)
KPeople
  • Install version header
KRunner
  • KF5KRunnerMacros: Add compat code and warning for in KF6 renamed configure_krunner_test macro
KService
  • Fix deprecation ifdef
  • Deprecate KService::serviceTypes and KService::hasServiceType
  • application: Add X-SnapInstanceName
  • Add method to query supported protocols for a service
KTextEditor
  • Improve cstyle performance (bug 466531)
  • Improve performance of rendering spaces with dyn wrap disabled (bug 465841)
  • documentSaveCopyAs: Use async job api (bug 466571)
  • Optimize rendering spaces with dyn wrapping (bug 465841)
KWindowSystem
  • Remove extra semicolon
  • Deprecated KWindowSystem::allowExternalProcessWindowActivation
  • [kstartupinfo] Deprecate setWindowStartupId
  • [kstartupinfo] Deprecate KStartupInfo::currentStartupIdEnv
  • [kstartupinfo] Fix API docs for currentStartupIdEnv
NetworkManagerQt
  • settings: fix -Wlto-type-mismatch in NetworkManager::checkVersion decl
Prison
  • KPrisonScanner target: add include dir for version header to interface
Purpose
  • Place Purpose::Menu headers into C++ namespace subdir, w/ compat headers
QQC2StyleBridge
  • ProgressBar: Pause indeterminate animation when invisible
  • Added flat combobox without outline unless hovered
  • TextField: Fix password-protection code from affecting normal text fields (bug 453828)
  • Drawer: Fix RTL by copying sizing code from upstream Default style
  • Drawer: Use simpler sizing expressions from upstream Default style
  • Don't check for selectByMouse on a non-existent root for TextArea
  • use again the palette coming from Kirigami.Theme (bug 465054)
  • Only enable TextArea context menu when able to select by mouse
Security information

The released code has been GPG-signed using the following key: pub rsa2048/58D0EE648A48B3BB 2016-09-05 David Faure faure@kde.org Primary key fingerprint: 53E6 B47B 45CE A3E0 D5B7 4577 58D0 EE64 8A48 B3BB

Categories: FLOSS Project Planets

KDE Gear 23.04 branches created

Fri, 2023-03-10 15:27

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

We're already past the dependency freeze.

The Feature Freeze and Beta is next week Thursday 16 of March.

More interesting dates  
  March 30: 23.04 RC (23.03.90) Tagging and Release
  April 13: 23.04 Tagging
  April 20: 23.04 Release

https://community.kde.org/Schedules/KDE_Gear_23.04_Schedule

Categories: FLOSS Project Planets

Web Review, Week 2023-10

Fri, 2023-03-10 07:24

Let’s go for my web review for the week 2023-10.

You Are Not a Parrot And a chatbot is not a human. And a linguist named Emily M. Bender is very worried what will happen when we forget this.

Tags: tech, ai, gpt, machine-learning, cognition, linguistics, politics, ecology, ethics

This is an excellent piece. Very nice portrait of Emily M. Bender a really gifted computational linguist and really bad ass if you ask me. She’s out there asking all the difficult questions about the current moment regarding large language models and so far the answers are (I find) disappointing. We collectively seem to be way too fascinated by the shiny new toy and the business opportunities to pay really attention to the impact on the social fabric of all of this.

https://nymag.com/intelligencer/article/ai-artificial-intelligence-chatbots-emily-m-bender.html


Did You Miss My Comment or What? Understanding Toxicity in Open Source Discussions

Tags: tech, sociology, foss, github

Early days for this type of research so a couple of limitations to keep in mind while reading this paper. Most notably: rather small sample explored (it’s a qualitative study) and tends to conflate GitHub with “the Open Source community”. The later especially matters since the vibe can be very different outside of GitHub. That being said, very interesting findings in there. Some validate my experience with GitHub. It’s clear that compared to other spaces there’s much more entitlement behavior from some people. Interestingly the words seem on average less violent (although it does happen of course) than in other platforms… still this is important to keep in check since it could have implication toward prospective contributors. The last point in their discussion section is promising. Some of the current manual interventions from maintainers seem to have good results (encouraging) and it seems possible to at least semi-automate the handling of toxic comments which could help with maintainers well-being.

https://cmustrudel.github.io/papers/osstoxicity22.pdf


diziet | Never use git submodules

Tags: tech, git, tools

I tend to agree with this quite a lot. Git submodules tend to create lots of strange issues and rather bad developer experience. Even worse it’s not necessarily spotted straight away, you notice the real pains only after having invested in it quite a bit. There are alternatives worth exploring though.

https://diziet.dreamwidth.org/14666.html


Safety and Soundness in Rust

Tags: tech, rust, safety

People tend to be fixated on the “unsafe” keyword and assuming not using it will make their code devoid of memory safety bugs. Well, it’s a bit more subtle than this. It helps you know where such bugs can hide but it can’t completely prevent them all the way down the stack.

https://jacko.io/safety_and_soundness.html


Indices point between elements - Made of Bugs

Tags: tech, programming

Neat way to think about array indices, if it was widespread it would simplify a few things in documentations I think.

https://blog.nelhage.com/2015/08/indices-point-between-elements/


A discussion between Casey Muratori and Robert C. Martin about Clean Code

Tags: tech, architecture, performance, craftsmanship

Very interesting conversation between Uncle Bob and one of the recent critics of his work regarding performance. I like how he admits some faults in the way he presents things and try to improve for later rather than trying to be right. Some people should learn from that. There’s clearly a tension between performance and what is described in Clean Code, it’d be pointless to deny it.

https://github.com/unclebob/cmuratori-discussion/blob/main/cleancodeqa.md


An Alternative to Dependency Injection Frameworks – Software the Hard way

Tags: tech, architecture, complexity, java

Indeed, in some type of projects people tend to turn to Dependency Injection Frameworks a bit blindly (especially true in the Java world). Still there are other patterns which give similar benefits without less headaches. That’s worth investigating if this fits your context before picking up a framework.

https://software.rajivprab.com/2018/11/06/an-alternative-to-dependency-injection-frameworks/


Why You Should Send a Weekly Summary Email | by Jens-Fabian Goetzmann | Feb, 2023 | Medium

Tags: tech, organization, team, note-taking

The advice is sound. Having more written records of such things definitely help teams. It can have a benefit in other forms (notes or todo’s) if you do it just for you.

https://jefago.medium.com/why-you-should-send-a-weekly-summary-email-1c556149ed42


How to hire engineering talent without the BS · Jesal Gadhia

Tags: tech, hr, interviews

Hiring and interview isn’t simple. There are good advises in this piece. In particular I strongly agree with the fact that leet coding is probably not it and that having something guided and scripted it necessary.

https://jes.al/2023/03/how-to-hire-engineering-talent-without-the-bs/


Want an unfair advantage in your tech career? Consume content meant for other roles

Tags: tech, management, empathy, culture, team, learning

This is definitely a worthy advice with lots of interesting side effects. For me the main motive beyond cheer curiosity is developing more empathy towards others with different roles.

https://matthewgrohman.substack.com/p/want-an-unfair-advantage-in-your


The Lost Art of Lacing Cable - The Broadcast Bridge - Connecting IT to Broadcast

Tags: tech, networking, history, culture

Fascinating old school way to manage cables. And indeed the result looks pretty as well.

https://www.thebroadcastbridge.com/content/entry/12400/the-lost-art-of-lacing-cable


Bye for now!

Categories: FLOSS Project Planets

Porting away from gbm_surface

Thu, 2023-03-09 19:00

Until recently, the drm backend of KWin used gbm_surfaces for getting buffers to display on the screen. This is a relatively simple API that allows to extend what one can do with a EGL surfaces - you get to directly choose buffer format and modifiers and you get a gbm buffer after rendering a frame, which you can then use with the drm API to actually get the image on the screen.

This also has a few drawbacks however:

  • instead of being able to directly allocate a buffer, the backend has to render something first. While simply clearing the image counts as rendering, it causes unnecessary overhead
  • the buffer allocation code for EGL can’t be re-used for CPU or Vulkan rendering
  • in order to create buffers after startup you need to create the rendering backends first
  • it locks us to a maximum of allocated buffers decided by the EGL implementation (usually 4), which gets in the way of zero copy screencasting
  • if the egl context is switched during rendering, eglSwapBuffers fails, so the rendering code needs to ensure this never happens. KWin doesn’t have a 100% perfect track record for this though, which caused some fatal bugs with the Klassy window decoration

So instead of continuing to use gbm_surface, we decided to allocate buffers manually, import them into EGL as an EGLImage and use that as the color attachment for a fbo to render into. Sounds relatively simple, and it is. The problems were elsewhere…

EGL_KHR_partial_update

Before even starting to port anything, there is one advantage to gbm_surfaces that I left out before and which was a blocker for a long time: You can use EGL_KHR_partial_update to optimize which parts of the buffer are loaded into the GPU when rendering. This is irrelevant (and not implemented) for desktop GPUs but can yield significant power savings for some intergrated GPUs found in phones and tablets. As EGL_KHR_partial_update only works for EGL surfaces and no equivalent for fbos exists, using our own buffer management would drop support for this optimization.

How much improvement this extension actually yields was and still is not well known, some guesstimations by experts and very unscientific tests showed that its impact is very low though. So we made the decision to drop support for it, at least until an alternative for fbos is created.

Coordinate systems

After porting everything to use the directly allocated gbm buffers, an issue turned up that took an annoyingly long time to fix: mismatching coordinate systems.

There’s a few coordinate systems when concerning yourself with rendering, but the one that matters in this case is the one at the very end of the rendering pipeline - screen space coordinates. In OpenGL, this coordinate system has the origin in the bottom left of the screen, with the X axis pointing to the right and the Y axis pointing up, but for pretty much everything else, including drm, the Y axis is pointing down, with the origin in the top left.

This wouldn’t be a problem on its own, but when using the EGL surface the rendering is automatically transformed to yield the results one would expect with the OpenGL coordinate system. For fbos though, Mesa can’t know what it’s used for, so this no longer applied. The result was that when I started KWin with the changes applied, everything was mirrored upside down.

In most rendering systems (like in games) this wouldn’t be a problem. Nearly all rendering code uses a so-called projection matrix, which can do arbitrary transformations on the rendered geometry, like mirroring or rotating the whole screen. KWin uses this too, and adjusting it to do this is very easy. This mostly worked, but that mostly is doing a lot of heavy lifting in this sentence… KWin has a lot of optimizations to limit rendering to specific parts of the buffer, to reduce power use when only part of the screen changes. These optimizations mainly use glScissor and glBlitFramebuffer that both work in screen space coordinates, which meant that with the buffer being mirrored, they now referred to the wrong part of the screen.

Global state

Before being able to properly fix it, there was one big problem: Some viewport, scale and now Y axis mirroring information was globally accessed state. During a compositing cycle, some effects render windows or the complete screen into an offscreen texture to use later, so this now became a big problem, with some effects suddenly rendering upside down into their offscreen texture. To fix this, I changed effects to explicitly pass a RenderTarget and a ViewPort object in all painting methods, which carry the relevant information. When an effect wants to override the properties now, it just creates its own RenderTarget and ViewPort and passes that to rendering methods instead of having to deal with global state, both fixing the problem and making the APIs a little bit more predictable.

The blur effect

With a few effects, some of their rendering was mirrored even after adjusting the projection matrix, because they created their own projection matrices or did more complex stuff. For fixing the blur effect specifically however, I first needed to understand how it actually worked. It’s not the most straightforward code, but on a high level it turned out to be not that complicated:

  1. copy the part of the screen that needs to be blurred to the matching area of an offscreen texture
  2. with a shader, copy that to the matching area on a smaller offscreen texture. Repeat with even smaller textures for higher levels of blur
  3. do (2) again but copy from the smaller textures to the bigger ones again, and with a different shader that’s better suited for this direction
  4. copy the final result from the offscreen texture to the screen

The important bit is that this needs to do a lot of rendering into different coordinate spaces. This was made worse by it doing two stupid things that I ported away from first:

  • it used one big texture for all screens, rather than using one per screen. This was mostly a relic from X11 times and required some additional transformations to watch out for, plus unnecessary additional VRAM usage with many multi monitor layouts
  • it uploaded the same geometry with different scaling multiple times… just to then use multiple different projection matrices to undo that scaling again

The copying in step (1) was done using glBlitFramebuffer, which luckily is able to do mirroring for us. However, for reasons I’ll get to in a moment, a different approach turned out to be better: As we’re managing buffers ourselves, we also get a texture to read from, instead of only having the default framebuffer when using EGL surfaces. So to do this copy I could now adapt the code to just render a rectangle with the texture of the screen, and apply any arbitrary transformations while doing that. Once this was wired up and steps 2-4 were adjusted to use fitting projection matrices, the blur effect worked fine again.

Screen rotation

This might seem a bit off-topic in this post at first, but with the different approach with the blur effect, porting away from gbm_surface managed to bring up another advantage. Before doing this, when a screen was rotated, KWin would do one of the following:

  1. tell the display hardware to rotate the buffer on its own (hardware rotation)
  2. render into an offscreen texture, then render the texture rotated to the screen

Hardware rotation isn’t always possible though as not all hardware can do all transformations, and in the past it was also riddled with bugs on the driver side, meaning we couldn’t have it be enabled by default. So in practice, if your screen was rotated, KWin would do an extra fullscreen copy of the whole screen every single time it rendered to apply the rotation. This is neither efficient nor good for performance.

There is one possible third way to handle this rotation though: Have KWin directly apply the rotation when rendering, just like when dealing with the mirrored Y axis. Actually making this work required a lot of debugging, especially for the blur effect and for screen casting, but starting with Plasma 6, the mentioned fullscreen copy for compositing will be gone.

Note that hardware rotation is still relevant even with this optimization, as it allows doing direct scanout with a rotated screen. This is relatively important for performance and battery life on devices with rotated screens, like the Steam Deck.

Going forward

The long term plan is to make the backends exclusively deal with buffers and never interact with graphics APIs. At the moment the existing support for Xorg makes that impossible to do well, but with plans to split the code base for X11 and Wayland and eventually remove support for Xorg entirely, this will change. Even without that however, there’s a bunch of code in the backends that has the potential to be shared and simplified with this change, and a few features that can be implemented easier or at all, like the already mentioned zero copy screencasting.

Categories: FLOSS Project Planets

How platform integration in Qt/KDE apps works

Thu, 2023-03-09 15:00

There has been some recent discussions about how KDE applications (or Qt apps in general) should look and feel like outside of the Plasma desktop, particularly in a GNOME environment.

During this discussion I noticed two major disconnects between the involved parties. One of them is technical in nature, where (understandably) not everyone involved has deep knowledge about how Qt and KDE apps work. The other one is cultural in nature, where there’s opposing views about who gets to decide how an application should look and feel like on a given platform.

I can’t do much about the cultural issue, but I can help the conversation by giving some much needed overview of how any of this works on a technical level. Everyone being on the same page technically could help foster a more productive conversation about this complex topic.

First of all it’s important to note that Qt to its core is an abstraction across various plaforms (most important here are Linux, Windows, and macOS, but also to some degree Android and iOS). Whenever possible Qt tries to use the platform’s native facilities to do anything, whether that’s rendering, file dialogs, widget styles etc. This becomes somewhat messy when you consider that “Linux” isn’t exaclty a single, well-defined “platform”. Qt does usually have non-native fallbacks for things like file dialogs and widget styles, but they aren’t necessarily something you want a user to have to see. It’s also important to mention that Qt has two somewhat competing ways of defining UIs, the traditional QtWidgets, and the more recent QtQuick/QML.

There are several somewhat independent pieces involved in how a Qt application looks and feels. Jan Grulich already talked about some of them in the context of GNOME and QGnomePlatform, but there are also things specific to KDE applications that aren’t mentioned.

The first piece is the “Qt Platform Theme (QPT)”. Despite the name it doesn’t have much to do with the visual style. It is responsible for applying settings from the platforms. This for example includes font settings, the double click interval, or whether a file should be openend on single or double click. It also defines how standard dialogs look like, most importantly the file picker dialog, but also dialogs like a color picker. Third, it defines the color palette (QPalette) the application is using. More on that later. Qt itself ships platform themes for non-Linux platforms as well as somewhat generic Linux platform themes for GNOME and Plasma. Notable out-of-tree plugin exist, like plasma-integration which you are using right now if you are on Plasma, the aforementioned QGnomePlatform targeted towards GNOME (and to some degree similar environments), and qt5ct, which isn’t aligned to a specific environment and provides generic control over platformtheme things.

The second, and perhaps most well-known, knob is the widgets style (also called QStyle). It controls the majority of the appearance of a QtWidgets application. Well-known examples include Breeze (the current Plasma default), Oxygen (the KDE4-default), adwaita-qt, as well as built-in styles for Windows/macOS. Qt also comes with a built-in Fusion style. QStyles are implemented using C++ plugins. Whenever the app needs to render some piece of UI, e.g. a button, it defers that to the style plugin. Some style, like e.g. Windows then use platform native APIs to render widgets, others like Breeze draw the widgets from scratch. Application developers can also include custom styles for complete control over the appearance.

The third important concept is QPalette. A QPalette is a set of colors used to draw UI elements. The palette is defined by the platform theme(!). For example Plasma uses this to apply the color scheme set in System Settings. QGnomePlatform uses it to apply Adwaita-like colors. The selected QStyle may (or may not!) use this palette when drawing controls. The application developer can also manually query colors from the palette for drawing custom widgets while still respecting the platform’s wanted colors. A platform theme may only offer a single palette this way, or include light and dark variants, or allow the user to configure arbitrary color sets (like we do on Plasma). It is also possible for application developers to override the system-provided palette, for example to offer an in-app dark mode switch.

For applications using QML there is another relevant component: The Qt Quick Controls 2 Style. For reasons I’m not going to go into QtQuick Controls don’t use QStyle for their styling. Instead they come with their own stying system, which is itself based on QML. In Qt5 QML apps only have a very basic and broken default theme that should never be used. In Qt6 they use Fusion by default.

These are the relevant knobs every Qt app has. Some app developers choose to use them to control the appearance of their apps themselves, but many others leave it to the environment to apply a suitable look and feel. Furthermore, there are some relevant KDE-additions to this that are important to understand.

One such addition is KColorScheme. You can think of KColorScheme as a superset of QPalette, i.e. it provides additonal color roles and thus finer-grained control over colors. When changing the Colors setting in Plasma’s System Settings you are picking a color scheme. This gets applied to QPalette via the plasma-integration QPT, but can also be queried directly by the application developer for custom painting. Contrary to QPalette a KColorScheme is not porgrammatically filled based on plaform values (that happens only on Plasma), but it is a static, textual list of colors. Here we have the first problem for running KDE applications under e.g. GNOME. When running a KDE app on GNOME QGnomePlatform will apply Adwaita colors using QPalette. However, this does not affect colors the application directly pulls from KColorScheme, which unless explicitly configured has a default that resembles Breeze. This means we get mixtures of two different color sets, giving unpleasant results. This is especially noticeable when using a dark system theme combined with the light default colors from KColorScheme.

How do we solve this? Well, I’ve been banging my head against that problem for a while. Short of removing the concept of KColorScheme entirely I see two realistic options, not necessarily mutually exclusive. QGnomePlatform could create a KColorScheme definition with Adwaita-like colors and apply that to the application. If exuted correctly it would likely give very good results, but obviously only on platforms that use QGnomePlatform. The other option would be to programmatically derive a KColorScheme definition from a QPalette, which is likely much harder because KColorScheme is a superset of QPalette, but it would be a generic solution for all platforms.

The second noteworthy thing for KDE applications affects QML apps in particular. I’ve mentioned that QML has a separate theming system compared to QtWidgets. Because maintaining two style definitions for different systems is no joy KDE maintains a “hack” around this. qqc2-desktop-style implements a Qt Quick Controls style that fetches style information from a QStyle, which means all the existing QStyles out there keep working for QML apps. It works amazingly well, until it doesn’t. One of the shortcomings of this approach is that qqc2-desktop-style internally heavily relies on KColorScheme, which makes the aforementioned mismatch between QPalette and KColorScheme much more prominent. Possible solutions are the same as mentioned before.

I hope this gives some much needed overview over technology and terminology of involved components and helps with a productive way forward with addressing the problems we have. You are welcome to join this discussion. There’s some other relevant things to talk about, like icon loading, theming, and rendering, but that’s for another day.

Categories: FLOSS Project Planets

CXX-Qt 0.5 Released

Thu, 2023-03-09 13:53

We just released CXX-Qt version 0.5!

CXX-Qt is a set of Rust crates for creating bidirectional Rust ⇄ C++ bindings with Qt. It can be used to integrate Rust into C++ applications using CMake or build Rust applications with Cargo. CXX-Qt provides tools for implementing QObject subclasses in Rust that can be used from C++, QML, and JavaScript.

For 0.5, the focus has mainly been on adding more common Qt types, support for Qt containers types, support for pointer types, and improving inheritance. Simple QML applications can now be written entirely in Rust, including implementing Qt models, without needing any boilerplate C++ code.

Some of the larger developer-facing changes are listed below.

Inheritance

This release introduces new features for interfacing with C++ inheritance from Rust. These allow you to implement subclasses in Rust without needing to write boilerplate C++ code.

When subclassing some Qt classes, you need to call methods of the base class, for example QAbstractItemModel::beginInsertRows, without necessarily overriding those methods in your subclass. A new macro #[cxx_qt::inherit] can be used on extern "C++" blocks to create Rust bindings to those methods inherited from the C++ base class.

There is also an #[inherit] macro that can be used to access signals inherited from the base class. This tells CXX-Qt to skip generating a new Q_SIGNAL and to use the base class version instead.

Types

Bindings for more Qt types have been added to cxx-qt-lib:

  • QByteArray
  • QCoreApplication
  • QGuiApplication
  • QMargins
  • QMarginsF
  • QModelIndex
  • QPersistentModelIndex
  • QQmlApplicationEngine
  • QQmlEngine
  • QTimeZone
  • QStringList
  • QVector2D
  • QVector3D
  • QVector4D

We have also added support for Qt container types:

  • QList<T>
  • QVector<T>
  • QSet<T>
  • QHash<K, V>
  • QMap<K, V>

QList and QVector can easily be converted from Rust slices and into Rust Vecs.

Many Qt types in cxx-qt-lib now have common Rust standard library traits implemented, such as Default, Display, Debug, PartialEq, Eq, PartialOrd, Ord, and arithmetic operators (Add, Sub, Mul, Div traits).

Cargo features have been added to cxx-qt-lib for easily converting between Qt types and types from widely used Rust crates:

  • QColor ⇄ rgb crate
  • QUrl ⇄ http and url crates
  • QByteArray ⇄ bytes crate
  • QDate, QDateTime, and QTime ⇄ chrono and time crates

The code generator now supports pointer types such as *mut T to refer to another Rust QObject in properties, signals, and invokables.

Build System

The build system can now register files from the Qt Resource System at build time, so calling a C++ function to initialize them is no longer needed. Likewise, QML types can now be registered at build time, instead of calling qmlRegisterType from C++ code. Together with new bindings for QGuiApplication and QQmlApplicationEngine, there is no longer a need for boilerplate C++ code to launch a QML application from Rust. The API is still evolving and we hope to improve this area in the next release to support the new ahead-of-time QML compilation tools.

For More Information

Find CXX-Qt on our GitHub repository and view our CHANGELOG for more details about the changes.

We also have a book with a getting started guide.

Discussions and contributions are welcome on GitHub!

About KDAB

If you like this article and want to read similar material, consider subscribing via our RSS feed.

Subscribe to KDAB TV for similar informative short video content.

KDAB provides market leading software consulting and development services and training in Qt, C++ and 3D/OpenGL. Contact us.

The post CXX-Qt 0.5 Released appeared first on KDAB.

Categories: FLOSS Project Planets

New Video: How to Draw Dynamic Figures in Krita

Thu, 2023-03-09 08:12

This week, we have released the latest of Ramon’s Krita videos! This time there’s even a Blender file to help you pose figures!

The post New Video: How to Draw Dynamic Figures in Krita appeared first on Krita.

Categories: FLOSS Project Planets

Qt 6 Debugging in Visual Studio and VS Code

Thu, 2023-03-09 05:00

Not all Qt developers are using Qt Creator as their main IDE for development. Some of us are using other IDEs, like Visual Studio, Visual Studio Code or CLion, per choice or because a project requires it.

On Windows, with the MSVC compiler, the debugging experience with Qt 6 can be quite frustrating for some Qt types, like QMap, QHash or QVariant. See, for example, the debug variable view for the same project running with Qt Creator (left) and Visual Studio Code (right):

I don’t know about for you but, for me, the VS Code view is gibberish. It was way better with Qt 5, as seen below:

Let’s see how to improve things…

Use the Natvis Framework

The Natvis framework allows developers to write custom schemas to help visualize native objects. This is already used by the Qt VS Tools for Visual Studio, with Qt 5 and a Qt 6 specific files. You can download the official Qt natvis files here: Qt VS Tool github.

They are pre-processed and copied automatically by the plugin to %HOME%\Documents\Visual Studio 2022\Visualizers. If you want to use them directly from github, make sure to remove all occurrences of ##NAMESPACE##::.

If you look closely at the size of the file, you can see that the Qt 5 Natvis file is 40.9 KB. The Qt 6 Natvis file is only 18.5 KB, which is not 50% smaller than the Qt 5 — au contraire! This means that a lot of types are not working anymore, most likely because the Qt 5 implementation didn’t work during the migration to Qt 6 due to changes in the underlying data.

Let’s see how far we can improve things here. This blog won’t be about the how (it involved a lot of cursing…), but only about the improvements made to the qt6.natvis file.

Changes

For developers in a hurry, you can download the updated Natvis file here:

https://github.com/KDAB/KDToolBox/blob/master/qt/qt6_natvis/qt6.natvis

QMap Improvements QMap before       QMap after

QMap was already working, but I wanted a nicer view, with [key]: value display.

QHash Improvements QHash before       QHash after

QHash was the very reason I started the journey; I just wanted to see something, ideally, like QMap. Unfortunately, it’s not supported on CLion, which is missing support for the CustomListItems Natvis tag.

QMultiHash Improvements QMultiHash (with QHash changes)       QMultiHash after

Once QHash was done, QMultiHash was quite easy. Please note that the view is slightly different from the std::unordered_map equivalent; the Qt version is showing a list of values for one key, while the std version shows a list of (key, value) pairs with duplicated keys. Like QHash, QMultiHash view is not supported in CLion.

QVariant Improvements Static primitives       Core templates       Core classes

After looking at the containers, I decided to look at QVariant. Unfortunately, not all types are properly handled, but at least the static primitives, core templates, and most of the core classes are. If the type is unknown, it will show at least the typeId, so the developer can know what is inside the QVariant. The full list is available here: Qt6 Natvis documentation

How to Use this New qt6.natvis File Visual Studio

Follow the isntructions here to add a natvis file to your project: Add a .natvis file to a C++ project.

VS Code

We already discussed it in another blog post: VS Code for Qt Applications – Part 2. Just a quick recap:

  • create a launch.json file (that’s the “Debug: Add Configuration…” command)
  • Set the visualizerFile property to the qt6.natvis file

This is an example launch.json file that works well with CMake project:

{ "version": "0.2.0", "configurations": [ { "name": "qt6.4.2-msvc", "type": "cppvsdbg", "request": "launch", "program": "${command:cmake.launchTargetPath}", "visualizerFile": "${workspaceFolder}/qt6.natvis", "sourceFileMap": { "C:/work/build/qt5_workdir/w/s": "C:/Qt/6.4.2/Src", "Q:/qt5_workdir/w/s": "C:/Qt/6.4.2/Src", "C:/Users/qt/work/install": "C:/Qt/6.4.2/Src", "C:/Users/qt/work/qt": "C:/Qt/6.4.2/Src" } } ] } Why Not Do the Same As Qt Creator?

That’s a good question, and my first attempt at trying to fix this issue was to look at Qt Creator. After all, it’s using the same compiler and debugger. Surely, I can find something I can use. Quoting the documentation:

Qt Creator extends the command line debugger by loading the qtcreatorcdbext.dll extension library into it. The library must be available in the libs\qtcreatorcdbext64 and libs\qtcreatorcdbext32 folder. To install it there, select Qt Creator CDB Debugger Support when you install Qt Creator.

Again, quoting the documentation:

Qt Creator uses Python scripts to translate raw memory contents and type information data from native debugger backends (GDB, LLDB, and CDB are currently supported) into the form presented to the user in the Locals and Expressions views.

That’s the reason why the debugger is slower in Qt Creator (you can disable it from the Debugger->CDB preference page, with the “Use Python dumper” option). Unfortunately, it’s not usable for Visual Studio and VS Code.

Conclusion

It’s unfortunately impossible to go as far as what Qt Creator can do, but the changes to the qt6.natvis file improve the debugging experience quite a lot already, and we are close to feature parity with qt5.natvis. The file is part of our KDToolBox project. KDToolBox is a collection of useful code, scripts and snippets you are free to use; you can download it here:

https://github.com/KDAB/KDToolBox/blob/master/qt/qt6_natvis/qt6.natvis

This file can be used for Visual Studio, VS Code, and CLion IDEs, with the exception of QHash and QMutiHash not working with CLion. If something is missing, send me a note, no promises though.

About KDAB

If you like this article and want to read similar material, consider subscribing via our RSS feed.

Subscribe to KDAB TV for similar informative short video content.

KDAB provides market leading software consulting and development services and training in Qt, C++ and 3D/OpenGL. Contact us.

The post Qt 6 Debugging in Visual Studio and VS Code appeared first on KDAB.

Categories: FLOSS Project Planets

Pages