Skip to content

Commit

Permalink
[x11] Handle _NET_WM_DESKTOP client messages
Browse files Browse the repository at this point in the history
Command line tools like `wmctrl` can change the desktop for windows by
sending a ClientMessage with the `_NET_WM_DESKTOP` atom. This PR enables
support for that message.
  • Loading branch information
elParaguayo committed Jun 19, 2024
1 parent 1c6634d commit c574eac
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libqtile/backend/x11/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -2197,6 +2197,13 @@ def handle_ClientMessage(self, event): # noqa: N802
self.minimized = False
elif state == IconicState and self.qtile.config.auto_minimize:
self.minimized = True
elif atoms["_NET_WM_DESKTOP"] == opcode:
group_index = data.data32[0]
try:
group = self.qtile.groups[group_index]
self.togroup(group.name)
except (IndexError, TypeError):
logger.warning("Unexpected _NET_WM_DESKTOP value received: %s", group_index)
else:
logger.debug("Unhandled client message: %s", atoms.get_name(opcode))

Expand Down

0 comments on commit c574eac

Please sign in to comment.