Commit 51e41b79 authored by Erwan Tulou's avatar Erwan Tulou Committed by Jean-Baptiste Kempf

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
parent b973146c
...@@ -330,6 +330,9 @@ void X11Display::testEWMH() ...@@ -330,6 +330,9 @@ void X11Display::testEWMH()
msg_Dbg( getIntf(), "%s support: yes", value );\ 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, "_NET_WM_STATE" )
TEST_EWMH( m_net_wm_state_fullscreen, "_NET_WM_STATE_FULLSCREEN" ) 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" ) TEST_EWMH( m_net_wm_stays_on_top, "_NET_WM_STATE_STAYS_ON_TOP" )
......
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
#define XGC m_rDisplay.getGC() #define XGC m_rDisplay.getGC()
#define NET_WM_SUPPORTED m_rDisplay.m_net_wm_supported #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 m_rDisplay.m_net_wm_state
#define NET_WM_STATE_FULLSCREEN m_rDisplay.m_net_wm_state_fullscreen #define NET_WM_STATE_FULLSCREEN m_rDisplay.m_net_wm_state_fullscreen
#define NET_WM_STATE_ABOVE m_rDisplay.m_net_wm_state_above #define NET_WM_STATE_ABOVE m_rDisplay.m_net_wm_state_above
...@@ -85,6 +87,10 @@ public: ...@@ -85,6 +87,10 @@ public:
/// EWMH spec /// EWMH spec
Atom m_net_wm_supported; 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;
Atom m_net_wm_state_above; Atom m_net_wm_state_above;
Atom m_net_wm_state_fullscreen; Atom m_net_wm_state_fullscreen;
......
...@@ -221,6 +221,19 @@ X11Window::X11Window( intf_thread_t *pIntf, GenericWindow &rWindow, ...@@ -221,6 +221,19 @@ X11Window::X11Window( intf_thread_t *pIntf, GenericWindow &rWindow,
XChangeProperty( XDISPLAY, m_wnd, NET_WM_PID, XA_CARDINAL, 32, XChangeProperty( XDISPLAY, m_wnd, NET_WM_PID, XA_CARDINAL, 32,
PropModeReplace, (unsigned char *)&pid, 1 ); 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 );
}
}
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment