From 1e9d9e20442ff9a68bbb038c8d9b9132ccf389e9 Mon Sep 17 00:00:00 2001 From: Andreas Holzammer Date: Thu, 2 Aug 2012 09:57:15 +0200 Subject: [PATCH] Fix FullScreen for Windows CE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For Windows CE the taskbar needs to be hidden manually. Change-Id: Ife69a2a91457ba0c162e4e1be88f87ad22c61190 Reviewed-by: Björn Breitmeyer Reviewed-by: Joerg Bornemann --- .../platforms/windows/qwindowswindow.cpp | 23 +++++++++++++++++++ .../platforms/windows/qwindowswindow.h | 3 +++ 2 files changed, 26 insertions(+) diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 9c40336069..1c76ff4ef8 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -703,6 +703,9 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const WindowData &data) : #ifdef QT_OPENGL_ES_2 , m_eglSurface(0) #endif +#ifdef Q_OS_WINCE + , m_previouslyHidden(false) +#endif { if (aWindow->surfaceType() == QWindow::OpenGLSurface) setFlag(OpenGLSurface); @@ -744,6 +747,14 @@ void QWindowsWindow::destroyWindow() eglDestroySurface(m_staticEglContext->display(), m_eglSurface); m_eglSurface = 0; } +#endif +#ifdef Q_OS_WINCE + if ((m_windowState & Qt::WindowFullScreen) && !m_previouslyHidden) { + HWND handle = FindWindow(L"HHTaskBar", L""); + if (handle) { + ShowWindow(handle, SW_SHOW); + } + } #endif if (m_data.hwnd != GetDesktopWindow()) DestroyWindow(m_data.hwnd); @@ -1210,6 +1221,18 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState) } if ((oldState == Qt::WindowFullScreen) != (newState == Qt::WindowFullScreen)) { +#ifdef Q_OS_WINCE + HWND handle = FindWindow(L"HHTaskBar", L""); + if (handle) { + if (newState == Qt::WindowFullScreen) { + BOOL hidden = ShowWindow(handle, SW_HIDE); + if (!hidden) + m_previouslyHidden = true; + } else if (!m_previouslyHidden){ + ShowWindow(handle, SW_SHOW); + } + } +#endif if (newState == Qt::WindowFullScreen) { #ifndef Q_FLATTEN_EXPOSE UINT newStyle = WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_POPUP; diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index b45b00b434..8e6ff9f891 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -270,6 +270,9 @@ private: EGLSurface m_eglSurface; QSharedPointer m_staticEglContext; #endif +#ifdef Q_OS_WINCE + bool m_previouslyHidden; +#endif }; // Conveniences for window frames.