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

Xmobar High Cpu Usage With OverrideRedirect = False #1141

Open
Sofa44 opened this issue Sep 5, 2023 · 7 comments
Open

Xmobar High Cpu Usage With OverrideRedirect = False #1141

Sofa44 opened this issue Sep 5, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@Sofa44
Copy link

Sofa44 commented Sep 5, 2023

Describe the bug

Whenever I set it to false I get 50-60% CPU usage in htop, however setting it to true or removing it in general reduces the CPU usage back down to normal levels. This only occurs in LeftWM, I have tried it with dwm and it works normally without the excess CPU usage.

Expected behavior (optional)

I should get 1% cpu usage and no lag when I run xmobar with OverrideRedirect = False.

Steps to reproduce (optional)

  1. Go to your Xmobar Config.
  2. Add the Parameter OverrideRedirect = False to your Config
  3. Run Xmobar in LeftWM

Relevant log output (optional)

No response

OS / Distro

Linux Arch-Desktop 6.4.12-arch1-1

Additional System Information (optional)

I am using Systemd.
I am starting LeftWM with .xinitrc

LeftWM Check

:: LeftWM version: 0.4.2
:: LeftWM git hash: 357aea5
:: Enabled features:  journald-log lefthk
:: Checking feature dependencies . . .
    -> journald-log OK
    -> lefthk OK
:: Checking for leftwm binaries . . .
    -> Binaries OK
:: Loading configuration . . .
    -> Configuration loaded OK
:: Checking keybinds . . .
    -> All keybinds OK
:: Checking environment . . .
    -> Environment OK
:: Checking theme . . .
    -> Theme OK
@Sofa44 Sofa44 added the bug Something isn't working label Sep 5, 2023
@VuiMuich
Copy link
Member

VuiMuich commented Sep 7, 2023

Welcome fellow adventurer!

Thanks for reporting this, could you fill us in with some details about OverrideRedirect in xmobar, or provide a link to the related docs? That would be great.

@Sofa44
Copy link
Author

Sofa44 commented Sep 8, 2023

No worries!

Here is the quick-start documentations: https://codeberg.org/xmobar/xmobar/src/branch/master/doc/quick-start.org
Here is where you would find info about OverrideRedirect: https://codeberg.org/xmobar/xmobar/src/branch/master/doc/quick-start.org#user-content-headline-9

It states in the doc:
overrideRedirect If you're running xmobar in a tiling window manager, you might need to set this option to False so that it behaves as a docked application. Defaults to True.

@Souliboi
Copy link

Souliboi commented Sep 8, 2023

Bumping this by adding that it causes a memory leakage in the leftwm-worker like discussed in the Discord server and high CPU usage on NixOS with the upstream flake

@Sofa44
Copy link
Author

Sofa44 commented Sep 8, 2023

So how would I go about fixing the memory leakage?

@VuiMuich
Copy link
Member

VuiMuich commented Sep 9, 2023

So how would I go about fixing the memory leakage?

A quick workaround might be to leave it on true und set gutters in your theme.

To actually debug, I would start reading the code behind overrideRedirect to get an idea, where it interacts with X11 and next what the interaction ist with it set to false.
In our code base you could follow the command flow of a dock type window, but the information from the above research might help to find the entry point.

Iirc there are some measures against getting into in unfortunate update loop inside the main loop of leftwm-worker, probably the way xmobar "enforces" Dock window type circumvents those.

If you would be interested in fixing this bug, this would be most appreciated!

@Sofa44
Copy link
Author

Sofa44 commented Sep 11, 2023

Sorry for the late reply!

Honestly, school just started, and I probably won't have time for that. I'll try and see if I can find a solution, but I'll probably either set the gutter/margin like you said, or make a script that can toggle it (BTW quick question; Is it possible to change the gutter through a key-map or a command while running leftwm?)

I'll give an update if I find some sort of fix or what the problem is. If not, I'll post my workaround. Thanks

@VuiMuich
Copy link
Member

Honestly, school just started, and I probably won't have time for that. I'll try and see if I can find a solution, but I'll probably either set the gutter/margin like you said, or make a script that can toggle it (BTW quick question; Is it possible to change the gutter through a key-map or a command while running leftwm?)

You can bind LoadTheme as an external command to switch between a themefile with and without gutters, or put that in your toggle script.

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

3 participants