Xlib python:无法映射Firefox的菜单 [英] Xlib python: cannot map firefox menus

查看:176
本文介绍了Xlib python:无法映射Firefox的菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个小窗口管理器:

simplewm.py
https://github.com/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 https://github.com/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的菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆