Skip to content

BadDataError when trying to rename a window #4

Description

@lypwig

I would like to rename a window, but I can't. This is an example with getActiveWindow().

#!/usr/bin/python

from ewmh import EWMH
ewmh = EWMH()

# get the active window
win = ewmh.getActiveWindow()

title = "newtitle"
print 'data length:', len(title)

# set the name
ewmh.setWmName(win, title)

# flush request
ewmh.display.flush()

Logs:

<class 'Xlib.protocol.request.QueryExtension'>
data length: 8
Traceback (most recent call last):
  File "test_2.py", line 15, in <module>
    ewmh.setWmName(win, title)
  File "/usr/local/lib/python2.7/dist-packages/ewmh/ewmh.py", line 136, in setWmName
    self._setProperty('_NET_WM_NAME', name, win)
  File "/usr/local/lib/python2.7/dist-packages/ewmh/ewmh.py", line 321, in _setProperty
    ev = protocol.event.ClientMessage(window=win, client_type=self.display.get_atom(_type), data=(dataSize, data))
  File "/usr/lib/python2.7/dist-packages/Xlib/protocol/rq.py", line 1531, in __init__
    self._binary = self._fields.to_binary(*(), **keys)
  File "/usr/lib/python2.7/dist-packages/Xlib/protocol/rq.py", line 1138, in to_binary
    return self.to_binary(*varargs, **keys)
  File "<string>", line 2, in to_binary
  File "/usr/lib/python2.7/dist-packages/Xlib/protocol/rq.py", line 704, in pack_value
    % (value, ))
Xlib.protocol.rq.BadDataError: Wrong data length for FixedPropertyData: (8, 'newtitle')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions