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_wm_state_demands_attention; atoms[4]=atom_net_supporting_wm_check; atoms[5]=atom_net_virtual_roots; atoms[6]=atom_net_active_window; atoms[7]=atom_net_wm_allowed_actions; atoms[8]=atom_net_wm_moveresize; 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, rw->dummy_win, 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(); /** * Unfortunately we cannot determine the charset of libtu_progbasename() * so we'll just have to guess it makes sense in the current locale charset */ xwindow_set_utf8_property(rw->dummy_win, atom_net_wm_name, p, 1); }
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); }
static void mod_sm_set_sessiondir() { const char *smdir=NULL, *id=NULL; char *tmp; bool ok=FALSE; smdir=getenv("SM_SAVE_DIR"); id=getenv("GNOME_DESKTOP_SESSION_ID"); /* Running under SM, try to use a directory specific * to the session. */ if(smdir!=NULL){ tmp=scat3(smdir, "/", libtu_progbasename()); }else if(id!=NULL){ tmp=scat("gnome-session-", id); if(tmp!=NULL){ char *p=tmp; while(1){ p=strpbrk(p, "/ :?*"); if(p==NULL) break; *p='-'; p++; } } }else{ tmp=scopy("default-session-sm"); } if(tmp!=NULL){ ok=extl_set_sessiondir(tmp); free(tmp); } if(!ok) warn(TR("Failed to set session directory.")); }