diff --git a/3rdparty/ext_qt/0003-Hack-for-fullscreen-workaround.patch b/3rdparty/ext_qt/0003-Hack-for-fullscreen-workaround.patch new file mode 100644 --- /dev/null +++ b/3rdparty/ext_qt/0003-Hack-for-fullscreen-workaround.patch @@ -0,0 +1,26 @@ +From 84a774e00e9d2535fdb8c798d7789130a9a008f6 Mon Sep 17 00:00:00 2001 +From: Michael Abrahams +Date: Wed, 22 Jun 2016 13:37:06 -0400 +Subject: [PATCH 3/4] Hack for fullscreen workaround + +https://bugreports.qt.io/browse/QTBUG-41309 +--- + src/plugins/platforms/windows/qwindowswindow.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp +index 9c6cb53..d0829e3 100644 +--- a/src/plugins/platforms/windows/qwindowswindow.cpp ++++ b/src/plugins/platforms/windows/qwindowswindow.cpp +@@ -1769,7 +1769,7 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState) + const UINT swpf = SWP_FRAMECHANGED | SWP_NOACTIVATE; + const bool wasSync = testFlag(SynchronousGeometryChangeEvent); + setFlag(SynchronousGeometryChangeEvent); +- SetWindowPos(m_data.hwnd, HWND_TOP, r.left(), r.top(), r.width(), r.height(), swpf); ++ SetWindowPos(m_data.hwnd, HWND_TOP, r.left()-1, r.top()-1, r.width()+2, r.height()+2, swpf); + if (!wasSync) + clearFlag(SynchronousGeometryChangeEvent); + QWindowSystemInterface::handleGeometryChange(window(), r); +-- +2.7.4.windows.1 + diff --git a/3rdparty/ext_qt/CMakeLists.txt b/3rdparty/ext_qt/CMakeLists.txt --- a/3rdparty/ext_qt/CMakeLists.txt +++ b/3rdparty/ext_qt/CMakeLists.txt @@ -9,6 +9,7 @@ COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/qtgui-private-headers.diff COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/0001-Don-t-request-the-MIME-image-every-time-Windows-asks.patch COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/0002-Hack-always-return-we-support-DIBV5.patch + COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/0003-Hack-for-fullscreen-workaround.patch INSTALL_DIR ${EXTPREFIX_qt} CONFIGURE_COMMAND /configure.bat -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdoc -skip qtenginio -skip qtgraphicaleffects -skip qtlocation -skip qtmultimedia -skip qtsensors -skip qtserialport -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtxmlpatterns -no-sql-sqlite -nomake examples -nomake tools -no-compile-examples -no-dbus -no-iconv -no-angle -no-ssl -no-openssl -no-wmf-backend -no-qml-debug -no-libproxy -no-system-proxies -no-nis -no-icu -no-mtdev -opensource -confirm-license -release -opengl desktop -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -prefix ${EXTPREFIX_qt} diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,12 @@ cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) -set(MIN_QT_VERSION 5.4.0) +if (WIN32) + set(MIN_QT_VERSION 5.6.0) +else() + set(MIN_QT_VERSION 5.4.0) +endif() + set(MIN_FRAMEWORKS_VERSION 5.7.0) if (POLICY CMP0002) diff --git a/libs/ui/KisMainWindow.cpp b/libs/ui/KisMainWindow.cpp --- a/libs/ui/KisMainWindow.cpp +++ b/libs/ui/KisMainWindow.cpp @@ -137,6 +137,9 @@ #include +#ifdef Q_OS_WIN + #include +#endif class ToolDockerFactory : public KoDockFactoryBase { @@ -495,6 +498,11 @@ d->viewManager->updateGUI(); d->viewManager->updateIcons(); +#ifdef Q_OS_WIN + auto w = qApp->activeWindow(); + if (w) QWindowsWindowFunctions::setHasBorderInFullScreen(w->windowHandle(), true); +#endif + QTimer::singleShot(1000, this, SLOT(checkSanity())); { @@ -505,6 +513,9 @@ d->tabSwitchCompressor.reset( new KisSignalCompressorWithParam(500, callback, KisSignalCompressor::FIRST_INACTIVE)); } + + + } void KisMainWindow::setNoCleanup(bool noCleanup) @@ -1779,17 +1790,13 @@ void KisMainWindow::viewFullscreen(bool fullScreen) { KisConfig cfg; -#ifdef Q_OS_WIN - cfg.setFullscreenMode(false); -#else cfg.setFullscreenMode(fullScreen); if (fullScreen) { setWindowState(windowState() | Qt::WindowFullScreen); // set } else { setWindowState(windowState() & ~Qt::WindowFullScreen); // reset } -#endif } void KisMainWindow::slotProgress(int value) @@ -2317,9 +2324,8 @@ actionManager->createStandardAction(KStandardAction::Open, this, SLOT(slotFileOpen())); actionManager->createStandardAction(KStandardAction::Quit, this, SLOT(slotFileQuit())); actionManager->createStandardAction(KStandardAction::ConfigureToolbars, this, SLOT(slotConfigureToolbars())); -#ifndef Q_OS_WIN actionManager->createStandardAction(KStandardAction::FullScreen, this, SLOT(viewFullscreen(bool))); -#endif + d->recentFiles = KStandardAction::openRecent(this, SLOT(slotFileOpenRecent(QUrl)), actionCollection()); connect(d->recentFiles, SIGNAL(recentListCleared()), this, SLOT(saveRecentFiles())); KSharedConfigPtr configPtr = KSharedConfig::openConfig(); diff --git a/libs/ui/KisViewManager.cpp b/libs/ui/KisViewManager.cpp --- a/libs/ui/KisViewManager.cpp +++ b/libs/ui/KisViewManager.cpp @@ -1040,15 +1040,15 @@ action->setChecked(!toggled); } } -#ifndef Q_OS_WIN + if (cfg.hideTitlebarFullscreen() && !cfg.fullscreenMode()) { if(toggled) { main->setWindowState( main->windowState() | Qt::WindowFullScreen); } else { main->setWindowState( main->windowState() & ~Qt::WindowFullScreen); } } -#endif + if (cfg.hideMenuFullscreen()) { if (!toggled) { if (main->menuBar()->dynamicPropertyNames().contains("wasvisible")) { diff --git a/libs/ui/dialogs/kis_dlg_preferences.cc b/libs/ui/dialogs/kis_dlg_preferences.cc --- a/libs/ui/dialogs/kis_dlg_preferences.cc +++ b/libs/ui/dialogs/kis_dlg_preferences.cc @@ -782,9 +782,6 @@ chkMenu->setChecked(cfg.hideMenuFullscreen()); chkScrollbars->setChecked(cfg.hideScrollbarsFullscreen()); chkStatusbar->setChecked(cfg.hideStatusbarFullscreen()); -#ifdef Q_OS_WINDOWS - chkTitlebar->setVisible(false); -#endif chkTitlebar->setChecked(cfg.hideTitlebarFullscreen()); chkToolbar->setChecked(cfg.hideToolbarFullscreen()); diff --git a/libs/ui/kis_config.cc b/libs/ui/kis_config.cc --- a/libs/ui/kis_config.cc +++ b/libs/ui/kis_config.cc @@ -1114,11 +1114,7 @@ bool KisConfig::hideTitlebarFullscreen(bool defaultValue) const { -#ifdef Q_OS_WIN - return false; -#else return (defaultValue ? true : m_cfg.readEntry("hideTitleBarFullscreen", true)); -#endif } void KisConfig::setHideTitlebarFullscreen(const bool value) const