Bug 280638

Summary: x11-wm/plasma6-kwin linuxism breaks spectacle screenshots
Product: Ports & Packages Reporter: Jesper Schmitz Mouridsen <jsm>
Component: Individual Port(s)Assignee: freebsd-kde (group) <kde>
Status: New ---    
Severity: Affects Only Me CC: arrowd, oleglelchuk
Priority: --- Flags: bugzilla: maintainer-feedback? (kde)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
use sysctl to get executablePath of specified pid
none
the patch that ChatGPT produced for me none

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.