示例#1
0
Window create_xwindow(WRootWin *rw, Window par, const WRectangle *geom, const char *name)
{
    int w=MAXOF(1, geom->w);
    int h=MAXOF(1, geom->h);
    const char *p[1];
    Window window;
    
    window = XCreateSimpleWindow(ioncore_g.dpy, par, geom->x, geom->y, w, h,
                               0, 0, BlackPixel(ioncore_g.dpy, rw->xscr));
    p[0] = name;
    xwindow_set_text_property(window, XA_WM_NAME, p, 1);

    return window;
}
示例#2
0
static void create_wm_windows(WRootWin *rootwin)
{
    const char *p[1];

    rootwin->dummy_win=XCreateWindow(ioncore_g.dpy, WROOTWIN_ROOT(rootwin),
                                     0, 0, 1, 1, 0,
                                     CopyFromParent, InputOnly,
                                     CopyFromParent, 0, NULL);

    p[0] = "WRootWin";
    xwindow_set_text_property(rootwin->dummy_win, XA_WM_NAME, p, 1);

    XSelectInput(ioncore_g.dpy, rootwin->dummy_win, PropertyChangeMask);
}
示例#3
0
/*EXTL_DOC
 * Set a text property for a window. The fields of \var{tab} starting from
 * 1 should be the different null-separated parts of the property.
 * See the \code{XSetTextProperty}(3) manual page for more information.
 */
EXTL_EXPORT
void ioncore_x_set_text_property(int win, int atom, ExtlTab tab)
{
    char **list;
    int i, n=extl_table_get_n(tab);
    
    list=ALLOC_N(char*, n);

    if(list==NULL)
        return;
    
    for(i=0; i<n; i++){
        list[i]=NULL;
        extl_table_geti_s(tab, i+1, &(list[i]));
    }
    
    xwindow_set_text_property(win, atom, (const char **)list, n);
    
    XFreeStringList(list);
}
示例#4
0
文件: netwm.c 项目: fargies/notion
void netwm_init_rootwin(WRootWin *rw)
{
    Atom atoms[N_NETWM];
        const char *p[1];

    atoms[0]=atom_net_wm_name;
    atoms[1]=atom_net_wm_state;
    atoms[2]=atom_net_wm_state_fullscreen;
    atoms[3]=atom_net_supporting_wm_check;
    atoms[4]=atom_net_virtual_roots;
    atoms[5]=atom_net_active_window;
    
    XChangeProperty(ioncore_g.dpy, WROOTWIN_ROOT(rw),
                    atom_net_supporting_wm_check, XA_WINDOW,
                    32, PropModeReplace, (uchar*)&(rw->dummy_win), 1);
    XChangeProperty(ioncore_g.dpy, WROOTWIN_ROOT(rw),
                    atom_net_supported, XA_ATOM,
                    32, PropModeReplace, (uchar*)atoms, N_NETWM);

    p[0]=libtu_progbasename();
    xwindow_set_text_property(rw->dummy_win, atom_net_wm_name, p, 1);
}