Skip to content

Commit

Permalink
Wayland: Fix self.qtile startup logic
Browse files Browse the repository at this point in the history
In #4757 we have fixed some of the logic with regards to setting
self.qtile. This means that in certain scenarios the self.qtile
attribute does not exist, e.g. when we're adding keyboards befor the
config is loaded.

We already mark these devices as "pending" if
self.qtile is `None`, but this now does not work as the attribute is not
set in the first place. Let's check with hasattr and remove the
unneeded self.qtile setting inside of the keyboard constructor.

This fixes #4767
  • Loading branch information
jwijenbergh committed Apr 15, 2024
1 parent a890670 commit 9ba420c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion libqtile/backend/wayland/core.py
Expand Up @@ -446,7 +446,7 @@ def _on_new_input(self, _listener: Listener, wlr_device: input_device.InputDevic
self.seat.set_capabilities(capabilities)

logger.info("New device: %s %s", *device.get_info())
if self.qtile:
if hasattr(self, "qtile"):
if self.qtile.config.wl_input_rules:
device.configure(self.qtile.config.wl_input_rules)
else:
Expand Down
1 change: 0 additions & 1 deletion libqtile/backend/wayland/inputs.py
Expand Up @@ -207,7 +207,6 @@ def configure(self, configs: dict[str, InputConfig]) -> None:
class Keyboard(_Device):
def __init__(self, core: Core, wlr_device: InputDevice, keyboard: WlrKeyboard):
super().__init__(core, wlr_device)
self.qtile = core.qtile
self.seat = core.seat
self.keyboard = keyboard
self.grabbed_keys = core.grabbed_keys
Expand Down

0 comments on commit 9ba420c

Please sign in to comment.