Repository navigation
Fix high CPU usage on tiling WMs when moving windows across monitors (#706) - #737
Merged
Merged
Conversation
Jasu
commented
Dec 7, 2018
| rounded_size.0 as c_uint, | ||
| rounded_size.1 as c_uint, | ||
| ); | ||
| if util::wm_name_is_one_of(&["Xfwm4"]) { |
Contributor
Author
There was a problem hiding this comment.
I wonder if this should be combined with the new_inner_size == rounded_size two lines below? Any opinions?
Contributor
Author
There was a problem hiding this comment.
I realized that with the check here the WM name comparison would be done on every XConfigureWindow. I combined the check with the one below and force-pushed. I re-tested with Xfwm4 and i3.
This commit restricts an Xfwm4-specific DPI-preserving hack to Xfwm4 only. The hack saves and restores the DPI-adjusted size until the actual size matches. On tiling WMs like i3 this fails, since the size is constrained by the layout. This in turn causes a never-ending XResizeWindow vs. XConfigureWindow fight between the WM and the client, making the WM, winit client, and Xorg consume all CPU cycles available.
Jasu
force-pushed
the
fix-i3-cpu-usage
branch
from
December 7, 2018 14:40
ca48ab9 to
d0af38a
Compare
This was referenced Dec 7, 2018
francesca64
approved these changes
Dec 15, 2018
francesca64
left a comment
Member
There was a problem hiding this comment.
This looks great, thanks!
Contributor
|
LGTM
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit restricts an Xfwm4-specific DPI-preserving hack to Xfwm4 only, fixing #706.
The hack saves and restores the DPI-adjusted size until the actual size matches. On tiling WMs like i3 this fails, since the size is constrained by the layout. This in turn causes a never-ending XResizeWindow vs. XConfigureWindow fight between the WM and the client, making the WM, winit client, and Xorg consume all CPU cycles available.
Update: I also tested this on fluxbox, and it worked (preserved the DPI.)
Update 2: I got paranoid that I might have removed the only point where the DPI is preserved, so I tested this on one more WM, icewm, and it also worked on it.
CHANGELOG.mdif knowledge of this change could be valuable to users