Skip to content

AttributeError: send_request. Did you mean: 'send_event'? #275

@funicat1

Description

@funicat1

I am trying to just move a window, but i get an error:

xeyes
524298
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/Xlib/display.py", line 224, in __getattr__
    function = self.display_extension_methods[attr]
KeyError: 'send_request'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tnb/PWM/main.py", line 19, in <module>
    win.configure(x=123, y=345)
  File "/usr/lib/python3/dist-packages/Xlib/xobject/drawable.py", line 408, in configure
    request.ConfigureWindow(display = self.display,
  File "/usr/lib/python3/dist-packages/Xlib/protocol/rq.py", line 1349, in __init__
    display.send_request(self, onerror is not None)
  File "/usr/lib/python3/dist-packages/Xlib/display.py", line 227, in __getattr__
    raise AttributeError(attr)
AttributeError: send_request. Did you mean: 'send_event'?

Heres my code:

from Xlib import X
from Xlib.display import Display
from Xlib import xobject

display = Display()
screen = display.screen()
root = screen.root
# get all windows
for window in root.query_tree().children:
    print(window.get_wm_name())
    # get window geometry
    geom = window.get_geometry()._data
    # check if y < 15
    if geom["y"] < 15:
        # move window a bit
        id = window.id
        print(id)
        win = xobject.drawable.Window(display, id)
        win.configure(x=123, y=345)

I think it may be a bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions