Bug 364330 - KWin should allow to send random signals to clients by windows
Summary: KWin should allow to send random signals to clients by windows
Status: RESOLVED INTENTIONAL
Alias: None
Product: kwin
Classification: Plasma
Component: core (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-14 20:05 UTC by Björn Lindqvist
Modified: 2016-06-15 06:12 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Björn Lindqvist 2016-06-14 20:05:07 UTC
(This is a feature request not a bug report)

If a process controlling a window kwin manages is not responding and you try to close it with the X button you are given the option to terminate it by sending the KILL signal to it. 

I would like a way to send other signals to processes too. In particular, the INT signal and/or TERM because stuck processes might very well respond to those. For instance, TERM might allow it to shutdown cleanly.

This feature would be mostly for advanced users so it wouldn't matter if there is no GUI for it or if the buttons for sending signals are "hidden away somewhere". 



Reproducible: Always
Comment 1 Thomas Lübking 2016-06-14 22:09:57 UTC
Fyi, kwin sends SIGTERM, not SIGKILL.

No idea whether this helps you but

   WPID=`xprop _NET_WM_PID`; [ -z "$WPID" ] || kill -SIGNAL ${WPID#* = }

will allow you to send signals to windows which expose their clients PID (required by kwin just as well and rather common nowadays) by clicking the window.
Comment 2 Björn Lindqvist 2016-06-14 22:43:15 UTC
Are you sure? In the console it says "[1]    29237 killed     ./factor" and not  "terminated". Your script does not help because it requires using a console. 

But perhaps it can be done with a kwin script? I didn't realize before now that kwin is scriptable. If I can write a script, and maybe bind it to a keyboard shortcut, to do what your console line does, that would be perfectly adequate.
Comment 3 Martin Flöser 2016-06-15 06:08:24 UTC
Sorry, but this sounds like featuritis to me and is nothing I want to expose in the user interface. Especially as there are valid setups where this will not work and one is not allowed to send a signal, e.g. remote windows. That would directly increase the complexity of such a feature.

The functionality you are looking for is provided by KSysGuard. I don't see a reason for KWin trying to be a KSysGuard Light.
Comment 4 Thomas Lübking 2016-06-15 06:12:49 UTC
(In reply to Björn Lindqvist from comment #2)
> Are you sure?
quite so: https://quickgit.kde.org/?p=kwin.git&a=blob&h=2e6966643e2fbf778b20fb4ad75bddcd4d435a39&hb=7818a1fa9c03ebc8115a01b9ca509da70178ab83&f=client.cpp


> In the console it says "[1]    29237 killed     ./factor"

LOL, the invoked dialog tool actually calls SIGKILL, smells like a bug.
https://quickgit.kde.org/?p=kwin.git&a=history&h=7818a1fa9c03ebc8115a01b9ca509da70178ab83&f=killer%2Fkiller.cpp

=> bug #364337

> not  "terminated".
"Exit 15"

> Your script does not help because it requires using a console. 
run "kcmshell5 khotkeys"
you can assign a shortcut to it.

> But perhaps it can be done with a kwin script?
No. Calling random executables is not supported by kwin scripting.