[vlc-commits] commit: skins2(Linux): add WM_CLASS and _NET_WM_PID properties to skins2 windows (Erwan Tulou )

git at videolan.org git at videolan.org
Mon May 3 11:13:42 CEST 2010


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Mon May  3 11:02:42 2010 +0200| [7df2787075068f51894e1332f8be8b2b43769d80] | committer: Erwan Tulou 

skins2(Linux): add WM_CLASS and _NET_WM_PID properties to skins2 windows

This patch refers to trac #3594.
Tests required to ensure that it really solves the "Docky" issue

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

 modules/gui/skins2/x11/x11_display.cpp |    2 ++
 modules/gui/skins2/x11/x11_display.hpp |    3 +++
 modules/gui/skins2/x11/x11_window.cpp  |   11 +++++++++++
 3 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/modules/gui/skins2/x11/x11_display.cpp b/modules/gui/skins2/x11/x11_display.cpp
index 27adb1e..5c1c16a 100644
--- a/modules/gui/skins2/x11/x11_display.cpp
+++ b/modules/gui/skins2/x11/x11_display.cpp
@@ -306,6 +306,8 @@ void X11Display::testEWMH()
 
     TEST_EWMH( m_net_wm_window_opacity, "_NET_WM_WINDOW_OPACITY" )
 
+    TEST_EWMH( m_net_wm_pid, "_NET_WM_PID" )
+
 #undef TEST_EWMH
 
     XFree( p_args.p_atom );
diff --git a/modules/gui/skins2/x11/x11_display.hpp b/modules/gui/skins2/x11/x11_display.hpp
index 4b30f7d..f019f15 100644
--- a/modules/gui/skins2/x11/x11_display.hpp
+++ b/modules/gui/skins2/x11/x11_display.hpp
@@ -43,6 +43,7 @@
 #define NET_WM_STAYS_ON_TOP       m_rDisplay.m_net_wm_stays_on_top
 #define NET_WM_WINDOW_OPACITY     m_rDisplay.m_net_wm_window_opacity
 
+#define NET_WM_PID                m_rDisplay.m_net_wm_pid
 
 /// Class for encapsulation of a X11 Display
 class X11Display: public SkinObject
@@ -94,6 +95,8 @@ public:
     Atom m_net_wm_stays_on_top;
     Atom m_net_wm_window_opacity;
 
+    Atom m_net_wm_pid;
+
     /// test EWMH capabilities
     void testEWMH();
 
diff --git a/modules/gui/skins2/x11/x11_window.cpp b/modules/gui/skins2/x11/x11_window.cpp
index d450d0d..f45609c 100644
--- a/modules/gui/skins2/x11/x11_window.cpp
+++ b/modules/gui/skins2/x11/x11_window.cpp
@@ -158,6 +158,17 @@ X11Window::X11Window( intf_thread_t *pIntf, GenericWindow &rWindow,
     // Associate the window to the main "parent" window
     XSetTransientForHint( XDISPLAY, m_wnd, m_rDisplay.getMainWindow() );
 
+    // initialize Class Hint
+    XClassHint classhint;
+    classhint.res_name = (char*) "vlc";
+    classhint.res_class = (char*) "Vlc";
+    XSetClassHint( XDISPLAY, m_wnd, &classhint );
+
+    // initialize EWMH pid
+    pid_t pid = getpid();
+    XChangeProperty( XDISPLAY, m_wnd, NET_WM_PID, XA_CARDINAL, 32,
+                     PropModeReplace, (unsigned char *)&pid, 1 );
+
 }
 
 



More information about the vlc-commits mailing list