[vlc-commits] commit: skins2(Linux): set _NET_WM_PID in any case (Erwan Tulou )

git at videolan.org git at videolan.org
Tue Jun 29 09:54:16 CEST 2010


vlc/vlc-1.1 | branch: master | Erwan Tulou <erwan10 at videolan.org> | Tue Jun 29 09:12:09 2010 +0200| [84903a96e3eecae8fbf601244040c2dc9059bdfa] | committer: Erwan Tulou 

skins2(Linux): set _NET_WM_PID in any case

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
(cherry picked from commit 3c73117a137e01d1770da9cd8e62827ca20d5f11)

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

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

diff --git a/modules/gui/skins2/x11/x11_display.cpp b/modules/gui/skins2/x11/x11_display.cpp
index c28b521..84b0305 100644
--- a/modules/gui/skins2/x11/x11_display.cpp
+++ b/modules/gui/skins2/x11/x11_display.cpp
@@ -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 );
     }
 }
 
diff --git a/modules/gui/skins2/x11/x11_window.cpp b/modules/gui/skins2/x11/x11_window.cpp
index 28d3e0b..64fa4ae 100644
--- a/modules/gui/skins2/x11/x11_window.cpp
+++ b/modules/gui/skins2/x11/x11_window.cpp
@@ -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 );
 
 }
 



More information about the vlc-commits mailing list