qtile / qtile

:cookie: A full-featured, hackable tiling window manager written and configured in Python (X11 + Wayland)
http://qtile.org
MIT License
4.69k stars 691 forks source link

TypeError in get_pixel_size calculation causing continues log messages #4864

Open arjanoosting opened 1 month ago

arjanoosting commented 1 month ago

Issue description

I installed the qtile master branch from git (1cd2e6fe47d19005d9323dd87c632594034a9a12) to check if another issue was fixed and noticed an high CPU load. In the logging I see errors about some pointer not being of the right type.

Rollback to tag v0.26.0 from git fixes the issue.

Version

0.26.1.dev24+g0efe540c

Backend

Wayland (experimental)

Config

No response

Logs

2024-06-06 15:18:29,008 ERROR libqtile loop.py:_handle_exception():L62 Exception in event loop:
Traceback (most recent call last):
  File "/usr/lib/python3.11/asyncio/events.py", line 84, in _run
    self._context.run(self._callback, *self._args)
  File "/home/arjan/.local/pipx/venvs/qtile/lib/python3.11/site-packages/libqtile/core/manager.py", line 962, in f
    func(*args)
  File "/home/arjan/.local/pipx/venvs/qtile/lib/python3.11/site-packages/libqtile/bar.py", line 622, in _actual_draw
    self._draw_queued = False
  File "/home/arjan/.local/pipx/venvs/qtile/lib/python3.11/site-packages/libqtile/bar.py", line 465, in _resize
    ic(widgets)

  File "/home/arjan/.local/pipx/venvs/qtile/lib/python3.11/site-packages/libqtile/bar.py", line 465, in <genexpr>
    ic(widgets)

  File "/home/arjan/.local/pipx/venvs/qtile/lib/python3.11/site-packages/libqtile/widget/base.py", line 958, in length
    return self.reflects.length
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/arjan/.local/pipx/venvs/qtile/lib/python3.11/site-packages/libqtile/widget/base.py", line 180, in length
    return int(self.calculate_length())
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/arjan/.local/pipx/venvs/qtile/lib/python3.11/site-packages/libqtile/widget/base.py", line 609, in calculate_length
    return min(self.layout.width, self.bar.width) + self.actual_padding * 2
               ^^^^^^^^^^^^^^^^^
  File "/home/arjan/.local/pipx/venvs/qtile/lib/python3.11/site-packages/libqtile/backend/base/drawer.py", line 427, in width
    return self.layout.get_pixel_size()[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/arjan/.local/pipx/venvs/qtile/lib/python3.11/site-packages/libqtile/pangocffi.py", line 134, in get_pixel_size
    pango.pango_layout_get_pixel_size(self._pointer, width, height)
TypeError: initializer for ctype 'PangoLayout *' must be a cdata pointer, not NoneType

Required

arjanoosting commented 1 month ago

Rollback to tag v0.26.0 from git fixes it

elParaguayo commented 1 month ago

Can you do a bisect to find the issue?

arjanoosting commented 1 month ago

I just did and the bad commit seems to be this one

git bisect good 0873f782a3374a64567d73da61efb66c7f55a9d1 is the first bad commit commit 0873f782a3374a64567d73da61efb66c7f55a9d1 Author: elParaguayo elparaguayocode@gmail.com Date: Sat Jun 1 11:05:31 2024 +0100

Fix StatusNotifier bug after reload

Icons were not being removed after reloading the config as the match
rule to listen for removed services were being deleted.

This PR refactors the code and adds the ability to preserve match rules
when config is being reloaded.

Fixes #4811

MANIFEST.in | 1 + libqtile/resources/status_notifier/init.py | 0 .../resources/status_notifier/fallback_icon.png | Bin 838 -> 0 bytes .../status_notifier/statusnotifieritem.py | 51 -- libqtile/utils.py | 8 +- .../widget/helpers/status_notifier/init.py | 24 + .../helpers/status_notifier/fallback_icon.png | Bin 0 -> 838 bytes .../helpers/status_notifier/statusnotifier.py | 679 +++++++++++++++++++++ libqtile/widget/statusnotifier.py | 619 +------------------ 9 files changed, 732 insertions(+), 650 deletions(-) delete mode 100644 libqtile/resources/status_notifier/init.py delete mode 100644 libqtile/resources/status_notifier/fallback_icon.png delete mode 100644 libqtile/resources/status_notifier/statusnotifieritem.py create mode 100644 libqtile/widget/helpers/status_notifier/init.py create mode 100644 libqtile/widget/helpers/status_notifier/fallback_icon.png create mode 100644 libqtile/widget/helpers/status_notifier/statusnotifier.py

arjanoosting commented 1 month ago

And if I take the master branch and revert that commit the errors in the log are indeed gone. I do still experience a high load from qtile, so I think that is caused by an different issue.