qtile: New Window Will Block Rofi

Issue description

I tried to use Rofi while a program was loading. The new program window blocked Rofi, even though Rofi was the Window taking input.

I have a few programs that take a bit to load. A browser is a good example, but this is better seen with something that can be partially transparent, like a terminal.

Here are the steps to reproduce:

  1. Make sure you use picom or Compton to get transparency.
  2. Put the following in a script:
#! /bin/sh

sleep 5

exec alacritty # or some other terminal with transparency
  1. Run rofi -show run and then type the full path of the script from 1.
  2. While the script is in its sleep, run rofi -show run again. Do not type anything.
  3. Wait until Alacritty or the terminal appears. You will see Rofi behind the terminal.
  4. Type stuff; it will appear in Rofi. Try to run a command; it will succeed even though Rofi is behind the terminal. You can also press escape to leave Rofi, but you cannot input to the window that just appeared until Rofi is gone.

This appears to be a bug in the stacking code documented here because the stacking code says that windows with _NET_WM_STATE_ABOVE set should be above new windows.

Rofi does have that set; its xprop output is the following:

WM_CLIENT_MACHINE(STRING) = "<redacted>"
_NET_WM_PID(CARDINAL) = 125634
WM_CLASS(STRING) = "rofi", "Rofi"
WM_NAME(STRING) = "rofi - run"
_NET_WM_NAME(UTF8_STRING) = "rofi - run"
WM_PROTOCOLS(ATOM): protocols  WM_TAKE_FOCUS
_NET_WM_STATE(ATOM) = _NET_WM_STATE_ABOVE

The logs below are of an exception that happens whenever a new window is opened.

Version

0.22.1

Backend

X11 (default)

Config

# Here is the relevant parts of my config:

dgroups_key_binder = None
dgroups_app_rules = []  # type: list
follow_mouse_focus = True
bring_front_click = False
cursor_warp = True
floating_layout = layout.Floating(
    border_focus=colors[8],
    border_width=2,
    float_rules=[
        # Run the utility of `xprop` to see the wm class and name of an X client.
        *layout.Floating.default_float_rules,
        Match(wm_class="confirmreset"),   # gitk
        Match(wm_class="dialog"),         # dialog boxes
        Match(wm_class="download"),       # downloads
        Match(wm_class="error"),          # error msgs
        Match(wm_class="file_progress"),  # file progress boxes
        Match(wm_class='kdenlive'),       # kdenlive
        Match(wm_class="makebranch"),     # gitk
        Match(wm_class="maketag"),        # gitk
        Match(wm_class="notification"),   # notifications
        Match(wm_class='pinentry-gtk-2'), # GPG key password entry
        Match(wm_class="ssh-askpass"),    # ssh-askpass
        Match(wm_class="toolbar"),        # toolbars
        Match(wm_class="Yad"),            # yad boxes
        Match(title="branchdialog"),      # gitk
        Match(title='Confirmation'),      # tastyworks exit box
        Match(title='Qalculate!'),        # qalculate-gtk
        Match(title="pinentry"),          # GPG key password entry
        Match(title="tastycharts"),       # tastytrade pop-out charts
        Match(title="tastytrade"),        # tastytrade pop-out side gutter
        Match(title="tastytrade - Portfolio Report"), # tastytrade pop-out allocation
        Match(wm_class="tasty.javafx.launcher.LauncherFxApp"), # tastytrade settings
        Match(wm_class="rofi"),
        Match(wm_class="Rofi"),
    ]
)
auto_fullscreen = True
focus_on_window_activation = "smart"
reconfigure_screens = True

# If things like steam games want to auto-minimize themselves when losing
# focus, should we respect this or not?
auto_minimize = True

# When using the Wayland backend, this can be used to configure input devices.
wl_input_rules = None

Logs

2023-09-23 16:34:43,279 ERROR libqtile loop.py:_handle_exception():L63 initializer for ctype 'PangoLayout *' must be a cdata pointer, not NoneType
Traceback (most recent call last):
  File "/usr/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/lib/python3.11/site-packages/libqtile/core/manager.py", line 871, in f
    func(*args)
  File "/usr/lib/python3.11/site-packages/libqtile/widget/notify.py", line 123, in real_update
    self.set_notif_text(notif)
  File "/usr/lib/python3.11/site-packages/libqtile/widget/notify.py", line 99, in set_notif_text
    self.text = pangocffi.markup_escape_text(notif.summary)
    ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/libqtile/widget/base.py", line 483, in text
    self.layout.text = self.formatted_text
    ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/libqtile/drawer.py", line 73, in text
    self.layout.set_attributes(attrlist)
  File "/usr/lib/python3.11/site-packages/libqtile/pangocffi.py", line 118, in set_attributes
    pango.pango_layout_set_attributes(self._pointer, attrs)
TypeError: initializer for ctype 'PangoLayout *' must be a cdata pointer, not NoneType
2023-09-23 16:34:43,280 ERROR libqtile loop.py:_handle_exception():L63 initializer for ctype 'PangoLayout *' must be a cdata pointer, not NoneType
Traceback (most recent call last):
  File "/usr/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/lib/python3.11/site-packages/libqtile/core/manager.py", line 871, in f
    func(*args)
  File "/usr/lib/python3.11/site-packages/libqtile/widget/notify.py", line 123, in real_update
    self.set_notif_text(notif)
  File "/usr/lib/python3.11/site-packages/libqtile/widget/notify.py", line 99, in set_notif_text
    self.text = pangocffi.markup_escape_text(notif.summary)
    ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/libqtile/widget/base.py", line 483, in text
    self.layout.text = self.formatted_text
    ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/libqtile/drawer.py", line 73, in text
    self.layout.set_attributes(attrlist)
  File "/usr/lib/python3.11/site-packages/libqtile/pangocffi.py", line 118, in set_attributes
    pango.pango_layout_set_attributes(self._pointer, attrs)
TypeError: initializer for ctype 'PangoLayout *' must be a cdata pointer, not NoneType
2023-09-23 16:34:43,280 ERROR libqtile loop.py:_handle_exception():L63 initializer for ctype 'PangoLayout *' must be a cdata pointer, not NoneType
Traceback (most recent call last):
  File "/usr/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/lib/python3.11/site-packages/libqtile/core/manager.py", line 871, in f
    func(*args)
  File "/usr/lib/python3.11/site-packages/libqtile/widget/notify.py", line 123, in real_update
    self.set_notif_text(notif)
  File "/usr/lib/python3.11/site-packages/libqtile/widget/notify.py", line 99, in set_notif_text
    self.text = pangocffi.markup_escape_text(notif.summary)
    ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/libqtile/widget/base.py", line 483, in text
    self.layout.text = self.formatted_text
    ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/libqtile/drawer.py", line 73, in text
    self.layout.set_attributes(attrlist)
  File "/usr/lib/python3.11/site-packages/libqtile/pangocffi.py", line 118, in set_attributes
    pango.pango_layout_set_attributes(self._pointer, attrs)
TypeError: initializer for ctype 'PangoLayout *' must be a cdata pointer, not NoneType
2023-09-23 16:34:43,281 ERROR libqtile loop.py:_handle_exception():L63 initializer for ctype 'PangoLayout *' must be a cdata pointer, not NoneType
Traceback (most recent call last):
  File "/usr/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/lib/python3.11/site-packages/libqtile/core/manager.py", line 871, in f
    func(*args)
  File "/usr/lib/python3.11/site-packages/libqtile/widget/notify.py", line 123, in real_update
    self.set_notif_text(notif)
  File "/usr/lib/python3.11/site-packages/libqtile/widget/notify.py", line 99, in set_notif_text
    self.text = pangocffi.markup_escape_text(notif.summary)
    ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/libqtile/widget/base.py", line 483, in text
    self.layout.text = self.formatted_text
    ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/libqtile/drawer.py", line 73, in text
    self.layout.set_attributes(attrlist)
  File "/usr/lib/python3.11/site-packages/libqtile/pangocffi.py", line 118, in set_attributes
    pango.pango_layout_set_attributes(self._pointer, attrs)
TypeError: initializer for ctype 'PangoLayout *' must be a cdata pointer, not NoneType

Required

  • I have searched past issues to see if this bug has already been reported, and it hasn’t been.
  • I understand that people give their precious time for free, and thus I’ve done my very best to make this problem as easy as possible to investigate.

About this issue

  • Original URL
  • State: open
  • Created 9 months ago
  • Comments: 15 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Works for me!

Sorry for the delay. Can confirm I get the issue with your steps.

Will take a look at fixing this.