Score:4

My Ubuntu 22.04 is using X11. How do I make it use Wayland?

xk flag

I have dual-booted my windows 11 with Ubuntu 22.04 LTS. The problem is that I wasn't able to use pinch zoom gesture on browsers. I was on Firefox. And also the too fast scrolling.

I searched around and found that I had to put: MOZ_ENABLE_WAYLAND=1 in the .profile file. Which I did, but it did not work.

Someone on reddit suggested me that it's: export MOZ_ENABLE_WAYLAND=1 so I edited the line in .profile file. It doesn't work.

The reddit guy kept helping me by asking me outputs of certain commands and more, which are:

In Firefox's about:support:

What does 'Window Protocol' say: x11

What does 'MOZ_ENABLE_WAYLAND' say: 1 (True)

What does running echo $XDG_SESSION_TYPE in terminal say: x11

So, it seems like Firefox is okay with using Wayland but the Ubuntu itself is using X11 and hence the problem is happening?

Tell me if anything else is needed.

P.S. : I was asked to change session from X11 or Wayland from the settings icon while logging into the system. But it seems I the settings icon does not work in my case because the system is not compatible with Wayland and nothing can be done. So, tell me if you know of any workarounds to get the zooming functionality in the browser. Thank You.

P.S. 2 : I later found out that the gear icon in the login screen never worked when clicked because I was tapping on my touchpad for it and it required hardware clicks and it worked. And I switched to KDE hence the solution marked as correct is for KDE plasma.

guiverc avatar
cn flag
When you login, you select a session from your available options; which include X11 or Wayland sessions; select to use a Wayland session (*if your system auto-logins in you'll miss this; so logout & return to greeter or DM & select a different session*). Do note: Some *nvidia* kernel modules can prevent Wayland sessions from working, causing a X11/Xorg session to be used (until you change kernel module being used)
mchid avatar
bo flag
Which Ubuntu desktop are you using? The default Ubuntu desktop, Gnome shell, Unity, MATE, KDE, something like XFCE or Xubuntu, or something else? Also, for your display manager, are you using GDM, Lightdm, or something else?
user535733 avatar
cn flag
Logout. Look on your Password screen for the "cog" (settings) icon. That's where you choose between X and Wayland.
ThisIsSidam avatar
xk flag
@user535733 I have tried clicking it out of curiosity but it never did anything. No actions. No popup.
user535733 avatar
cn flag
Your system will detect if it is compatible with Wayland. If not, then you won't be offered the choice.
ThisIsSidam avatar
xk flag
@mchid I think I use Gnome as I also use gnome extensions. And the display manager I use is GDM.
ThisIsSidam avatar
xk flag
@user535733 So are there any alternatives. Like, other ways to replicate the zooming and slowing the fast scrolling.
user535733 avatar
cn flag
Comments are not intended for conversation. Don't comment on your own question. Instead, edit, refine, and improve your question. When your question is clear and answerable, then you are more likely to get a useful answer.
Score:1
bo flag

Updated answer for KDE Plasma users:

For KDE Plasma users, run the following commands to install the necessary Wayland support package:

sudo apt update
sudo apt install plasma-workspace-wayland

Then, reboot or log out and you should see a dropdown menu on the bottom left of your sign-in screen where you can select the desktop session: Plasma (Wayland).

I found the instructions here and they also provide instructions for how to run a single application using Wayland during a regular X11 session. For example, you could run Firefox using Wayland while your KDE Plasma desktop is running an X11 session:

startplasma-wayland firefox &

This might be useful so you could still run Firefox using Wayland if you find that the desktop or other applications run better on X11.

ThisIsSidam avatar
xk flag
Hey there, Sorry for such late reply. I switched to KDE plasma. The setup took days as this was my first time, and forgot about this until I checked the mail. So, new details. I am using KDE Plasma 5.24.7 and now have SDDM. Should I still try this?
mchid avatar
bo flag
@ThisIsSidam I haven't tested this on KDE Plasma. This would be for forcing a Wayland session on the Gnome Shell or default Ubuntu desktop.
ThisIsSidam avatar
xk flag
Thanks for the reply. I will create a new user to try this on. Drop any command changes you have, if you have any. I'll notify you if it worked. Thanks.
mchid avatar
bo flag
@ThisIsSidam Since you are using KDE, I have updated the answer to enable Wayland support on KDE Plasma. No need to use Gnome Shell.
ThisIsSidam avatar
xk flag
This worked without any issues. My Touchpad settings got reset for a reason but did get the settings to change scrolling speed. Thank You.
mchid avatar
bo flag
@ThisIsSidam Awesome. There are ways to tweak the touchpad settings although iirc, we have to use `libinput` commands with Wayland instead of `xinput`.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.