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

Changing a window title quickly with ewmh enabled makes xmonad unresponsive #227

Closed
1 of 2 tasks
l29ah opened this issue Feb 8, 2018 · 4 comments
Closed
1 of 2 tasks

Comments

@l29ah
Copy link
Contributor

l29ah commented Feb 8, 2018

Problem Description

When i use an app that can change window titles quickly (say, paludis or tkabber), xmonad doesn't respond for a while after such events, burning cpu cycles.

Configuration File

I use urxvt and for nvm in $(seq 0 1000); do echo -e '\e]2;test\a'; done to reproduce it. On my config (https://github.com/l29ah/xmonad-config) this makes xmonad unresponsive for the next 30 seconds or so, with the minimal test config the time is about 5s (yet if i drop ewmh from mine it doesn't slow xmonad at all).

module Main (main) where

import XMonad
import XMonad.Hooks.EwmhDesktops

main = xmonad $ ewmh defaultConfig

Checklist

l29ah added a commit to l29ah/xmonad-config that referenced this issue Feb 21, 2018
l29ah added a commit to l29ah/xmonad-config that referenced this issue Feb 21, 2018
@l29ah
Copy link
Contributor Author

l29ah commented Feb 21, 2018

It occurs in ewmhDesktopsLogHook.

l29ah added a commit to l29ah/misc that referenced this issue Apr 10, 2018
@bgamari
Copy link
Contributor

bgamari commented Jun 19, 2018

I have also long noticed that xmonad and taffybar are together rather absurdly sluggish and CPU-hungry. Today was a warm summer day where I wanted to work with my laptop on my lap and so after three years of tolerating this situation I decided I would finally investigate.

As pointed out above, the EWMH log hook is extremely naive. Every time ewmhDesktopsLogHook is invoked it updates all of the major EWMH properties, regardless of whether their values have actually changed. This in turn causes Taffybar to do a complete rebuild of its interface. As far as I can tell this all keeps a CPU occupied for tens to perhaps one hundred milliseconds. This appears to happen several times per second (judging by the output of xprop -root -spy).

This is just silly.

I'm no X11 expert but I suspect just adding a bit of caching to verify that something has actually changed before sending the property updates would alleviate a significant fraction of this busywork.

Determining why we are doing this several times per second would also be interesting. However, the caching is the easier place to start.

@geekosaur
Copy link
Contributor

The logHook is run on focus or workspace changes, and probably titlebar / app WM_NAME changes. If something is doing any of those that often. it's a bit pathological. (An argument could be made for the WM_NAME changes, but it's not a very strong argument.)

@bgamari
Copy link
Contributor

bgamari commented Jun 19, 2018

Pathological or not, I have been observing this behavior in my environment for years. It's not clear what causes the events, but I see no reason why the window manager should wake-up clients claiming properties have changed if there has been no change in value.

l29ah added a commit to l29ah/xmonad-config that referenced this issue Dec 13, 2019
This reverts commit 1586800.

no longer needed since
xmonad/xmonad-contrib#227 seems to be fixed

fixes obsproject/obs-studio#2237 for me
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants