This is a patch file for CVS versions of "ogle" dated circa 2007. This patch fixes problems with fullscreen mode that occur under cer- tain conditions. Details: If EWMH fullscreen operations are enabled at the "oglerc" configuration level, the standard version of "ogle" may be unable to switch into [or out of] fullscreen mode, even if the local distro sup- ports the required EWMH features. This patch makes some minor changes to the XEvent messages used, and the modified version of "ogle" seems to work correctly. Note: The changes made here should be safe for use on most distros. However, this hasn't been verified. --- ogle.old/mpeg2_video/wm_state.c +++ ogle/mpeg2_video/wm_state.c @@ -636,19 +636,27 @@ } else { // ewmh_state_fullscreen is supported XEvent ev; - - ev.type = ClientMessage; - ev.xclient.window = win; - ev.xclient.message_type = XInternAtom(dpy, "_NET_WM_STATE", False); - ev.xclient.format = 32; - ev.xclient.data.l[0] = 1; // _NET_WM_STATE_ADD not an atom just a define - ev.xclient.data.l[1] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); - ev.xclient.data.l[2] = 0; - - XSendEvent(dpy, DefaultRootWindow(dpy), False, - SubstructureNotifyMask, &ev); - - + + ev.type = ClientMessage; + ev.xclient.window = win; + ev.xclient.serial = 0; + ev.xclient.send_event = True; + ev.xclient.message_type = XInternAtom + (dpy, "_NET_WM_STATE", False); + + ev.xclient.format = 32; + // _NET_WM_STATE_ADD [an integer, as + // opposed to an atom] + ev.xclient.data.l [0] = 1; + ev.xclient.data.l [1] = XInternAtom + (dpy, "_NET_WM_STATE_FULLSCREEN", False); + + ev.xclient.data.l [2] = 0; + ev.xclient.data.l [3] = 0; + ev.xclient.data.l [4] = 0; + + XSendEvent (dpy, DefaultRootWindow (dpy), False, + SubstructureRedirectMask | SubstructureNotifyMask, &ev); } current_state = WINDOW_STATE_FULLSCREEN; @@ -725,17 +733,27 @@ } else { // ewmh_state_fullscreen is supported XEvent ev; - - ev.type = ClientMessage; - ev.xclient.window = win; - ev.xclient.message_type = XInternAtom(dpy, "_NET_WM_STATE", False); - ev.xclient.format = 32; - ev.xclient.data.l[0] = 0; //_NET_WM_STATE_REMOVE not an atom just a define - ev.xclient.data.l[1] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); - ev.xclient.data.l[2] = 0; - - XSendEvent(dpy, DefaultRootWindow(dpy), False, - SubstructureNotifyMask, &ev); + + ev.type = ClientMessage; + ev.xclient.window = win; + ev.xclient.serial = 0; + ev.xclient.send_event = True; + ev.xclient.message_type = XInternAtom + (dpy, "_NET_WM_STATE", False); + + ev.xclient.format = 32; + // _NET_WM_STATE_REMOVE [an integer, + // as opposed to an atom] + ev.xclient.data.l [0] = 0; + ev.xclient.data.l [1] = XInternAtom + (dpy, "_NET_WM_STATE_FULLSCREEN", False); + + ev.xclient.data.l [2] = 0; + ev.xclient.data.l [3] = 0; + ev.xclient.data.l [4] = 0; + + XSendEvent (dpy, DefaultRootWindow (dpy), False, + SubstructureRedirectMask | SubstructureNotifyMask, &ev); } current_state = WINDOW_STATE_NORMAL; }