Skip to content
Browse files

X11 (squash): don't resize window after (full)screen switch if we hav…

…e wm

Resizing can trigger VM to set window as maximized or other.
  • Loading branch information...
1 parent b87b5ff commit 5dee1c778de0bce980ef6747523f5bfd85b2e469 @elupus committed Jul 19, 2012
Showing with 18 additions and 5 deletions.
  1. +18 −5 xbmc/windowing/X11/WinSystemX11.cpp
View
23 xbmc/windowing/X11/WinSystemX11.cpp
@@ -439,6 +439,7 @@ bool CWinSystemX11::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl
{
CLog::Log(LOGNOTICE, "CWinSystemX11::SetFullScreen - modes changed, reset device");
OnLostDevice();
+ XSync(m_dpy, False);
}
if(res.iInternal != m_visual->screen)
@@ -477,6 +478,12 @@ bool CWinSystemX11::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl
if(m_NET_WM_STATE_FULLSCREEN)
{
+ /* if on other screen, we must move it first, otherwise
+ * the window manager will fullscreen it on the wrong
+ * window */
+ if(fullScreen && GetCurrentScreen() != res.iScreen)
+ XMoveWindow(m_dpy, m_wmWindow, x, y);
+
if(attr2.map_state == IsUnmapped)
{
if(fullScreen)
@@ -508,13 +515,19 @@ bool CWinSystemX11::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl
XSendEvent(m_dpy, RootWindow(m_dpy, m_visual->screen), False,
SubstructureNotifyMask | SubstructureRedirectMask, &e);
}
- XSync(m_dpy, False);
- }
- if(fullScreen)
- XMoveResizeWindow(m_dpy, m_wmWindow, x, y, res.iWidth, res.iHeight);
+ }
else
- XResizeWindow(m_dpy, m_wmWindow, res.iWidth, res.iHeight);
+ {
+
+ if(fullScreen)
+ XMoveResizeWindow(m_dpy, m_wmWindow, x, y, res.iWidth, res.iHeight);
+ else
+ XResizeWindow(m_dpy, m_wmWindow, res.iWidth, res.iHeight);
+
+ }
+
+ XRaiseWindow(m_dpy, m_wmWindow);
XSync(m_dpy, False);
RefreshWindowState();

0 comments on commit 5dee1c7

Please sign in to comment.
Something went wrong with that request. Please try again.