esjeon / krohnkite

A dynamic tiling extension for KWin
MIT License
1.64k stars 65 forks source link

Plasma freezing #24

Open jjonw opened 5 years ago

jjonw commented 5 years ago

First of all I would like to thank you for the plugin, it's amazing.

Symptom I'm experiencing freezing in plasma/kwin when I activate Krohnkite since 1 or 2 last updates of plasma/kwin in opensuse. It mainly occurs when opening Franz or creating a new virtualbox virtual machine, but also happened when using only chrome to watch youtube (have not tried other programs).

How to Reproduce VirtualBox

  1. Open VirtualBox 5.22.22.
  2. Click in New.
  3. After giving a name for the virtual machine the plasma/kwin freezes.

How to Reproduce Franz

  1. Open Franz (with WhatsApp and Messenger services).
  2. After it loads plasma/kwin freezes.

Expected behavior There should not be any freeze.

Environment

Notes I can upload the logs if you say which one you need.

esjeon commented 5 years ago

Sorry, I’m on a trip now, and will return on 6 Feb. I’ll look into this issue as a top priority once I return.

hjri commented 5 years ago

I think this maybe has something to do with geometry-restricted windows and krohnkite entering an endless loop of trying to set window geometry only to fail, which triggers change in geometry and causes krohnkite to try again. Just a speculation, but i do see a spam of similar messages in kwin log and xorg eats cpu 100% with kwin eating 10% or so.

hjri commented 5 years ago

I did some more screwing around and it seems like the problem only occurs with severely geometry-restricted windows and window padding enabled?

Window gaps: 16 between, 8 around. 3 apps: Slack, Riot, Quassel. All have sane geometry restrictions (window can get 300px-ish wide) Everything works normally 2 apps: Cantata (sane geometry restrictions), System Settings (window refuses to go smaller than half a screen) Kwin enters busy loop, there's spam of Krohnkite trying to resize systemsettings Works fine

Window gaps: all zero Both cases work fine

jjonw commented 5 years ago

Disabling gaps entirely solved the problem, thank you. Additionally, using only outer gaps (set to 3, inner set to 0) I have not experienced any freeze.

esjeon commented 5 years ago

@hjri wrote:

krohnkite entering an endless loop of trying to set window geometry only to fail, which triggers change in geometry and causes krohnkite to try again.

I think your guess is correct. Krohnkite does have this problem. If both application and Krohnkite have different idea on what is correct geometry, they'll end up fighting each other.

@hjri wrote:

only occurs with severely geometry-restricted windows and window padding enabled

It's likely that removing gap prevented Krohnkite from squeezing those windows too hard.

Anyways, it seems like this issue is related to issue #25 ("Resizing doesn't check for other windows' geometry restrictions"), which is a regression fixed by 31a7f30.

hjri commented 5 years ago

I still get freezes/spam even without gaps on e9bea92

Running kwin_x11 eventually gives spam like this.

qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: commitGeometry: client=KWin::Client(0x562dbf563970) from=QRect(1027, 18, 893, 1182) to=Rect(1027, 18, 893, 394)
qml: setTimeout/callback: poolSize=1
esjeon commented 5 years ago

@hjri, would you upload the whole log? I don't have enough information. Quassel limits only the minimum size (489x257), and, even when the limit is ignored, the application isn't supposed to freeze. It works flawless on my computer, for example.

hjri commented 5 years ago
qml: KROHNKITE: starting the script
qml: enableMonocleLayout : true
qml: enableSpreadLayout : false
qml: enableStairLayout : false
qml: enableTileLayout : true
qml: floatUtility : true
qml: layoutPerActivity : true
qml: layoutPerDesktop : true
qml: maximizeSoleTile : true
qml: mouseAdjustLayout : true
qml: noTileBorder : true
qml: screenGapBottom : 0
qml: screenGapLeft : 0
qml: screenGapRight : 0
qml: screenGapTop : 0
qml: tileLayoutGap : 0
qml: floatingClass: keepassxc
qml: ignoreClass: krunner,yakuake,spectacle,kded5,steam,plasmashell
qml: loadTile/create: client=KWin::Client(0x562dbf51e960) key=KWin::Client(0x562dbf51e960)
qml: loadTile/create: client=KWin::Client(0x562dbf563970) key=KWin::Client(0x562dbf563970)
qml: loadTile/create: client=KWin::Client(0x562dbf537110) key=KWin::Client(0x562dbf537110)
qml: loadTile/create: client=KWin::Client(0x562dbf52e3b0) key=KWin::Client(0x562dbf52e3b0)
qml: loadTile/create: client=KWin::Client(0x562dbf52c610) key=KWin::Client(0x562dbf52c610)
qml: loadTile/create: client=KWin::Client(0x562dbf515380) key=KWin::Client(0x562dbf515380)
qml: loadTile/create: client=KWin::Client(0x562dbf333270) key=KWin::Client(0x562dbf333270)
qml: loadTile/create: client=KWin::Client(0x562dbf473c10) key=KWin::Client(0x562dbf473c10)
qml: removeTile: key=KWin::Client(0x562dbf473c10)
qml: arrange: screenCount=1
qml: arrangeScreen: layout=StairLayout(nmaster=1, ratio=0.55) screen=0 tileables=4 visibles=4
qml: onTileGeometryChanged: tile=Tile(id=102760454, class=slack)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: commitGeometry: client=KWin::Client(0x562dbf563970) from=QRect(1056, 18, 864, 1182) to=Rect(1056, 18, 864, 394)
qml: onTileGeometryChanged: tile=Tile(id=85983233, class=riot)
qml: onTileGeometryChanged: tile=Tile(id=85983233, class=riot)
qml: onTileGeometryChanged: tile=Tile(id=85983233, class=riot)
qml: commitGeometry: client=KWin::Client(0x562dbf537110) from=QRect(1056, 412, 864, 425) to=Rect(1056, 412, 864, 394)
qml: onTileGeometryChanged: tile=Tile(id=148897798, class=dolphin)
qml: onTileGeometryChanged: tile=Tile(id=148897798, class=dolphin)
qml: onTileGeometryChanged: tile=Tile(id=148897798, class=dolphin)
qml: commitGeometry: client=KWin::Client(0x562dbf52e3b0) from=QRect(1056, 775, 864, 425) to=Rect(1056, 806, 864, 394)
qml: onTileGeometryChanged: tile=Tile(id=102760454, class=slack)
qml: setTimeout/callback: poolSize=1
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: commitGeometry: client=KWin::Client(0x562dbf563970) from=QRect(1056, 18, 864, 1182) to=Rect(1056, 18, 864, 394)
qml: setTimeout/callback: poolSize=1
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: commitGeometry: client=KWin::Client(0x562dbf563970) from=QRect(1056, 18, 864, 1182) to=Rect(1056, 18, 864, 394)
qml: setTimeout/callback: poolSize=1
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: commitGeometry: client=KWin::Client(0x562dbf563970) from=QRect(1056, 18, 864, 1182) to=Rect(1056, 18, 864, 394)
qml: setTimeout/callback: poolSize=1
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: commitGeometry: client=KWin::Client(0x562dbf563970) from=QRect(1056, 18, 864, 1182) to=Rect(1056, 18, 864, 394)
qml: setTimeout/callback: poolSize=1
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: commitGeometry: client=KWin::Client(0x562dbf563970) from=QRect(1056, 18, 864, 1182) to=Rect(1056, 18, 864, 394)
qml: setTimeout/callback: poolSize=1
qml: setTimeout/callback: poolSize=2
qml: setTimeout/callback: poolSize=3
qml: setTimeout/callback: poolSize=4
qml: setTimeout/callback: poolSize=5
qml: setTimeout/callback: poolSize=6
qml: setTimeout/callback: poolSize=7
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 5115, resource id: 12583467, major code: 3 (GetWindowAttributes), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 5116, resource id: 12583467, major code: 14 (GetGeometry), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 5121, resource id: 12583492, major code: 3 (GetWindowAttributes), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 5122, resource id: 12583492, major code: 14 (GetGeometry), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 5127, resource id: 12583517, major code: 3 (GetWindowAttributes), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 5128, resource id: 12583517, major code: 14 (GetGeometry), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 5133, resource id: 12583542, major code: 3 (GetWindowAttributes), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 5134, resource id: 12583542, major code: 14 (GetGeometry), minor code: 0
qml: onTileGeometryChanged: tile=Tile(id=102760454, class=slack)
qml: setTimeout/callback: poolSize=7
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: commitGeometry: client=KWin::Client(0x562dbf563970) from=QRect(1056, 18, 864, 1182) to=Rect(1056, 18, 864, 394)
qml: setTimeout/callback: poolSize=4
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: onTileGeometryChanged: tile=Tile(id=50331657, class=quassel)
qml: commitGeometry: client=KWin::Client(0x562dbf563970) from=QRect(1056, 18, 864, 1182) to=Rect(1056, 18, 864, 394)
qml: setTimeout/callback: poolSize=1

after which there's just spam of thing i posted previously interleaved with badwindow/baddrawable which i think are unrelated to krohnkite.

also plasmashell is in ignored list because i was trying to debug another bug that made kwin freeze when plasma crashed.

esjeon commented 5 years ago

@hjri Hmm, I can't reproduce the bug. Would you file a new issue? I need version info and steps to reproduce the bug. At least, Quassel works fine on my up-to-date Arch installation, at it never tries to resize its main window.

zyf0330 commented 5 years ago

Is there any update?

esjeon commented 5 years ago

@zyf0330 Sorry, the development has been stalled for a while. I'll come back to this shortly.

In the mean time, would you describe the specific problem you're having? Freezing is just a symptom, and can be caused by many different reasons. More info is definitely better.

zyf0330 commented 5 years ago

Appreciate your work. I use KDE on Ubuntu. Open krohnkite script will cause freeze problem. After boot some time, kwin freezes intervally. It seems that longer I use computer, freeze time becomes longer too. I use google-chrome, slack, wine, tilix, webstorm, etc. Freezed parts include taskbar and everything at it and klipper list called by shortcut, not these app.

Eon S. Jeon notifications@github.com 于2019年7月29日周一 下午7:41写道:

@zyf0330 https://github.com/zyf0330 Sorry, the development has been stalled for a while. I'll come back to this shortly.

In the mean time, would you describe the specific problem you're having? Freezing is just a symptom, and can be caused by many different reasons. More info is definitely better.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/esjeon/krohnkite/issues/24?email_source=notifications&email_token=AC3HTAOBT2WZMIENEEN4BVTQB3JNVA5CNFSM4GT3EM42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3AOC5A#issuecomment-515957108, or mute the thread https://github.com/notifications/unsubscribe-auth/AC3HTAPQWPX4UYSL7TLSD6DQB3JNVANCNFSM4GT3EM4Q .

hjri commented 5 years ago

IIRC workaround is to disable the "hide titlebar for maximized windows" script/option. KWin does have obscure option to do that without scripts but there's no GUI for it.

I had this problem and solved it somehow.

zyf0330 commented 5 years ago

@hjri I will try, thanks.

zyf0330 commented 5 years ago

@hjri This way almost solves this problem, you are right. Freezing still occurs sometimes but restores back to normal quickly.

zyf0330 commented 4 years ago

After restart computer, freeze occurs. Everytime do plasmashell restart, freeze disappears a period of time then appears, there is no regular pattern.