这是indexloc提供的服务,不要输入任何密码
Skip to content

Why do we need to enable XSynchronization? #35

@maxbla

Description

@maxbla

The call xlib::XSynchronize(dpy_control, 1); in src/linux/listen.rs is necessary to pass tests, but I can't find any documentation indicating that it should be. In particular https://www.x.org/releases/X11R7.6/doc/libXtst/recordlib.html does not mention it. In fact the only documentation I could find on XSynchronize seems to indicate that synchronization will tank performance!

In particular, disabling XSynchronize repeatably causes the listen_and_simulate test to fail with

X Error of failed request:  XRecordBadContext
  Major opcode of failed request:  146 (RECORD)
  Minor opcode of failed request:  5 (XRecordEnableContext)
  Context in failed request:  0x4e00001
  Serial number of failed request:  10
  Current serial number in output stream:  10

Do you have any idea why this error happens? I think it might have to do with Xlib not being thread-safe (listen_and_simulate uses 2 threads), but that's really only a guess.

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