简体   繁体   中英

How to change X window Properties

I am using gdm and my goal is to disable user interaction on a specific X window id.

I have tried to change many X-win properties like WM_PROTOCOLS, WM_HINTS, _NET_WM_ALLOWED_ACTIONS using xprop. Although, I was successful to change the properties it looks either wm is ignoring my changes and instead of taking defaults or an xsync(like) step is required to reflect those changes.

Using xprop as follows to change WM_HINTS:

xprop -id 0x6a001f9 -format WM_HINTS 32cbcxxiixx -set WM_HINTS 3,False,1,0x0,0x0,0,0,0x0,0x0

result of xprop -id 0x6a001f9 WM_HINTS [BEFORE]:

WM_HINTS(WM_HINTS):
    Client accepts input or input focus: True
    Initial state is Normal State.

result of xprop -id 0x6a001f9 WM_HINTS [AFTER]:

WM_HINTS(CARDINAL):
    Client accepts input or input focus: False
    Initial state is Normal State.

Apart from property type, which changes from WM_HINTS to CARDINAL, everything else is as expected but still, window # 0x6a001f9 receives input.

Output of xwininfo confirms that:

xwininfo -id 0x6a001f9 -wm ====>

xwininfo: Window id: 0x6a001f9 "Log Attribute Selection"

  No window manager hints defined
     Window manager hints:
     Displayed on desktop 0
     Process id: (unknown)
     Frame extents: 4, 4, 24, 4

What am I missing?

update: check this comment, it has the code that works here! https://gist.github.com/muktupavels/d03bb14ea6042b779df89b4c87df975d#gistcomment-3331569


unfortunatelly I cant comment... but this may help (one day when it is ready).

I have exactly the same problem:
https://unix.stackexchange.com/questions/590282/how-to-prevent-input-focus-for-a-single-window-in-gnome-shell-window-manager

I tested your command, it gives the same result, the window hint changes but it still receives input focus...

I guess we need to remove the WM_TAKE_FOCUS protocol then, but to do that may be complicated.

I think we could join forces to tweak this small code to let that happen:
https://gist.github.com/muktupavels/d03bb14ea6042b779df89b4c87df975d
I am still trying to understand it to see where/what to change there.

This may be the only answer if we manage to tweak that code.

obs.: what you did with xprop, may be if done with that gist code could work, it is like xprop cant change some things but can change others (like window title). So, it may be more simple as there is code there already to change window hints!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM