]> git.sesse.net Git - vlc/commitdiff
skins2(Linux): add WM_CLASS and _NET_WM_PID properties to skins2 windows
authorErwan Tulou <erwan10@videolan.org>
Mon, 3 May 2010 09:02:42 +0000 (11:02 +0200)
committerErwan Tulou <erwan10@videolan.org>
Mon, 3 May 2010 09:12:09 +0000 (11:12 +0200)
This patch refers to trac #3594.
Tests required to ensure that it really solves the "Docky" issue

modules/gui/skins2/x11/x11_display.cpp
modules/gui/skins2/x11/x11_display.hpp
modules/gui/skins2/x11/x11_window.cpp

index 27adb1e722f688ed84e1e0fefce8ec2195dfa2e3..5c1c16a3662e138857ab9155b3580d095e4b3139 100644 (file)
@@ -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 );
index 4b30f7d2830ab1d48424502f7e33f5ee939be049..f019f1535bd0c90d8661fcc6f49949197ccab166 100644 (file)
@@ -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();
 
index d450d0d9cd7d86fbd65d4ddc52504875a63c0a29..f45609c200991b1ebf1a26c4b327c9764b99456c 100644 (file)
@@ -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 );
+
 }