Screenshots not working in kde wayland after running firecfg

All screenshot tools were working fine . But after running sudo firecfg to firejail all programs they stopped working in wayland.

At first only spectacle was installed , so now it is giving this error when trying to screenshot :

Screenshot request failed: "The process is not authorized to take a screenshot"
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
QPixmap::scaled: Pixmap is a null pixmap

Then I tried installing flameshot. It worked fine at first,but after I ran sudo firecfg again ,it also stopped working and only giving this error:

qt.qpa.wayland: Wayland does not support QWindow::requestActivate()

I tried sudo firecfg --clean to disable firejail for everything ,but they are still not working. after diabling firejail, I uninstalled them,clearedd pacman cache with pacman -Scc and installed again and, but they are still not working.
I also tried running them with prefix firejail --noprofile,but no change.
It looks like firejail,permanently broke those tools for my system in wayland.

When I switch to x11 , everythings works normal.Even after running firecfg again and running them inside firejail and apparmor.

My systeminfo :

Operating System: Manjaro Linux
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
Kernel Version: 5.10.96-1-MANJARO (64-bit)
Graphics Platform: Wayland
Processors: 2 × AMD A6-9220 RADEON R4, 5 COMPUTE CORES 2C+3G
Memory: 3.7 GiB of RAM
Graphics Processor: AMD STONEY

Have you looked for this?
Even tho in 2018 was mentioned here Comparing Qt Widgets App under Gnome wayland using platform wayland-egl to xcb | Qt Forum

It might still be the case today, regardless the progress made since then in wayland.

Then, according to some other documentations and comments, you might have to use:

XDG_SESSION_TYPE=x11 /usr/bin/flameshot

for example … for those Qt5 applications.

On the other hand, there is grim package that provides wayland support for flameshot, but have no clue how it performs while in firejail = reduces the risk of security breaches by restricting the running environment of untrusted applications
Are you considering all installed applications as untrusted?

The problem is fixed after removing the desktop file of spectacle.

There is a way to ignore certain apps from firejail by uncommenting app name from firecfg.config

But it seems like a bug in firejail,where after uncommenting the name,it doesn’t create an entry is /usr/local/bin but still messes up the desktop file somehow,after which it won’t work even after I run it from terminal.

The only way to make it work is to delete the desktop file in ~/.local/share/applications after which it works perfectly again.

In order to avoid this I created a bash script with following command

sudo firecfg && rm ~/.local/share/applications/org.kde/spectacle.desktop

which I use after each new install instead of sudo firecfg command to firejail the new app without breaking spectacle.
I launch it from keyboard shortcuts ,so losing the desktop shortcut is not a problem for me.

Also every other program runs fine inside firejail and apparmor, the only problem it has with the screenshot tools running in wayland. I guess firejail isn’t optimized or patched properly for wayland yet.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.