How to change _NET_WM_NAME (X Library)

别来无恙 提交于 2019-12-10 19:49:52

问题


I try use http://xkbind.sourceforge.net/ (useful for displaying keyboard state in window title) on my Mint Maya (based on Ubuntu 12.04)

But xkbind change only WM_NAME property

Here is xkbind.c code fragment

if(XGetWindowAttributes(dpy, window, &wa)) {
    XSelectInput(dpy, window, wa.your_event_mask&~PropertyChangeMask);
    XSync(dpy, False);
    XSetWMName(dpy, window, p_tp);
    XSelectInput(dpy, window, wa.your_event_mask);
}

What function should be used change _NET_WM_NAME property too?

Example

xkbind
gvim

xprop output

WM_NAME(STRING) = "Lat::[No Name] - GVIM"
_NET_WM_NAME(UTF8_STRING) = "[No Name] - GVIM"

回答1:


Straightforward call of XChangeProperty() should do the trick:

    XChangeProperty( display, win,
        XInternAtom(display, "_NET_WM_NAME", False),
        XInternAtom(display, "UTF8_STRING", False),
        8, PropModeReplace, (unsigned char *) utf8_buffer,
        count);


来源:https://stackoverflow.com/questions/23273292/how-to-change-net-wm-name-x-library

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