[vlc-commits] skins2(Linux): fix fullscreen for some Window Managers like Gnome3

Erwan git at videolan.org
Tue Sep 8 15:00:15 CEST 2015


vlc/vlc-2.2 | branch: master | Erwan <erwan at localhost.localdomain> | Tue Sep  8 13:46:54 2015 +0200| [5de9e9b0fbf8182598955b78ec7dd535a10ff486] | committer: Erwan Tulou

skins2(Linux): fix fullscreen for some Window Managers like Gnome3

   Some Window Managers (Gnome3, Unity) will keep the task bar displayed
   and limit the fullscreen display to the subarea outside the task bar
   if the window type is not set.
   Setting the Window type to normal ensures a clean 100% fullscreen.

   This fixes an issue reported on the forum at
   https://forum.videolan.org/viewtopic.php?f=13&t=127840

(cherry picked from commit 9c72f253f475bc661919360ffe99bc2a5b3fc56b)
Signed-off-by: Erwan Tulou <erwan10 at videolan.org>

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

 modules/gui/skins2/x11/x11_display.cpp |    3 +++
 modules/gui/skins2/x11/x11_display.hpp |    6 ++++++
 modules/gui/skins2/x11/x11_window.cpp  |   13 +++++++++++++
 3 files changed, 22 insertions(+)

diff --git a/modules/gui/skins2/x11/x11_display.cpp b/modules/gui/skins2/x11/x11_display.cpp
index ac02312..eac50c9 100644
--- a/modules/gui/skins2/x11/x11_display.cpp
+++ b/modules/gui/skins2/x11/x11_display.cpp
@@ -330,6 +330,9 @@ void X11Display::testEWMH()
         msg_Dbg( getIntf(), "%s support: yes", value );\
 }
 
+    TEST_EWMH( m_net_wm_window_type, "_NET_WM_WINDOW_TYPE" )
+    TEST_EWMH( m_net_wm_window_type_normal, "_NET_WM_WINDOW_TYPE_NORMAL" )
+
     TEST_EWMH( m_net_wm_state, "_NET_WM_STATE" )
     TEST_EWMH( m_net_wm_state_fullscreen, "_NET_WM_STATE_FULLSCREEN" )
     TEST_EWMH( m_net_wm_stays_on_top, "_NET_WM_STATE_STAYS_ON_TOP" )
diff --git a/modules/gui/skins2/x11/x11_display.hpp b/modules/gui/skins2/x11/x11_display.hpp
index 9647263..dea86e2 100644
--- a/modules/gui/skins2/x11/x11_display.hpp
+++ b/modules/gui/skins2/x11/x11_display.hpp
@@ -36,6 +36,8 @@
 #define XGC m_rDisplay.getGC()
 
 #define NET_WM_SUPPORTED          m_rDisplay.m_net_wm_supported
+#define NET_WM_WINDOW_TYPE        m_rDisplay.m_net_wm_window_type
+#define NET_WM_WINDOW_TYPE_NORMAL m_rDisplay.m_net_wm_window_type_normal
 #define NET_WM_STATE              m_rDisplay.m_net_wm_state
 #define NET_WM_STATE_FULLSCREEN   m_rDisplay.m_net_wm_state_fullscreen
 #define NET_WM_STATE_ABOVE        m_rDisplay.m_net_wm_state_above
@@ -85,6 +87,10 @@ public:
 
     /// EWMH spec
     Atom m_net_wm_supported;
+
+    Atom m_net_wm_window_type;
+    Atom m_net_wm_window_type_normal;
+
     Atom m_net_wm_state;
     Atom m_net_wm_state_above;
     Atom m_net_wm_state_fullscreen;
diff --git a/modules/gui/skins2/x11/x11_window.cpp b/modules/gui/skins2/x11/x11_window.cpp
index 6473c21..ca4e6b0 100644
--- a/modules/gui/skins2/x11/x11_window.cpp
+++ b/modules/gui/skins2/x11/x11_window.cpp
@@ -221,6 +221,19 @@ X11Window::X11Window( intf_thread_t *pIntf, GenericWindow &rWindow,
     XChangeProperty( XDISPLAY, m_wnd, NET_WM_PID, XA_CARDINAL, 32,
                      PropModeReplace, (unsigned char *)&pid, 1 );
 
+    if( NET_WM_WINDOW_TYPE != None )
+    {
+        if( type == GenericWindow::FullscreenWindow )
+        {
+            // Some Window Managers like Gnome3 limit fullscreen to the
+            // subarea outside the task bar if no window type is provided.
+            // For those WMs, setting type window to normal ensures a clean
+            // 100% fullscreen
+            XChangeProperty( XDISPLAY, m_wnd, NET_WM_WINDOW_TYPE,
+                         XA_ATOM, 32, PropModeReplace,
+                         (unsigned char *)&NET_WM_WINDOW_TYPE_NORMAL, 1 );
+        }
+    }
 }
 
 



More information about the vlc-commits mailing list