Bug 280638 - x11-wm/plasma6-kwin linuxism breaks spectacle screenshots
Summary: x11-wm/plasma6-kwin linuxism breaks spectacle screenshots
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-kde (group)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-05 19:43 UTC by Jesper Schmitz Mouridsen
Modified: 2024-12-09 17:27 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (kde)


Attachments
use sysctl to get executablePath of specified pid (1.02 KB, patch)
2024-08-05 19:43 UTC, Jesper Schmitz Mouridsen
no flags Details | Diff
the patch that ChatGPT produced for me (5.11 KB, text/plain)
2024-12-09 17:27 UTC, Oleg
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesper Schmitz Mouridsen freebsd_committer freebsd_triage 2024-08-05 19:43:06 UTC
Created attachment 252525 [details]
use sysctl to get executablePath of specified pid

x11-wm/plasma6-kwin wayland in spectacle  you get always a not athorized to take screenshots, because of this check https://github.com/KDE/kwin/blob/1240ac1dfe4569f3bb5d5d182ae3c393dc2c5bd5/src/plugins/screenshot/screenshotdbusinterface2.cpp#L331-L354

The linux specific code is here: 
https://github.com/KDE/kwin/blob/1240ac1dfe4569f3bb5d5d182ae3c393dc2c5bd5/src/utils/serviceutils.h#L67

The attached patch uses sysctl to get the executableName

You also need to workaorund https://bugreports.qt.io/browse/QTBUG-126300 by setting TZ explicitly, otherwise spectacle crashed on saving the taken snapshot to a file..
Comment 1 Gleb Popov freebsd_committer freebsd_triage 2024-09-24 04:56:39 UTC
It feels like I fixed the similar problem in SSSD https://github.com/freebsd/freebsd-ports/blob/main/security/sssd2/files/patch-src__util__find_uid.c#L7
Comment 2 Gleb Popov freebsd_committer freebsd_triage 2024-12-09 09:18:00 UTC
This leaks memory. You should use QString::fromLocal8Bit() to create a QString and then free the C string.
Comment 3 Oleg 2024-12-09 17:27:44 UTC
Created attachment 255745 [details]
the patch that ChatGPT produced for me

To this message, I am attaching a patch that ChatGPT created for me.