bismuth icon indicating copy to clipboard operation
bismuth copied to clipboard

fix windows unable to move between screens

Open benemorius opened this issue 2 years ago • 7 comments

Summary

Currently on recent (?) versions of kwin we don't rearrange the tiles correctly when kwin moves windows between monitors instantaneously (versus dragging by mouse) and instead we arrange the moved window back to its original location. This PR fixes that.

~~I don't think this is the right way to fix it, but since the fix is reported to work and the bug is reported to be severe, I think we should do this for now. I'm currently investigating what changed about the events we receive from kwin. I think there are some other event-related issues too like for example when moving windows between activities or desktops, so I think a wider solution is needed here like maybe finding some missing events.~~

Test Plan

  • try moving a window between screens using a kwin keyboard shortcut
  • without this PR, the previous step fails

Related Issues

Closes #370, closes #374

benemorius avatar Jun 19 '22 05:06 benemorius

Actually the problem is that kwin gives a frameGeometryChanged signal right before the screenChanged signal and we're currently handling the frameGeometryChanged signal by forcing the window back to its tiled geometry.

I don't know what the previous behavior of kwin was before this broke but I've tested as old as kwin 5.21.4 and it still has the bug.

Anyway I've finished going over the signal handling and I pushed an update.

benemorius avatar Jun 21 '22 15:06 benemorius

Indeed that one line is the problem. KWin changes a window's size before moving it between screens, so we can't react to a geometry change by always changing it back.

benemorius avatar Jun 22 '22 00:06 benemorius

Hi, @benemorius - Thank you for helping fix issues lately. I was just testing this fix, but unfortunately, this doesn't fix on my system. And it's for Google Chrome and Microsoft Edge. Firefox, and other windows are all fine. I have shared more in the linked issue, would you know what's going wrong?

krshrimali avatar Jun 24 '22 05:06 krshrimali

This PR fixes the problem for me. Without it, the only way I can move windows around on kwin 5.25 is to float -> move -> unfloat.

ZackGlenn avatar Jul 03 '22 19:07 ZackGlenn

This one fixed my problem on X11. I'm too lazy to compile, so I just copy-pasted code to usr/share/kwin/scripts/bismuth/contents/code/index.mjs

RayJameson avatar Jul 29 '22 18:07 RayJameson

Solved it for me too. Cloning the current master branch and merging this fix gets me the desired behavior.

git clone https://github.com/Bismuth-Forge/bismuth.git
cd bismuth
git remote add benemorius https://github.com/benemorius/bismuth.git
git fetch benemorius
git checkout -b <new_branch>
git merge benemorius/pr/fix/kwin-move-windows-between-screens
make setup-dev-env
[...]  # rest of build instructions

This really needs to be merged. Not being able to move windows to other screens from the keyboard is a deal breaker.

philgzl avatar Aug 10 '22 17:08 philgzl

Can this please get another look? This bug has been an issue for weeks by now with a fix available but not being merged.

DashieTM avatar Aug 10 '22 17:08 DashieTM

Are there still no plans to merge this pr?

DriesOlbrechts avatar Sep 01 '22 15:09 DriesOlbrechts

I have been using this fix for a month and I haven't got any bugs. Without this, I wouldn't use Bismuth because this is happening for most electron apps.

KubiGR avatar Sep 02 '22 07:09 KubiGR

Since the OP is not active, I applied the fixes I requested in a separate PR: #419

(In other words: the issue is fixed).

gikari avatar Sep 02 '22 11:09 gikari