1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | /* Window manager hints mask bits */ #define InputHint (1L << 0) #define StateHint (1L << 1) #define IconPixmapHint (1L << 2) #define IconWindowHint (1L << 3) #define IconPositionHint (1L << 4) #define IconMaskHint (1L << 5) #define WindowGroupHint (1L << 6) #define UrgencyHint (1L << 8) #define AllHints (InputHint|StateHint|IconPixmapHint| IconWindowHint|IconPositionHint|IconMaskHint|WindowGroupHint) /* Values */ typedef struct { long flags; Bool input; int initial_state; Pixmap icon_pixmap; Window icon_window; int icon_x, icon_y; Pixmap icon_mask; XID window_group; } XWMHints; |
1 2 3 4 5 6 7 8 9 10 | void set_ input_hint(Display *dispay, Window w, Bool bInput) { XWMHints *wm_hints; wm_hints = XGetWMHints(display, w); wm_hints->flags |= InputHint; wm_hints->input = bInput; XSetWMHints(display, window, wm_hints); XFree(wm_hints); } |
1 2 3 4 5 6 7 8 | void set_wm_protocol(Display *display, Window w) { Atom protocols[3]; protocols[0] = XInternAtom(display, “WM_TAKE_FOCUS”, false); ….. //设置其它协议 XSetWMProtocols(display, w, protocols, 3); } |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |