Bug 353154 - Clicking on special window / application setting has no effect
Summary: Clicking on special window / application setting has no effect
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: rules (show other bugs)
Version: 5.4.1
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL: https://git.reviewboard.kde.org/r/125...
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-25 05:55 UTC by Gilboa Davara
Modified: 2015-10-12 05:33 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.4.2
thomas.luebking: ReviewRequest+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gilboa Davara 2015-09-25 05:55:55 UTC
As the title suggests.
Window specific rules can only be access using the "system settings".

Reproducible: Always

Steps to Reproduce:
1. Right click on window title bar.
2. More actions->Special *


Actual Results:  
None
Comment 1 Thomas Lübking 2015-09-25 06:29:38 UTC
It's supposed to run "${CMAKE_INSTALL_PREFIX}/${LIBEXEC_INSTALL_DIR}/kwin_rules_dialog" which is (usually) /usr/lib/libexec/kwin_rules_dialog

In 99% of all chances, your distro moved it away from the (compiled in) execution path.

Also see bug #345340

=> where is the "kwin_rules_dialog" binary located and can you run it by "/path/to/kwin_rules_dialog --wid 123" (the wid parameter is mandatory but can be junk)
Comment 2 Gilboa Davara 2015-09-30 06:29:06 UTC
kwin rules dialog is in /usr/libexec/kwin_rules_dialog coupled with a number of other KF5/P5 applications (e.g. kscreenlocker_greet)
... The weird this is that I *can* access this dialog box from system-settings. The problem is limited to accessing this dialog via right-click -> Special.

- Gilboa
Comment 3 Martin Flöser 2015-09-30 06:35:24 UTC
The patch looks wrong. It should be /usr/lib/libexec... - which distribution is that?
Comment 4 Thomas Lübking 2015-09-30 06:39:39 UTC
Bugzilla says "Fedora"

@Gilboa
No, you can't ;-)
The thing is compiled twice, once as kcm and once as standalone dialog.

Could you successfully run "/usr/libexec/kwin_rules_dialog --wid 123"?
If yes, try symlinking /usr/libexec to /usr/lib/libexec and then to call the dialog from the Alt+F3 menu again.
Comment 5 Gilboa Davara 2015-09-30 06:48:00 UTC
Martin,

Fedora doesn't have  /usr/lib/libexec, only /usr/libexec.

Thomas,

(Many) Thanks for prompt reply.
I can execute /usr/libexec/kwin_rules_dialog --wid 123
Linking /usr/lib/libexec to /usr/libexec/ has no effect.

- Gilboa
Comment 6 Thomas Lübking 2015-09-30 07:27:19 UTC
you'll have to run
   strace kwin_x11 --replace 2>&1 | grep kwin_rules_dialog
to see which binary (path) it tries to access.

To answer the next question ("why is it compiled in?"):
commit f6458fa1e8e92fdf16a1acc961703d229894454c
Comment 7 Gilboa Davara 2015-09-30 07:38:52 UTC
stdout/err is empty.
Directed stdout/err into a log file. kwin_rules_dialog isn't being called.
(I don't see any calls to exec, even though I tried activating both menus.) 

- Gilboa
Comment 8 Thomas Lübking 2015-09-30 11:03:32 UTC
This does indeed not work (despite the dialog showing up - no idea how QProcess manages that)
That sucks because i'm currently out of ideas on how to figure which path is tried w/o recompiling kwin (which will incidentally change the compiled in path. gnarf.)

"strings" also only shuffles up the error message (which should likely include the tried path...)
Comment 9 Martin Flöser 2015-09-30 11:15:53 UTC
what about opening the binary in a hex edit and search for the expected string? (Or some better binary search tool)
Comment 10 Thomas Lübking 2015-09-30 11:24:49 UTC
would work.
open /usr/lib/libkwin.so it in okteta and search for "kwin_rules_dialog" - the path is right above - and QStringLiteral padds every char with 00 ... meehh.
Comment 11 Thomas Lübking 2015-09-30 14:38:56 UTC
Git commit 75b08e1ee704c0467562e49bb47d47b2aaa6703b by Thomas Lübking.
Committed on 30/09/2015 at 14:38.
Pushed by luebking into branch 'Plasma/5.4'.

log *which* binary failed to start

Users shouldn't have to od libraries.
REVIEW: 125464

M  +1    -1    rules.cpp

http://commits.kde.org/kwin/75b08e1ee704c0467562e49bb47d47b2aaa6703b
Comment 12 Gilboa Davara 2015-09-30 15:29:15 UTC
With a bit of okteta bit-magic *, I found it.
/usr//usr/libexec/kwin_rules_dialog
Seems like a double 'usr'.

* Search, string: kwin_rules_dialog, switch to hex, pad each char with 00 to simulate UTF16, OK.

- Gilboa
Comment 13 Gilboa Davara 2015-09-30 15:32:03 UTC
0022:AF70 |                                           2F 00 75 00  73 00 72 00 |         /.u.s.r.
0022:AF80 | 2F 00 2F 00  75 00 73 00  72 00 2F 00  6C 00 69 00 | /./.u.s.r./.l.i.
0022:AF90 | 62 00 65 00  78 00 65 00  63 00 2F 00  6B 00 77 00 | b.e.x.e.c./.k.w.
0022:AFA0 | 69 00 6E 00  5F 00 72 00  75 00 6C 00  65 00 73 00 | i.n._.r.u.l.e.s.
0022:AFB0 | 5F 00 64 00  69 00 61 00  6C 00 6F 00  67 00 00 00 | _.d.i.a.l.o.g...
0022:AFC0 | FF FF FF FF                                                                 | ÿÿÿÿ
Comment 14 Thomas Lübking 2015-09-30 15:59:51 UTC
Hmmm.. while it's pointless in this case afaiu what google tells me about LIBEXEC_INSTALL_DIR, it can legally be an absolute path - in that case we should not prepend CMAKE_INSTALL_PREFIX

Now we need some preprocessor magic for this - affects KWIN_KILLER_BIN as well.
Comment 15 Gilboa Davara 2015-09-30 17:04:03 UTC
CMAKE_INSTALL_PREFIX is /usr?

- Gilboa
Comment 16 Thomas Lübking 2015-09-30 17:37:45 UTC
yes (by default)
preproc won't work, we need to handle that in cmake to resolve an absolute path variable
Comment 17 Thomas Lübking 2015-10-01 07:28:08 UTC
Git commit 85b35157943ab4e7ea874639a4c714a10feccc00 by Thomas Lübking.
Committed on 01/10/2015 at 07:26.
Pushed by luebking into branch 'Plasma/5.4'.

support absolute libexec path configuration
REVIEW: 125466
FIXED-IN: 5.4.2

M  +2    -2    config-kwin.h.cmake

http://commits.kde.org/kwin/85b35157943ab4e7ea874639a4c714a10feccc00
Comment 18 Gilboa Davara 2015-10-12 05:33:41 UTC
Thanks.
I'll test it once KDE 5.4.2 hits F22, and report back.

- Gilboa