Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Krohnkite does not manage new windows #46

Open
maxanier opened this issue Sep 28, 2019 · 15 comments
Open

Krohnkite does not manage new windows #46

maxanier opened this issue Sep 28, 2019 · 15 comments
Labels
bug Something isn't working

Comments

@maxanier
Copy link

Symptom
After restarting the system yesterday, any window I open is floating. Hitting the usual "toggle float" shortcut does not do anything. Therefore I assume the newly started windows are somehow not "managed" by krohnkite. If I disable the script in "Kwin-Scripts" and enable it again, all currently opened windows become tiled and behave as expected (toggle float works). Any windows afterwards are again unaffected.

I reset the configuration. Reinstalled krohnkite. Rebooted the system. But nothing changed.

It seems to also affect the tiling scripts "Tiling Extension"

I can't remember installing any new packages or changing any settings. Pacman logs does not show anything either.

If I enable debugging in the krohnkite options and restart Kwin kwin_x11 --replace I see the following messages:

qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 2243, resource id: 144703533, major code: 18 (ChangeProperty), minor code: 0
kwin_core: Compositing is not possible
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 2337, resource id: 144703536, major code: 3 (GetWindowAttributes), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 2338, resource id: 144703536, major code: 14 (GetGeometry), minor code: 0

But I don't know if they are related. Opening any new windows does not produce new ouput.

How to Reproduce
Most likely won't work be reproducible.

Expected behavior
Windows being tiled (or controllable with the krohnkite shortcuts)

Environment

  • Distro: Manjaro
  • KWin version: 5.16.4
  • Krohnkite version: 5a7b64d
  • List of KWin scripts in use: "Enforce window decoration for GTK+ windows"

Notes
This is probably not a lot of information to work with, but maybe you have an idea where I could start looking or how to get more debug output.

@maxanier maxanier added the bug Something isn't working label Sep 28, 2019
@L0uac
Copy link

L0uac commented Oct 4, 2019

Same here (errors included), if the script is stopped and then restarted the tiling is done correctly with the already opened windows. New windows won't be tilled after that.

@mullr
Copy link

mullr commented Oct 29, 2019

I'm seeing the same problem, but minus the errors. I'm on Kubuntu 19.04 (KWin 5.15.4)

@aerosol
Copy link

aerosol commented Nov 22, 2019

I'm getting the same behaviour. New windows aren't tiled. Moving the newly created window Switching to another virtual desktop (and back) makes it tile properly.

Arch, KWin 5.17.3-1, Krohnkite r307.577fc7f-1

@macco3k
Copy link

macco3k commented Nov 24, 2019

Same here. Kwin 5.17.3 on Arch.

@aerosol
Copy link

aerosol commented Nov 25, 2019

I took a very tentative stab at debugging this. I'm not familiar with TypeScript nor KWin internals though, sigh.

My uneducated guess is that client.windowShown signal is not emitted, or is, but races with the handler connecting on workspace.ClientAdded, so the handler is never executed (I can tell by adding a bunch of extra debug statements).

@esjeon happy to dig further if you'd be kind enough to provide me with some hints

@aerosol
Copy link

aerosol commented Nov 25, 2019

Hmm I think I fixed it by launching KWin compositor settings. There was a warning dialog there, saying that compositing has crashed in the past. After hitting the whatever button it displayed, krohnkite started managing new windows again 👨‍🔬

@maxanier
Copy link
Author

maxanier commented Nov 26, 2019

Thank you very much for sharing this. I had given up on krohnkite, but now I can use it again :)

For me it wasn't enough to hit the button though, I had to change some option and apply it. Then tiling started working again (even after reverting that option)

@esjeon
Copy link
Owner

esjeon commented Dec 1, 2019

Hi, everyone.

Thanks @aerosol for figuring out the source of the problem.

My uneducated guess is that client.windowShown signal is not emitted, or is, but races with the handler connecting on workspace.ClientAdded, so the handler is never executed

You're basically right with that. Sometimes KWin just refuses to emit events. I also found that this happens if compositor is disabled by some apps, though I'm not sure if this is a consistent behaviour.

It's clear that this is an upstream issue, and the only solution is to make sure the compositor is running correctly, I guess.

@esjeon esjeon added upstream wontfix This will not be worked on and removed bug Something isn't working labels Dec 1, 2019
@osleg
Copy link

osleg commented Jan 12, 2020

It's clear that this is an upstream issue, and the only solution is to make sure the compositor is running correctly, I guess.

Should we maybe report the bug to upstream?

@damscal
Copy link

damscal commented Feb 10, 2020

Issue seems to be with OpenGL
Choosing XRender as Rendering backend in KDE's Compositor settings fixes the problem

Alternatively, with OpenGL, one has to minimize and re-open the newly created window to let krohnkite tile it

@matejdro
Copy link

matejdro commented Jun 4, 2020

XRender seems to work, but it does not appear to work with VSync, so watching videos produces screen tearing :/

@matejdro
Copy link

I have submitted bug to the KDE: https://bugs.kde.org/show_bug.cgi?id=423010

@jsonMartin
Copy link

I was having this same issue with new windows not working properly.

I just changed my compositor rendering backend to OpenGL 3.1 and it seems to have helped

@sjkingo
Copy link

sjkingo commented Jun 22, 2020

I have the compositor disabled and have the same issue. Switching desktops and back causes the new windows on that desktop to be managed correctly.

esjeon added a commit that referenced this issue Jul 19, 2020
This is a little timer-based hack that make the script work without
compositor.

This is not a "true" solution, because, rarely, it takes longer than
50ms to get "windowShown" signal after "windowAdded", and, if this
happens, the window *might* freeze. If the delay is longer, it ruins the
experience.

I also tried to get the state of compositor through
`option.compositingInitialized`, but it seems like the property is
removed in the actual code. I couldn't find any other reasonable
methods.
@esjeon esjeon added bug Something isn't working and removed upstream wontfix This will not be worked on labels Jul 28, 2020
@wojtas
Copy link

wojtas commented Dec 2, 2020

Same issue here - switching compositor to OpenGL 3.1 from 2.0 fixed the error. Before that, windows got tiled properly only after switching virtual desktops, moving the window to another screen, or minimizing and maximizing the window again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests