diff --git a/modules/gui/skins/x11/x11_window.cpp b/modules/gui/skins/x11/x11_window.cpp index f18561786e..1f25075c2a 100644 --- a/modules/gui/skins/x11/x11_window.cpp +++ b/modules/gui/skins/x11/x11_window.cpp @@ -2,7 +2,7 @@ * x11_window.cpp: X11 implementation of the Window class ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: x11_window.cpp,v 1.27 2003/06/22 13:06:23 asmax Exp $ + * $Id: x11_window.cpp,v 1.28 2003/10/19 20:05:56 asmax Exp $ * * Authors: Cyril Deguet * @@ -172,6 +172,39 @@ X11Window::~X11Window() XUNLOCK; } //--------------------------------------------------------------------------- +void X11Window::ToggleOnTop() +{ + XEvent ev; + ev.type = ClientMessage; + ev.xclient.display = display; + ev.xclient.window = Wnd; + ev.xclient.serial = 0; + ev.xclient.send_event = True; + ev.xclient.message_type = XInternAtom( display, "_NET_WM_STATE", True ); + ev.xclient.format = 32; + ev.xclient.data.l[1] = XInternAtom( display, "_NET_WM_STATE_ABOVE", + False); + ev.xclient.data.l[2] = 0; + ev.xclient.data.l[3] = 0; + ev.xclient.data.l[4] = 0; + + if( !p_intf->p_sys->b_on_top ) + { + // Set the window on top + ev.xclient.data.l[0] = 1; // _NET_WM_STATE_ADD + } + else + { + // Set the window not on top + ev.xclient.data.l[0] = 0; // _NET_WM_STATE_REMOVE + } + + XLOCK; + XSendEvent( display, DefaultRootWindow( display ), False, + SubstructureRedirectMask | SubstructureNotifyMask, &ev ); + XUNLOCK; +} +//--------------------------------------------------------------------------- void X11Window::OSShow( bool show ) { XLOCK;