How can i make plasma fullscreen windows not be allways on top

So i like to have windows on top of others sometimes like a subtitle app that should stay in front of by browser full-screen video.
If a app is made to be full-screen with the keyboard shortcut
(not set by default; is named “make window fullscreen” or something like it).
So far i have found one way.
I can set the fullscreen app to stay behind all windows.
If i do that all other widows will go in front.
But i realy just want mostly one app on top of the fullsreen window.
it would be great if “allways on top” widows would actually be on top.
I tyied to se if i can somehow lower the draw priority of the fullsrceen window but could not figure it out.
One way to emulate this is to hide the titlebar and maximize the window.
basically this fakes fullsrceen, the issue with that is the full app has to be fullscreen for that.
If you use a browser and press f on a video,
only the video will be fullscreen
and if the player is finished it will go back out of fullscreen
(well depends on the player; but it is like this for some autoplay sites).
That is actually a nice feature i do not really want my browser to be in fullscreen but only the video.

Any help is appreciated.

focus the window and hit Alt+F3

under more actions… configure special windows settings

you can force kwin to do pretty much anything you want by adding a new rule.

keep below / above other windows might be what you want.

No, not realy.
As mentioned if I use go below all windows,
it will go bellow all of them.

But I don’t want that I just want it to go bellow the windows I have set to be always on top.

A global solution would be nice (these window rules you mention would be for a specific window) but first I need to make fullscreen windows go below “always on top” windows.

Preferred is if I can set the fullscreen window to let “always on top”, show via cli so I can script it.

Thanks anyway, but other ideas would be great (by you or anyone else).

You can set the layer of windows to “overlay”, then it’ll be shown on top of fullscreen windows

2 Likes

I have not tryed that yet.
But if this works how would I script that.
Like I want to set the active window as overlay via cli.

And is there a way to reduce the fullscreen window priority.
Like set the fullscreen window to be the lowest layer, would what work.
Would still need to script it I guess,
so still need to set this via cli.

I don’t know if the layer can be set through a script, but window rules should work fine for this

I don’t think there is.

Window rules are not set fast.
If I want a window to be on top it might be a different window on a other day.
Maby there is a way to script it with qdbus6.
Send some signal to kwin with that.

A dinamic way to do this can’t realy be done with window rules.

Here is what i have in mind.
It may be possible to set the layer of windows on the cli by using a kwin script.

Sadly i have now idea how scripting these kwin scripts work, so i asked chat gpt.
You might think its most likely wrong with the code, and it is, but i think the principle may work, if i can figure out how to trigger the kwin script, and make the code work.

Here is what was suggested:

  1. Make a folder with a medadata.json and add some data.
    I think that part is correct because i was able to activate the kwin script.
  2. make a folder named contents and a folder named code.
    So far seems ok (I think).
  3. Make a main.js with the contents:
function setWindowLayer(windowId, layer) {
    var client = workspace.clientList().find(c => c.windowId === windowId);
    if (client) {
        client.layer = layer;
    } else {
        print("Window with ID " + windowId + " not found.");
    }
} // Seems ok, im not shure.
  1. Install the script using: “kpackagetool6 --type=KWin/Script -i %Metatdata-Folder%” and activate the script in the settings
    This worked fine
  2. run the script over dbus with command:
    qdbus6 org.kde.KWin /KWin org.kde.kwin.Script.setWindowLayer 0x5400013 Desktop

That is probably where it got it wrong.
It will report: Cannot find ‘org.kde.kwin.Script.setWindowLayer’ in object /KWin at org.kde.KWin
Then i don’t even know if you can call kwin scripts from the cli.
But if any of you have a idea please say so.

Edit: I can in fact confirm that setting this layer setting in window rules is doing what i want.
I just have to be able to set it from the cli.
Setting the layer setting of a fullscreen app to normal in window rules, will allow other windows to stay on top.
Any ideas are welcome (best are cli ideas :slight_smile: ).