xclip does not terminate when tracing it

那年仲夏 提交于 2019-12-01 05:19:16

XClip forks a child when launched without -verbose. The only difference with -verbose is that there is no child forked and the same original process handles ConvertSelection events.

Usually in X Window toolkits copy/paste is implemented via X Selections:

Selections are global server resources named by an atom and owned by a particular client. The number of selections is not limited by the protocol; as many selections as atoms may exist. Selections are designed to provide the basis for building communication mechanisms between clients. The official definition is found in the glosary of the X Protocol:

"...an indirect property with dynamic type; that is, rather than having the property stored in the server, it is maintained by some client (the ‘‘owner’’). A selection is global in nature and is thought of as belonging to the user (although maintained by clients), rather than as being private to a particular window subhierarchy or a particular set of clients."

From the applications perspective, selections provide a mechanism for transmitting information between X clients. As X is a networking protocol, the existance of a separate channel for data transmission between the various clients cannot be assumed to exist. Selections are intended only for data transfer which directly relates the the user-interface aspects of the application, although there isn’t any enforcement of this policy.

Content of selection is stored in application itself and requested with ConvertSelection event ("convert" here because there is a way for client to ask for particular mimetype (or "view", or format) of selected data. Conversion, again, happens in the application which owns selected buffer.

Because of this architecture, there is no way to "copy text to system buffer and exit" - because you are a system buffer. XClip simulates "copy and exit" by forking and daemonizing.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!