Advertisement
Guest User

Untitled

a guest
Dec 12th, 2016
1,045
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.26 KB | None | 0 0
  1. // X11 Fullscreen window
  2. // !! Netestovany kod !!
  3. // Moznost 1, fullscreen na vybrane monitory
  4.  
  5. XClientMessageEvent msg = {
  6.     .type = ClientMessage,
  7.     .display = xdisplay_ptr,
  8.     .window = window_xid,
  9.     .message_type = XInternAtom(xdisplay_ptr, "_NET_WM_FULLSCREEN_MONITORS", True), // osetrit, jestli vrati None => neni podporovano
  10.     .format = 32,
  11.     .data = { .l = { topMonitor, bottomMonitor, leftMonitor, rightMonitor, 1 /* source, 0 = not specified, 1 = normal application, 2 = user interaction */ } }
  12. };
  13.  
  14. XSendEvent(xdisplay_ptr, root_window_xid, False, SubstructureRedirectMask | SubstructureNotifyMask, (XEvent*)&msg);
  15.  
  16. // Moznost 2, fullscreen a nechat WM rozhodnout, na ktere monitory
  17.  
  18. XClientMessageEvent msg = {
  19.     .type = ClientMessage,
  20.     .display = xdisplay_ptr,
  21.     .window = window_xid,
  22.     .message_type = XInternAtom(xdisplay_ptr, "_NET_WM_STATE", True), // osetrit, jestli vrati None => neni podporovano
  23.     .format = 32,
  24.     .data = { .l = {
  25.         1 /* _NET_WM_STATE_ADD */,
  26.         XInternAtom(xdisplay_ptr, "_NET_WM_STATE_FULLSCREEN", True) /* first property to add */,
  27.         None /* second property to add */,
  28.         0,
  29.         1 /* source, jako u moznosti 1 */
  30.     }}
  31. };
  32.  
  33. XSendEvent(xdisplay_ptr, root_window_xid, False, SubstructureRedirectMask | SubstructureNotifyMask, (XEvent*)&msg);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement