Xlib python:无法映射Firefox的菜单

编程入门 行业动态 更新时间:2024-10-25 14:32:34
本文介绍了Xlib python:无法映射Firefox的菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我正在做一个小窗口管理器:

simplewm.py github/mpnordland/Mozzarella/blob/master/cheesewm.py~

我试图让firefox工作,但一直无法得到未映射的窗口(这是Firefox的菜单/右键单击选项)出现。

我尝试过window.map(),但是只让菜单闪烁并再次消失。这也导致了Xlib.X.UnmapNotify的事件。当我在Firefox中右击(或点击菜单)时,它会导致2个xlib事件:

xlib.protocol.event.ClientMessage(type = 161,window =< Xlib.display.Window 0x010005a9>,client_type = 343,data = (32,array('I',[0L,383L,0L,0L,0L])),sequence_number = 3106) Xlib.protocol.event.UnmapNotify(window =< ; Xlib.display.Window 0x010005a9>,类型= 146,event =< Xlib.display.Window 0x00000292>,sequence_number = 3108,from_configure = 0)

所以它会出现Firefox正在映射的菜单,我试图映射...:/ $ / $ / $ / $>

解决方案

更具体地说,必须调用set_input_focus()当您在框架窗口中获得EnterNotify时,您将在 main client 窗口中显示。 (也就是说,在焦点跟随鼠标模式)。 使用RevertToPointerRoot或RevertToParent似乎并不重要。

I'm making a small window manager based on:

simplewm.py github/mpnordland/Mozzarella/blob/master/cheesewm.py~

I'm trying to get firefox working but have been unable to get the unmapped windows (which are the firefox menu/right click options) to appear.

I have tried window.map() however that only makes the menu flicker and disappear again. It also causes an event of "Xlib.X.UnmapNotify"

When I right click (or click the menu) in firefox it causes 2 xlib events:

Xlib.protocol.event.ClientMessage(type = 161, window = <Xlib.display.Window 0x010005a9>, client_type = 343, data = (32, array('I', [0L, 383L, 0L, 0L, 0L])), sequence_number = 3106) Xlib.protocol.event.UnmapNotify(window = <Xlib.display.Window 0x010005a9>, type = 146, event = <Xlib.display.Window 0x00000292>, sequence_number = 3108, from_configure = 0)

So it would appear Firefox is unmapping the menus I'm trying to map... :/

解决方案

I've been searching for a solution for about a week too and this helped.

More specifically set_input_focus() has to be called on the main client window when you get an EnterNotify on the frame window. (That is, in a focus-follows-mouse mode). It doesn't seem to matter whether you use RevertToPointerRoot or RevertToParent.

更多推荐

Xlib python:无法映射Firefox的菜单

本文发布于:2023-07-31 07:27:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1256722.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:菜单   Xlib   python   Firefox

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!