Minimize OpenGL Full Screen Xlib Window

I'm currently trying to enable alt-tabbing from a full-screen Xlib OpenGL window, but I have some difficulties. I tried XUnmapWindow(..), which works, but the resolution does not reset (unless I have to do it manually?), And the Xlib window does not appear as a minimized window (i.e. I can not alt-tab back to the window, although the application still works in the background).

The next thing I tried was changing my window from full screen mode to window mode (i.e. re-creating a window in window mode), but obviously I don't want to do this.

I listen to events FocusOutand FocusIn, FocusOutit seems, gets called when I am alt-tab, but I'm just not sure how to make my application minimize. If I do not do anything in my code when the event is fired FocusOut, my application does nothing (i.e. I cannot minimize the window).

Any help would be appreciated!

Change . Unfortunately, I was not able to get X Windows to properly minimize the full-screen window. So, to get around this problem, I solved a destroy()full-screen window, and then a create()new window in windowed mode. Seems to work well.

+5
source share
2 answers

XUnmapWindow() . EMWH ICCCM, , . , , . BTW Windows.

EDIT:

Xlib XIconifyWindow, ICCCM . WM. X11 , , reset , .

: , , , , Framebuffer , , /HUD- ( , ), . .

EDIT 2 : XIconifyWindow - / ,

/*
 * This function instructs the window manager to change this window from
 * NormalState to IconicState.
 */
Status XIconifyWindow(Display *dpy, Window w, int screen)
{
    XClientMessageEvent ev;
    Atom prop;

    prop = XInternAtom(dpy, "WM_CHANGE_STATE", False);
    if(prop == None)
    return False;

    ev.type = ClientMessage;
    ev.window = w;
    ev.message_type = prop;
    ev.format = 32;
    ev.data.l[0] = IconicState;
    return XSendEvent(dpy, RootWindow(dpy, screen), False,
            SubstructureRedirectMask|SubstructureNotifyMask,
            (XEvent *)&ev);
}
+4

:

XEvent xev;
Atom wm_state     =  XInternAtom(dpy, "_NET_WM_STATE", False);
Atom wm_hide_win  =  XInternAtom(dpy, "_NET_WM_STATE_HIDDEN", False);

memset(&xev, 0, sizeof(xev));
xev.type = ClientMessage;
xev.xclient.window = win;
xev.xclient.message_type = wm_state;
xev.xclient.format = 32;
xev.xclient.data.l[0] = _NET_WM_STATE_ADD;
xev.xclient.data.l[1] = wm_hide_win;

XSendEvent(dpy, DefaultRootWindow(dpy), False, SubstructureNotifyMask, &xev);

API- gnome, wnck_window_minimize() .

+1

All Articles