X11/GLX - Fullscreen mode?

前端 未结 6 2004
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-05 11:50

I am trying to create a Linux application - a screensaver, in this case - and it is proving remarkably difficult to find information on the simple task of making a wind

6条回答
  •  后悔当初
    2021-02-05 12:15

    Best and easier way to achieve it is to use the ICCCM Specification atom which will work for most recent Window Managers. Just use the following code:

    Atom wm_state   = XInternAtom (display, "_NET_WM_STATE", true );
    Atom wm_fullscreen = XInternAtom (display, "_NET_WM_STATE_FULLSCREEN", true );
    
    XChangeProperty(display, window, wm_state, XA_ATOM, 32,
                    PropModeReplace, (unsigned char *)&wm_fullscreen, 1);
    

    Your window might be transparent, if so, just use XSetBackground() function where you need it and it's done.

提交回复
热议问题