Bug 503594 - Spectacle cannot record screencasts when invoked by the superuser
Summary: Spectacle cannot record screencasts when invoked by the superuser
Status: RESOLVED NOT A BUG
Alias: None
Product: Spectacle
Classification: Applications
Component: General (other bugs)
Version First Reported In: 6.3.4
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Noah Davis
URL: https://bugs.kde.org/attachment.cgi?i...
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-30 21:51 UTC by Roke Julian Lockhart Beedell
Modified: 2025-05-02 15:28 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
A Screenshot Of The Error In Spectacle's GUI (37.88 KB, image/png)
2025-04-30 21:51 UTC, Roke Julian Lockhart Beedell
Details
A Screenshot Of The Portal Failure Notification (13.40 KB, image/png)
2025-04-30 21:51 UTC, Roke Julian Lockhart Beedell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roke Julian Lockhart Beedell 2025-04-30 21:51:09 UTC
Created attachment 180831 [details]
A Screenshot Of The Error In Spectacle's GUI

SUMMARY

Spectacle cannot record screencasts when invoked by the superuser. It fails due to PipeWire denying it. I've ascertained that OBS can't either, despite the Portal providing the option to, so it might be a fault of the Portal, or lower.

STEPS TO REPRODUCE

1. Authenticate as the superuser.

2. Invoke Spectacle.

3. Attempt to capture a screencast.

OBSERVED RESULT

> An error occurred while attempting to record the screen.  
> Failed to connect PipeWire context

However, it nonetheless created `file:///root/Videos/Screencasts`.

EXPECTED RESULT

It should either be able to, or the option should be disabled, and it shouldn't create the directory.

SOFTWARE/OS VERSIONS

> Operating System: Fedora Linux 42  
> KDE Plasma Version: 6.3.4  
> KDE Frameworks Version: 6.13.0  
> Qt Version: 6.9.0  
> Kernel Version: 6.14.4-300.fc42.x86_64 (64-bit)  
> Graphics Platform: Wayland

ADDITIONAL INFORMATION

This appears to be a regression since 6.0.4, per https://bugs.kde.org/attachment.cgi?id=169755&action=edit#attachment_actions:~:text=Actions:-,View,-Attachments%20on%20bug.

I have no idea what version to set in BZ, because the available options utilise a different numbering scheme to what Spectacle itself reports (24.12.3 versus 6.3.4). Consequently, I've set it to "Unspecified".
Comment 1 Roke Julian Lockhart Beedell 2025-04-30 21:51:28 UTC
Created attachment 180832 [details]
A Screenshot Of The Portal Failure Notification
Comment 2 Roke Julian Lockhart Beedell 2025-05-01 09:28:46 UTC
(In reply to Roke Julian Lockhart Beedell from comment #0)

> I have no idea what version to set in BZ, because the available options utilise a different numbering scheme to what Spectacle itself reports (24.12.3 versus 6.3.4). Consequently, I've set it to "Unspecified".

It's at the top, per https://bugs.kde.org/show_bug.cgi?id=503584#c4:~:text=Version%206.3.4%20is%20in%20the%20dropdown%2C%20adjusted%20to%20that.
Comment 3 Nate Graham 2025-05-02 14:41:44 UTC
In general, you shouldn't open apps as root. This isn't supported or recommended. What's your use case for this?
Comment 4 Roke Julian Lockhart Beedell 2025-05-02 14:58:41 UTC
(In reply to Nate Graham from comment #3)

I was recording something else not functioning as the superuser, ironically. Though, the application should still handle being invoked as root, even if it is designed not to run as it, surely? Like, show a modal stating that it shouldn't work, or a just hide the whole "Recording" section?
Comment 5 Nate Graham 2025-05-02 15:04:13 UTC
> Though, the application should still handle being invoked as root, even if it is designed not to run as it, surely?
But why? If the app wasn't designed to be run this way, and you do it anyway, why should the app specifically handle this case? It's on you, no?
Comment 6 Roke Julian Lockhart Beedell 2025-05-02 15:21:30 UTC
(In reply to Nate Graham from comment #5)

I don't see any indication in the GUI that it's not designed to run as the superuser. Am I being stupid, by missing a banner or something equivalent? I've just looked again and don't see anything of note.
Comment 7 Nate Graham 2025-05-02 15:28:45 UTC
Practically no GUI apps are designed to run as the superuser.

The ones that are will prompt you for a password themselves when you run them. But most don't, and shouldn't, because it's a bad idea and will mess up your system by causing the app to write settings and state files to root-owned locations, which will cause weird issues down the road.

In general, just don't do it.