Bug 271856 - Add WM_STATE match in kwin rules
Summary: Add WM_STATE match in kwin rules
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: rules (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-27 17:51 UTC by Gokdeniz Karadag
Modified: 2022-04-08 19:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gokdeniz Karadag 2011-04-27 17:51:55 UTC
Version:           unspecified (using KDE 4.6.2) 
OS:                Linux

Kwin rules do not seem to support matching a window's state(WM_STATE). It would be benefical if kwin rules had the ability to match a "maximized" window, in addition to other window states.

----use case---
I want to remove titlebar in maximized firefox windows, as it is more "stylish", and more importantly, it's space efficient. I can match the firefox windows in a kwin rule but I cannot match the maximized state. A general rule removes the titlebar & borders in smaller/popup window.
---------------
 
I checked the source for possible hidden options but could not find matching the WM_STATE.

xprop on a maximized window gives:
_NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MAXIMIZED_HORZ
on a normal window, it's empty.
_NET_WM_STATE(ATOM) = 


Reproducible: Always
Comment 1 Martin Flöser 2011-04-27 19:32:32 UTC
For your usecase there is the scripting API which would support that. Adding 
tracking maximized state with the window rules is not trivial and would 
probably not been added.
Comment 2 Thomas Lübking 2011-04-28 13:19:27 UTC
@Gokdeniz
You're aware that FF has a built-in fullscreen feature that (you want to use? and) also will allow you to end this state from the FF menu or the figured shortcut (where you'd need to know about alt+f3 or have a decoration toggle shortcut with your attempt)

If you wish to hide the menubar for /all/ maximized clients, this is possible through an undocumented feature of kwin:
kwriteconfig --file kwinrc --group Windows --key BorderlessMaximizedWindows true
qdbus org.kde.kwin /KWin reconfigure
Comment 3 Gokdeniz Karadag 2011-04-28 16:49:21 UTC
(In reply to comment #2)
> @Gokdeniz
> You're aware that FF has a built-in fullscreen feature that (you want to use?
> and) also will allow you to end this state from the FF menu or the figured
> shortcut (where you'd need to know about alt+f3 or have a decoration toggle
> shortcut with your attempt)

One difference; the fullscreen option of Firefox hides the tab bar and other toolbars.

> If you wish to hide the menubar for /all/ maximized clients, this is possible
> through an undocumented feature of kwin:
> kwriteconfig --file kwinrc --group Windows --key BorderlessMaximizedWindows
> true
> qdbus org.kde.kwin /KWin reconfigure

I have become aware of this undocumented setting while looking for a solution to my use case.

While I have not looked into Kwin scripting API yet, filtering windows by window state seemes like a good idea.

In compiz, one can enter filters like this
any & !(class=Firefox & state=maxvert & role=browser)
source:
http://www.webupd8.org/2011/03/firefox-4-get-tabs-in-title-bar-like.html