XsetSelectionWowner的麻烦
我有一个应用程序,其中打开了许多窗口。我使用xa_primary添加了复制/粘贴。
在我的应用程序中效果很好。从其他应用程序(Pluma,Firefox,Mate Terminal)复制到我的应用程序窗口时,它也可以正常工作。
当我调用XsetSelectionWowner(),带有时间戳等,如文档中所述,服务器确认了新所有者。也就是说,XgetSelectionWowner()返回我刚刚设置的所有者。
但是,当从我的应用程序复制到其他应用程序时,我没有收到SelectionRequest。
从我看到的情况下,服务器仅设置Call XsetSelectionWowner()中使用的显示器的所有者。
这应该如何工作吗?那么,还有其他事情要做所有应用程序的服务器设置所有者吗?
I have an application in which one opens many windows. I added copy/paste, using XA_PRIMARY.
That works fine within my application. It also works fine when copying from other applications (pluma, FireFox, mate terminal) into a window of my application.
When I call XSetSelectionOwner(), with time stamp etc as explained in the documentation, server acknowledges new owner. That is, XGetSelectionOwner() returns the owner I just set.
However, when copying from my app to other applications I do not receive SelectionRequest.
From what I see, server only sets the owner for the Display used in the call XSetSelectionOwner().
Is this how it is supposed to work? Then, is there something else to do so server sets owner for all apps?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
鉴于服务器的行为,我必须假设其他客户没有提出“主要”的要求。因此,我添加了“剪贴板”,现在一切正常。
该文档似乎说每个客户都将使用主要。进一步的阅读似乎表明,进行“选择”和“复制文本”之间存在差异。他们似乎将其作为一个有用的功能。除了混乱,我什么都看不到。无论如何,我的应用程序确实没有错误。我认为文档应该有一条线说:您必须同时实施主要和剪贴板。那是问题。
Given the behavior of the Server, I had to assume that other clients are not making their request for "PRIMARY". So, I added "CLIPBOARD", and now everything is working great.
The documentation appears to say that every client will use PRIMARY. Further reading seems to indicate that there is a difference between making a "selection", and "copying text". They seem to skirt this as a useful feature. I see nothing but confusion. Anyway, there really was no bug in my app. I think documentation should have a line saying: You must implement both, PRIMARY and CLIPBOARD. That was the problem.