[vlc-devel] commit: Skins2: Add x11 transparency support. Hope it sets the property on the right Window; didn' t have a known transparent skin to test with. (JP Dinger )

git version control git at videolan.org
Sat Dec 5 22:35:15 CET 2009


vlc | branch: master | JP Dinger <jpd at videolan.org> | Sat Nov 28 15:08:59 2009 +0100| [df30bdb3d46bb245ec06daf2fbd117a37eb3cf82] | committer: JP Dinger 

Skins2: Add x11 transparency support. Hope it sets the property on the right Window; didn't have a known transparent skin to test with.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=df30bdb3d46bb245ec06daf2fbd117a37eb3cf82
---

 modules/gui/skins2/x11/x11_window.cpp |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/modules/gui/skins2/x11/x11_window.cpp b/modules/gui/skins2/x11/x11_window.cpp
index 426d0f3..8ca46a6 100644
--- a/modules/gui/skins2/x11/x11_window.cpp
+++ b/modules/gui/skins2/x11/x11_window.cpp
@@ -185,7 +185,16 @@ void X11Window::raise() const
 
 void X11Window::setOpacity( uint8_t value ) const
 {
-    // Sorry, the opacity cannot be changed :)
+    Atom opaq = XInternAtom(XDISPLAY, "_NET_WM_WINDOW_OPACITY", False);
+    if( 255==value )
+        XDeleteProperty(XDISPLAY, m_wnd, opaq);
+    else
+    {
+        uint32_t opacity = value * ((uint32_t)-1/255);
+        XChangeProperty(XDISPLAY, m_wnd, opaq, XA_CARDINAL, 32,
+                        PropModeReplace, (unsigned char *) &opacity, 1L);
+    }
+    XSync( XDISPLAY, False );
 }
 
 




More information about the vlc-devel mailing list