Bug 180855 - make window operations available to DBus
Summary: make window operations available to DBus
Status: RESOLVED INTENTIONAL
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: CVS
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-15 18:59 UTC by Melchior Franz
Modified: 2011-03-28 19:44 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
dbus interface for kwin window operations (4.50 KB, patch)
2009-01-15 19:01 UTC, Melchior Franz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Melchior Franz 2009-01-15 18:59:53 UTC
Version:            (using Devel)
Compiler:          gcc (SUSE Linux) 4.3.1 20080507 
OS:                Linux
Installed from:    Compiled sources

One of the really important operation modes for me is konsole in full-size mode without window decoration (and running vim :-). I do all my development work in this setup. To prepare a konsole window for this mode, I needed DBus interface functions for window operations (maximize was already available via "/konsole/MainWindow_1 com.trolltech.Qt.QWidget.showMaximized", but NoBorder was missing).

I've now implemented these DBus functions for KWin:  listWindowOperations() [returns list of operations, e.g. "NoBorder"], queryWindowOperation(id, name) [returns state for some given operations], performWindowOperation(id, name). For example, to turn off the window decoration for the konsole window in which the script is run:

WINID=$(qdbus $KONSOLE_DBUS_SERVICE /konsole/MainWindow_1 org.kde.KMainWindow.winId) # win id of running konsole
NOBORDER=$(qdbus org.kde.kwin /KWin org.kde.KWin.queryWindowOperation $WINID NoBorder)

if [ "$NOBORDER" == "false" ]; then
qdbus org.kde.kwin /KWin org.kde.KWin.performWindowOperation $WINID NoBorder
fi



Patch attached, though I have my doubts that it can be taken as is. Of course, offering the functions directly in the target applications DBus interface catalog would be nicer than going via KWin+winId, but I guess that's not easily possible, as this probably only works for operations that are supported by the WM spec.
Comment 1 Melchior Franz 2009-01-15 19:01:35 UTC
Created attachment 30286 [details]
dbus interface for kwin window operations
Comment 2 Melchior Franz 2009-01-15 19:15:13 UTC
(In reply to comment #1)
Correction: queryWindowOperation() should, of course, also be const.
Comment 3 Pino Toscano 2009-01-16 01:43:41 UTC
Sounds like what wmctrl should mostly do.
Comment 4 Melchior Franz 2009-01-16 13:26:17 UTC
(1) I haven't found any hint that wmctrl can do the NoBorder operation. But even if so:

(2) It's a bad idea to omit important interfaces because some third-party software (that most people have never heard of) can do something similar. Essential functions should be visible and available to the user (script author) in the DBUS interface. Otherwise there should at least be a NOOP DBus function called use_wmctrl_if_you_want_to_manipulate_kwin().
Comment 5 Melchior Franz 2011-03-28 19:44:04 UTC
Withdrawn by the submitter.

Rationale: The feature doesn't fit well into the architecture, and there is a cleaner way to achieve the same: wmctrl with an extension to remove window decoration via _MOTIF_WM_HINTS: http://xrunhprof.wordpress.com/2009/04/13/removing-decorations-in-metacity/