]> git.sesse.net Git - vlc/commitdiff
skins2(Linux): set _NET_WM_PID in any case
authorErwan Tulou <erwan10@videolan.org>
Tue, 29 Jun 2010 07:12:09 +0000 (09:12 +0200)
committerErwan Tulou <erwan10@videolan.org>
Tue, 29 Jun 2010 07:29:00 +0000 (09:29 +0200)
whatever the window manager says (in _NET_SUPPORTED), setting it is never harmful. It may even be useful in some situations.

pointed out by courmisch

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

index c28b521b7abbaf4c02c0a4f102fac7df4f89c709..84b0305763c1893e6f74a59d46cb71277b8e1698 100644 (file)
@@ -253,6 +253,9 @@ X11Display::X11Display( intf_thread_t *pIntf ): SkinObject( pIntf ),
 
         // test EWMH capabilities
         testEWMH();
+
+        // Force _NET_WM_PID whatever the WM _NET_SUPPORTED says
+        m_net_wm_pid = XInternAtom( m_pDisplay, "_NET_WM_PID" , False );
     }
 }
 
index 28d3e0bba5aa2d47c19244df5a65425a19ea8515..64fa4aed54d1130f1facb2d47c4118ea7c6f56d3 100644 (file)
@@ -34,6 +34,7 @@
 #include "x11_dragdrop.hpp"
 #include "x11_factory.hpp"
 
+#include <assert.h>
 
 X11Window::X11Window( intf_thread_t *pIntf, GenericWindow &rWindow,
                       X11Display &rDisplay, bool dragDrop, bool playOnDrop,
@@ -184,12 +185,10 @@ X11Window::X11Window( intf_thread_t *pIntf, GenericWindow &rWindow,
     delete[] hostname;
 
     // initialize EWMH pid
-    if( NET_WM_PID != None )
-    {
-        pid_t pid = getpid();
-        XChangeProperty( XDISPLAY, m_wnd, NET_WM_PID, XA_CARDINAL, 32,
-                         PropModeReplace, (unsigned char *)&pid, 1 );
-    }
+    pid_t pid = getpid();
+    assert(  NET_WM_PID != None );
+    XChangeProperty( XDISPLAY, m_wnd, NET_WM_PID, XA_CARDINAL, 32,
+                     PropModeReplace, (unsigned char *)&pid, 1 );
 
 }