https://tronche.com/gui/x/xlib/window-information/XConvertSelection.html

  1. XConvertSelection(display, selection, target, property, requestor, time)
  2. Display *display;
  3. Atom selection, target;
  4. Atom property;
  5. Window requestor;
  6. Time time;

Arguments

  • display Specifies the connection to the X server.
  • selection Specifies the selection atom.
  • target Specifies the target atom.
  • property Specifies the property name. You also can pass None .
  • requestor Specifies the requestor.
  • time Specifies the time. You can pass either a timestamp or CurrentTime.

    注: property,值为0的时候,是不允许粘贴的。比如hook的时候,比如软件A B C,在A中复制了一段内容,然后在B C中都不可以进行粘贴。 值为1的时候,才可以粘贴到其他软件或当前软件。

Description

XConvertSelection() requests that the specified selection be converted to the specified target type:

  • If the specified selection has an owner, the X server sends a .PN SelectionRequest event to that owner.
  • If no owner for the specified selection exists, the X server generates a SelectionNotify event to the requestor with property None.

The arguments are passed on unchanged in either of the events. There are two predefined selection atoms: PRIMARY and SECONDARY.

XConvertSelection() can generate BadAtom and BadWindow errors.

XConvertSelection()请求将指定的选择转换为指定的目标类型:

  • 如果指定的选择有一个所有者,X服务器将向该所有者发送一个. pn SelectionRequest事件。
  • 如果指定选择不存在所有者,则X服务器将向请求者生成一个属性为None的SelectionNotify事件。

参数在两个事件中都保持不变。有两个预定义的选择原子: PRIMARY和SECONDARY。

XConvertSelection()可以生成BadAtombadWindows错误。

Diagnostics

  • BadAtom A value for an Atom argument does not name a defined Atom.
  • BadWindow A value for a Window argument does not name a defined Window.

  • BadAtom 原子参数的值不命名定义的原子。

  • BadWindow 窗口参数的值不命名定义的窗口。