Commit 1973fcba authored by Boudewijn Rempt's avatar Boudewijn Rempt

Merge branch 'master' into rempt/T379-resource-management

parents 61ffd16b 17f2c8da
if (WIN32)
SET(PREFIX_ext_fftw3 "${EXTPREFIX}" )
ExternalProject_Add( ext_fftw3
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://www.fftw.org/fftw-3.3.7.tar.gz
URL_MD5 0d5915d7d39b3253c1cc05030d79ac47
URL http://www.fftw.org/fftw-3.3.8.tar.gz
URL_MD5 8aac833c943d8e90d51b697b27d4384d
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/patch_mingw.patch
INSTALL_DIR ${PREFIX_ext_fftw3}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PREFIX_ext_fftw3} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PREFIX_ext_fftw3} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE} -DWITH_COMBINED_THREADS=ON -ENABLE_SSE=ON -ENABLE_SSE2=ON -DBUILD_TESTS=OFF
UPDATE_COMMAND ""
)
else()
SET(PREFIX_ext_fftw3 "${EXTPREFIX}" )
ExternalProject_Add( ext_fftw3
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://www.fftw.org/fftw-3.3.8.tar.gz
URL_MD5 8aac833c943d8e90d51b697b27d4384d
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/patch_mingw.patch
INSTALL_DIR ${PREFIX_ext_fftw3}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PREFIX_ext_fftw3} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE} -DDENABLE_THREADS=ON -ENABLE_SSE=ON -ENABLE_SSE2=ON -DBUILD_TESTS=OFF
UPDATE_COMMAND ""
)
endif()
......@@ -3,8 +3,8 @@ SET(PREFIX_ext_gmic "${EXTPREFIX}" )
# Download the gmic sources
ExternalProject_Add( ext_gmic_base
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL https://gmic.eu/files/source/gmic_2.4.5.tar.gz
URL_MD5 e1bc34379800d9b1330419a695824caf
URL https://gmic.eu/files/source/gmic_2.5.6.tar.gz
URL_MD5 8deabebc29081657986ae6531e3fc1d7
SOURCE_DIR gmic
......@@ -19,8 +19,8 @@ ExternalProject_Add( ext_gmic_base
# FIXME: Forcing CMAKE_BUILD_TYPE to Release
ExternalProject_Add( ext_gmic_qt
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL https://github.com/c-koi/gmic-qt/archive/v.2.4.5.tar.gz
URL_MD5 664ecce5516c2f7995882487b317dcb0
URL https://github.com/c-koi/gmic-qt/archive/v.2.5.6.tar.gz
URL_MD5 4e7cf71d6348d44f98d3c132433c358c
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/desktop_icon.diff
SOURCE_DIR gmic-qt
......
......@@ -46,8 +46,11 @@ ExternalProject_Add(
URL http://ftp.videolan.org/pub/videolan/x265/x265_3.0.tar.gz
URL_MD5 8ff1780246bb7ac8506239f6129c04ec
INSTALL_DIR ${EXTPREFIX_heif}
SOURCE_SUBDIR source/
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_heif}
BUILD_COMMAND make
INSTALL_COMMAND make install
......
SET(PREFIX_ext_poppler "${EXTPREFIX}" )
list(APPEND _PopplerPatch_COMMAND
${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/no_tests.diff
)
if(APPLE)
list(APPEND _PopplerPatch_COMMAND
COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/mac_popplerIconv.patch
)
endif(APPLE)
ExternalProject_Add( ext_poppler
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL https://poppler.freedesktop.org/poppler-0.62.0.tar.xz
URL_MD5 42b801f2defaccb6b6cf1bf783ee1552
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/no_tests.diff
PATCH_COMMAND ${_PopplerPatch_COMMAND}
INSTALL_DIR ${PREFIX_ext_poppler}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PREFIX_ext_poppler} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE} -DBUILD_GTK_TESTS=OFF -DBUILD_QT5_TESTS=FALSE -DBUILD_CPP_TESTS=FALSE -DENABLE_UTILS=FALSE -DENABLE_GLIB=FALSE -DENABLE_LIBOPENJPEG=none
......
diff --git a/cmake/modules/FindIconv.cmake b/cmake/modules/FindIconv.cmake
index 338d17d..5f029b7 100644
--- a/cmake/modules/FindIconv.cmake
+++ b/cmake/modules/FindIconv.cmake
@@ -15,7 +15,7 @@ ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
FIND_PATH(ICONV_INCLUDE_DIR iconv.h)
-FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c)
+FIND_LIBRARY(ICONV_LIBRARIES NO_DEFAULT_PATH PATHS ${CMAKE_INSTALL_PREFIX}/lib /usr/lib NAMES iconv libiconv libiconv-2 )
IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
SET(ICONV_FOUND TRUE)
From f62b528cbc9e3ef75584839d995e4b7369ad3ff8 Mon Sep 17 00:00:00 2001
From: Dmitry Kazakov <dimula73@gmail.com>
Date: Sat, 13 Apr 2019 18:08:33 +0300
Subject: [PATCH] Fetch stylus button remapping from WinTab driver
The user can remap the stylus buttons using tablet driver settings.
This information is available to the application via CSR_SYSBTNMAP
WinTab feature. We should fetch this information every time the
stylus gets into proximity, because the user can change these settings
on the fly.
---
.../windows/qwindowstabletsupport.cpp | 72 ++++++++++++++++++-
.../platforms/windows/qwindowstabletsupport.h | 2 +
2 files changed, 73 insertions(+), 1 deletion(-)
diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
index fa209f09..31655101 100644
--- a/src/plugins/platforms/windows/qwindowstabletsupport.cpp
+++ b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
@@ -435,6 +435,27 @@ bool QWindowsTabletSupport::translateTabletProximityEvent(WPARAM /* wParam */, L
m_currentDevice = m_devices.size();
m_devices.push_back(tabletInit(uniqueId, cursorType));
}
+
+ /**
+ * We should check button map for changes on every proximity event, not
+ * only during initialization phase.
+ *
+ * WARNING: in 2016 there were some Wacom table drivers, which could mess up
+ * button mapping if the remapped button was pressed, while the
+ * application **didn't have input focus**. This bug is somehow
+ * related to the fact that Wacom drivers allow user to configure
+ * per-application button-mappings. If the bug shows up again,
+ * just move this button-map fetching into initialization block.
+ *
+ * See https://bugs.kde.org/show_bug.cgi?id=359561
+ */
+ BYTE logicalButtons[32];
+ memset(logicalButtons, 0, 32);
+ m_winTab32DLL.wTInfo(WTI_CURSORS + currentCursor, CSR_SYSBTNMAP, &logicalButtons);
+ m_devices[m_currentDevice].buttonsMap[0x1] = logicalButtons[0];
+ m_devices[m_currentDevice].buttonsMap[0x2] = logicalButtons[1];
+ m_devices[m_currentDevice].buttonsMap[0x4] = logicalButtons[2];
+
m_devices[m_currentDevice].currentPointerType = pointerType(currentCursor);
m_state = PenProximity;
qCDebug(lcQpaTablet) << "enter proximity for device #"
@@ -446,6 +467,50 @@ bool QWindowsTabletSupport::translateTabletProximityEvent(WPARAM /* wParam */, L
return true;
}
+Qt::MouseButton buttonValueToEnum(DWORD button,
+ const QWindowsTabletDeviceData &tdd) {
+ const int leftButtonValue = 0x1;
+ const int middleButtonValue = 0x2;
+ const int rightButtonValue = 0x4;
+ const int doubleClickButtonValue = 0x7;
+
+ button = tdd.buttonsMap.value(button);
+
+ return button == leftButtonValue ? Qt::LeftButton :
+ button == rightButtonValue ? Qt::RightButton :
+ button == doubleClickButtonValue ? Qt::MiddleButton :
+ button == middleButtonValue ? Qt::MiddleButton :
+ button ? Qt::LeftButton /* fallback item */ :
+ Qt::NoButton;
+}
+
+void convertTabletButtons(DWORD btnNew,
+ Qt::MouseButtons *buttons,
+ const QWindowsTabletDeviceData &tdd,
+ const Qt::KeyboardModifiers keyboardModifiers) {
+
+ *buttons = Qt::NoButton;
+ for (int i = 0; i < 3; i++) {
+ int btn = 0x1 << i;
+
+ if (btn & btnNew) {
+ Qt::MouseButton convertedButton =
+ buttonValueToEnum(btn, tdd);
+
+ *buttons |= convertedButton;
+
+ /**
+ * If a button that is present in hardware input is
+ * mapped to a Qt::NoButton, it means that it is going
+ * to be eaten by the driver, for example by its
+ * "Pan/Scroll" feature. Therefore we shouldn't handle
+ * any of the events associated to it. We'll just return
+ * Qt::NoButtons here.
+ */
+ }
+ }
+}
+
bool QWindowsTabletSupport::translateTabletPacketEvent()
{
static PACKET localPacketBuf[TabletPacketQSize]; // our own tablet packet queue.
@@ -552,9 +617,14 @@ bool QWindowsTabletSupport::translateTabletPacketEvent()
<< tiltY << "tanP:" << tangentialPressure << "rotation:" << rotation;
}
+ Qt::MouseButtons buttons;
+ convertTabletButtons(packet.pkButtons, &buttons,
+ m_devices.at(m_currentDevice),
+ keyboardModifiers);
+
QWindowSystemInterface::handleTabletEvent(target, packet.pkTime, QPointF(localPos), globalPosF,
currentDevice, currentPointer,
- static_cast<Qt::MouseButtons>(packet.pkButtons),
+ buttons,
pressureNew, tiltX, tiltY,
tangentialPressure, rotation, z,
uniqueId,
diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.h b/src/plugins/platforms/windows/qwindowstabletsupport.h
index d91701d6..5b1ddb52 100644
--- a/src/plugins/platforms/windows/qwindowstabletsupport.h
+++ b/src/plugins/platforms/windows/qwindowstabletsupport.h
@@ -45,6 +45,7 @@
#include <QtCore/qvector.h>
#include <QtCore/qpoint.h>
+#include <QtCore/qmap.h>
#include <wintab.h>
@@ -100,6 +101,7 @@ struct QWindowsTabletDeviceData
qint64 uniqueId = 0;
int currentDevice = 0;
int currentPointerType = 0;
+ QMap<quint8, quint8> buttonsMap;
};
#ifndef QT_NO_DEBUG_STREAM
--
2.20.1.windows.1
From 30f28be2a239d82c2d7f2d6a37df4acb300d7cef Mon Sep 17 00:00:00 2001
From: Dmitry Kazakov <dimula73@gmail.com>
Date: Sat, 13 Apr 2019 20:29:14 +0300
Subject: [PATCH] Disable tablet relative mode in Qt
---
src/plugins/platforms/windows/qwindowstabletsupport.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
index 31655101..3e35b146 100644
--- a/src/plugins/platforms/windows/qwindowstabletsupport.cpp
+++ b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
@@ -562,6 +562,11 @@ bool QWindowsTabletSupport::translateTabletPacketEvent()
m_state = PenDown;
m_mode = (mouseLocation - globalPosF).manhattanLength() > m_absoluteRange
? MouseMode : PenMode;
+
+ // Krita doesn't support mouse mode. And this code may break
+ // normal painting, so we just disable it.
+ m_mode = PenMode;
+
qCDebug(lcQpaTablet) << __FUNCTION__ << "mode=" << m_mode << "pen:"
<< globalPosF << "mouse:" << mouseLocation;
}
--
2.20.1.windows.1
From 087561675d1c1922265c3c52faeac61ab1bc2ecf Mon Sep 17 00:00:00 2001
From: Dmitry Kazakov <dimula73@gmail.com>
Date: Sat, 13 Apr 2019 23:24:01 +0300
Subject: [PATCH] Fetch mapped screen size from the Wintab driver
Some devices, like Microsoft Surface Pro 5, don't map tablet's
input range to the entire virtual screen area, but map it to
the primary display that has actual built-in tablet sensor.
In such cases we should fetch actualy mapped aread from Wintab's
lcSys{Org,Ext}{X,Y} fields and use it for cursor mapping.
If one wants to fall back to the old screen size detection method,
then an environment variable can be set:
QT_IGNORE_WINTAB_MAPPING=1
When the variable is set, the scaling is done via virtual desktop
area only.
If the tablet driver is broken (e.g. Microsoft SP5, when primary
display is set to an external monitor) the user might want to override
mapping completely. Then the following variable can be used:
QT_WINTAB_DESKTOP_RECT=x;y;width;height
---
.../windows/qwindowstabletsupport.cpp | 89 ++++++++++++++++++-
.../platforms/windows/qwindowstabletsupport.h | 13 ++-
2 files changed, 99 insertions(+), 3 deletions(-)
diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
index 18ec05e4..6a1bf02b 100644
--- a/src/plugins/platforms/windows/qwindowstabletsupport.cpp
+++ b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
@@ -53,6 +53,7 @@
#include <QtCore/qdebug.h>
#include <QtCore/qvarlengtharray.h>
#include <QtCore/qmath.h>
+#include <QtCore/qregularexpression.h>
#include <private/qguiapplication_p.h>
#include <QtCore/private/qsystemlibrary_p.h>
@@ -216,6 +217,10 @@ QWindowsTabletSupport::QWindowsTabletSupport(HWND window, HCTX context)
// Some tablets don't support tilt, check if it is possible,
if (QWindowsTabletSupport::m_winTab32DLL.wTInfo(WTI_DEVICES, DVC_ORIENTATION, &orientation))
m_tiltSupport = orientation[0].axResolution && orientation[1].axResolution;
+
+ connect(qGuiApp, &QGuiApplication::primaryScreenChanged,
+ this, QWindowsTabletSupport::slotPrimaryScreenChanged);
+ slotScreenGeometryChanged();
}
QWindowsTabletSupport::~QWindowsTabletSupport()
@@ -394,6 +399,84 @@ QWindowsTabletDeviceData QWindowsTabletSupport::tabletInit(qint64 uniqueId, UINT
return result;
}
+void QWindowsTabletSupport::slotPrimaryScreenChanged(QScreen *screen)
+{
+ if (m_connectedScreen)
+ disconnect(m_connectedScreen, 0, this, 0);
+
+ m_connectedScreen = screen;
+
+ if (m_connectedScreen)
+ connect(m_connectedScreen, &QScreen::virtualGeometryChanged,
+ this, &QWindowsTabletSupport::slotScreenGeometryChanged);
+
+ slotScreenGeometryChanged();
+}
+
+void QWindowsTabletSupport::slotScreenGeometryChanged()
+{
+ /**
+ * Some Wintab implementations map the tablet area to the entire
+ * virtual screen, but others (e.g. Microsoft SP5) don't. They
+ * may input range to a single (built-in) screen. The logic is
+ * quite obvious: when the screen has integrated tablet device,
+ * one cannot map this tablet device to another display.
+ *
+ * For such devices, we should always request mapped area from
+ * lcSys{Org,Ext}{X,Y} fields and use it accordingly.
+ */
+
+ LOGCONTEXT lc;
+ QWindowsTabletSupport::m_winTab32DLL.wTInfo(WTI_DEFSYSCTX, 0, &lc);
+ m_wintabScreenGeometry = QRect(lc.lcSysOrgX, lc.lcSysOrgY, lc.lcSysExtX, lc.lcSysExtY);
+
+ qCDebug(lcQpaTablet) << "Updated tablet mapping: " << m_wintabScreenGeometry;
+ if (QGuiApplication::primaryScreen()) {
+ qCDebug(lcQpaTablet) << " real desktop geometry: " << QWindowsScreen::virtualGeometry(QGuiApplication::primaryScreen()->handle());
+ }
+}
+
+void QWindowsTabletSupport::updateEffectiveScreenGeometry()
+{
+ QRect customGeometry;
+ bool dontUseWintabDesktopRect = false;
+
+ const QString geometry = qEnvironmentVariable("QT_WINTAB_DESKTOP_RECT");
+ if (!geometry.isEmpty()) {
+ QString tmp = QString::fromLatin1("([+-]?\\d+);([+-]?\\d+);(\\d+);(\\d+)");
+
+ QRegularExpression rex(tmp);
+ QRegularExpressionMatch match = rex.match(geometry);
+
+ if (match.hasMatch()) {
+ customGeometry.setRect(match.captured(1).toInt(),
+ match.captured(2).toInt(),
+ match.captured(3).toInt(),
+ match.captured(4).toInt());
+
+ qCDebug(lcQpaTablet) << "apply QT_WINTAB_DESKTOP_RECT:" << customGeometry;
+ } else {
+ qCWarning(lcQpaTablet) << "failed to parse QT_WINTAB_DESKTOP_RECT:" << geometry;
+ }
+ }
+
+ if (qEnvironmentVariableIsSet("QT_IGNORE_WINTAB_MAPPING")) {
+ if (!customGeometry.isValid()) {
+ qCDebug(lcQpaTablet) << "fallback mapping is requested via QT_IGNORE_WINTAB_MAPPING";
+ } else {
+ qCWarning(lcQpaTablet) << "ignoring QT_IGNORE_WINTAB_MAPPING, because QT_WINTAB_DESKTOP_RECT is set";
+ }
+ dontUseWintabDesktopRect = true;
+ }
+
+ m_effectiveScreenGeometry =
+ !customGeometry.isValid() ?
+ (dontUseWintabDesktopRect ?
+ QWindowsScreen::virtualGeometry(QGuiApplication::primaryScreen()->handle()) :
+ m_wintabScreenGeometry) :
+ customGeometry;
+}
+
bool QWindowsTabletSupport::translateTabletProximityEvent(WPARAM /* wParam */, LPARAM lParam)
{
PACKET proximityBuffer[1]; // we are only interested in the first packet in this case
@@ -421,6 +504,8 @@ bool QWindowsTabletSupport::translateTabletProximityEvent(WPARAM /* wParam */, L
if (!totalPacks)
return false;
+ updateEffectiveScreenGeometry();
+
const UINT currentCursor = proximityBuffer[0].pkCursor;
UINT physicalCursorId;
QWindowsTabletSupport::m_winTab32DLL.wTInfo(WTI_CURSORS + currentCursor, CSR_PHYSID, &physicalCursorId);
@@ -534,8 +619,8 @@ bool QWindowsTabletSupport::translateTabletPacketEvent()
// in which case we snap the position to the mouse position.
// It seems there is no way to find out the mode programmatically, the LOGCONTEXT orgX/Y/Ext
// area is always the virtual desktop.
- const QRect virtualDesktopArea =
- QWindowsScreen::virtualGeometry(QGuiApplication::primaryScreen()->handle());
+
+ const QRect virtualDesktopArea = m_effectiveScreenGeometry;
if (QWindowsContext::verbose > 1) {
qCDebug(lcQpaTablet) << __FUNCTION__ << "processing" << packetCount
diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.h b/src/plugins/platforms/windows/qwindowstabletsupport.h
index 5b1ddb52..e8b0c01b 100644
--- a/src/plugins/platforms/windows/qwindowstabletsupport.h
+++ b/src/plugins/platforms/windows/qwindowstabletsupport.h
@@ -45,7 +45,9 @@
#include <QtCore/qvector.h>
#include <QtCore/qpoint.h>
+#include <QtCore/qrect.h>
#include <QtCore/qmap.h>
+#include <QtCore/qobject.h>
#include <wintab.h>
@@ -56,6 +58,7 @@ QT_BEGIN_NAMESPACE
class QDebug;
class QWindow;
class QRect;
+class QScreen;
struct QWindowsWinTab32DLL
{
@@ -108,7 +111,7 @@ struct QWindowsTabletDeviceData
QDebug operator<<(QDebug d, const QWindowsTabletDeviceData &t);
#endif
-class QWindowsTabletSupport
+class QWindowsTabletSupport : public QObject
{
Q_DISABLE_COPY(QWindowsTabletSupport)
@@ -141,9 +144,14 @@ public:
int absoluteRange() const { return m_absoluteRange; }
void setAbsoluteRange(int a) { m_absoluteRange = a; }
+private Q_SLOTS:
+ void slotPrimaryScreenChanged(QScreen *screen);
+ void slotScreenGeometryChanged();
+
private:
unsigned options() const;
QWindowsTabletDeviceData tabletInit(qint64 uniqueId, UINT cursorType) const;
+ void updateEffectiveScreenGeometry();
static QWindowsWinTab32DLL m_winTab32DLL;
const HWND m_window;
@@ -154,6 +162,9 @@ private:
int m_currentDevice = -1;
Mode m_mode = PenMode;
State m_state = PenUp;
+ QScreen *m_connectedScreen = 0;
+ QRect m_wintabScreenGeometry;
+ QRect m_effectiveScreenGeometry;
};
QT_END_NAMESPACE
--
2.20.1.windows.1
......@@ -51,6 +51,9 @@ if (WIN32)
COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0021-Fix-QTabletEvent-uniqueId-when-Qt-uses-WinInk.patch
COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0022-Fix-generation-of-Leave-events-when-using-tablet-dev.patch
COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0023-Implement-a-switch-for-tablet-API-on-Windows.patch
COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0024-Fetch-stylus-button-remapping-from-WinTab-driver.patch
COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0025-Disable-tablet-relative-mode-in-Qt.patch
COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0026-Fetch-mapped-screen-size-from-the-Wintab-driver.patch
)
endif()
......
......@@ -21,6 +21,7 @@ elseif (WIN32)
URL_HASH SHA1=3d3ddd29eca7c2b541fd8d0f00923e57f58d5ef0
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/0001-Workaround-AVX-argument-failures.patch
COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/relocatable-vc-1.3-install.patch
INSTALL_DIR ${PREFIX_ext_vc}
......
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a9882637..2c2bad85 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -206,8 +206,12 @@ set(Vc_VERSION_MAJOR ${CMAKE_MATCH_1})
set(Vc_VERSION_MINOR ${CMAKE_MATCH_2})
set(Vc_VERSION_PATCH ${CMAKE_MATCH_3})
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/VcConfig.cmake.in
- ${CMAKE_CURRENT_BINARY_DIR}/cmake/VcConfig.cmake @ONLY)
+include(CMakePackageConfigHelpers)
+configure_package_config_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/VcConfig.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/cmake/VcConfig.cmake
+ INSTALL_DESTINATION lib${LIB_SUFFIX}/cmake/Vc
+ PATH_VARS CMAKE_INSTALL_PREFIX)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/VcConfigVersion.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake/VcConfigVersion.cmake @ONLY)
diff --git a/cmake/VcConfig.cmake.in b/cmake/VcConfig.cmake.in
index 4a47e41e..48d37a80 100644
--- a/cmake/VcConfig.cmake.in
+++ b/cmake/VcConfig.cmake.in
@@ -1,13 +1,15 @@
+@PACKAGE_INIT@
+
set(Vc_VERSION_MAJOR @Vc_VERSION_MAJOR@)
set(Vc_VERSION_MINOR @Vc_VERSION_MINOR@)
set(Vc_VERSION_PATCH @Vc_VERSION_PATCH@)
set(Vc_VERSION @Vc_VERSION_MAJOR@.@Vc_VERSION_MINOR@.@Vc_VERSION_PATCH@)
set(Vc_VERSION_STRING "@Vc_VERSION_MAJOR@.@Vc_VERSION_MINOR@.@Vc_VERSION_PATCH@")
-set(Vc_INSTALL_DIR "@CMAKE_INSTALL_PREFIX@")
+set(Vc_INSTALL_DIR "@PACKAGE_CMAKE_INSTALL_PREFIX@")
-set(Vc_LIB_DIR "@CMAKE_INSTALL_PREFIX@/lib@LIB_SUFFIX@")
-find_path(Vc_INCLUDE_DIR Vc/global.h HINTS "@CMAKE_INSTALL_PREFIX@/include")
+set(Vc_LIB_DIR "@PACKAGE_CMAKE_INSTALL_PREFIX@/lib@LIB_SUFFIX@")
+find_path(Vc_INCLUDE_DIR Vc/global.h HINTS "@PACKAGE_CMAKE_INSTALL_PREFIX@/include")
find_path(Vc_CMAKE_MODULES_DIR AddCompilerFlag.cmake HINTS "${Vc_LIB_DIR}/cmake/Vc")
list(APPEND CMAKE_MODULE_PATH "${Vc_CMAKE_MODULES_DIR}")
......@@ -761,7 +761,7 @@ echo Running CMake for deps...
@echo off
echo.
set EXT_TARGETS=patch png2ico zlib lzma gettext openssl qt boost eigen3 exiv2 fftw3
set EXT_TARGETS=patch png2ico zlib lzma gettext openssl qt boost exiv2 fftw3 eigen3
set EXT_TARGETS=%EXT_TARGETS% ilmbase jpeg lcms2 ocio openexr png tiff gsl vc libraw
set EXT_TARGETS=%EXT_TARGETS% giflib freetype poppler kwindowsystem drmingw gmic
set EXT_TARGETS=%EXT_TARGETS% python sip pyqt
......
......@@ -64,6 +64,8 @@
#ifndef USE_QT_TABLET_WINDOWS
#include <kis_tablet_support_win.h>
#include <kis_tablet_support_win8.h>
#else
#include <dialogs/KisDlgCustomTabletResolution.h>
#endif
#include <QLibrary>
#endif
......@@ -308,6 +310,15 @@ extern "C" int main(int argc, char **argv)
#if defined Q_OS_WIN && defined USE_QT_TABLET_WINDOWS && defined QT_HAS_WINTAB_SWITCH
const bool forceWinTab = !KisConfig::useWin8PointerInputNoApp(&kritarc);
QCoreApplication::setAttribute(Qt::AA_MSWindowsUseWinTabAPI, forceWinTab);
if (qEnvironmentVariableIsEmpty("QT_WINTAB_DESKTOP_RECT") &&
qEnvironmentVariableIsEmpty("QT_IGNORE_WINTAB_MAPPING")) {
QRect customTabletRect;
KisDlgCustomTabletResolution::Mode tabletMode =
KisDlgCustomTabletResolution::getTabletMode(&customTabletRect);
KisDlgCustomTabletResolution::applyConfiguration(tabletMode, customTabletRect);
}
#endif
// first create the application so we can create a pixmap
......
......@@ -572,13 +572,6 @@ void KisResourceItemChooser::showEvent(QShowEvent *event)
{
QWidget::showEvent(event);
updateView();
/* Give the search field focus onShowEvent to allow for
* faster preset filtering... */
if( d->tagManager ) {
d->tagManager->searchField()->setFocus(Qt::FocusReason::OtherFocusReason);
d->tagManager->searchField()->selectAll();
}
}
void KisResourceItemChooser::updateView()
......
......@@ -373,11 +373,6 @@ KisTagChooserWidget *KisResourceTaggingManager::tagChooserWidget()
return d->tagChooser;
}
QLineEdit *KisResourceTaggingManager::searchField()
{
return d->tagFilter->searchField();
}
KisTagFilterWidget *KisResourceTaggingManager::tagFilterWidget()
{
return d->tagFilter;
......
......@@ -60,7 +60,6 @@ public:
bool allowTagModification();
KisTagFilterWidget *tagFilterWidget();
KisTagChooserWidget *tagChooserWidget();
class QLineEdit* searchField();
Q_SIGNALS:
......
......@@ -127,10 +127,6 @@ void KisTagFilterWidget::clear()
d->tagSearchSaveButton->setEnabled(false);
}
QLineEdit *KisTagFilterWidget::searchField()
{
return d->tagSearchLineEdit;
}
void KisTagFilterWidget::onTextChanged(const QString& lineEditText)
{
......
......@@ -39,7 +39,6 @@ public:
void allowSave(bool allow);
void clear();
class QLineEdit* searchField();
Q_SIGNALS:
void filterTextChanged(const QString &filterText);
void saveButtonClicked();
......
......@@ -274,6 +274,7 @@ set(kritaui_LIB_SRCS
widgets/KisGamutMaskToolbar.cpp
utils/kis_document_aware_spin_box_unit_manager.cpp
utils/KisSpinBoxSplineUnitConverter.cpp
input/kis_input_manager.cpp
input/kis_input_manager_p.cpp
......@@ -402,6 +403,12 @@ if(WIN32)
input/wintab/kis_screen_size_choice_dialog.cpp
input/wintab/kis_tablet_support_win8.cpp
)
else()
include_directories(SYSTEM ${Qt5Gui_PRIVATE_INCLUDE_DIRS})
set(kritaui_LIB_SRCS
${kritaui_LIB_SRCS}
dialogs/KisDlgCustomTabletResolution.cpp
)
endif()
endif()
......@@ -524,11 +531,17 @@ ki18n_wrap_ui(kritaui_LIB_SRCS
)
if(WIN32 AND NOT USE_QT_TABLET_WINDOWS)
ki18n_wrap_ui(kritaui_LIB_SRCS
input/wintab/kis_screen_size_choice_dialog.ui
)
endif()
if(WIN32)
if(USE_QT_TABLET_WINDOWS)
ki18n_wrap_ui(kritaui_LIB_SRCS
dialogs/KisDlgCustomTabletResolution.ui
)
else()
ki18n_wrap_ui(kritaui_LIB_SRCS
input/wintab/kis_screen_size_choice_dialog.ui
)
endif()
endif()
add_library(kritaui SHARED ${kritaui_HEADERS_MOC} ${kritaui_LIB_SRCS} )
......
......@@ -134,6 +134,19 @@ QSize KisBrushHud::sizeHint() const
void KisBrushHud::updateIcons()
{
this->setPalette(qApp->palette());
for(int i=0; i<this->children().size(); i++) {
QWidget *w = qobject_cast<QWidget*>(this->children().at(i));
if (w) {
w->setPalette(qApp->palette());
}
}
for(int i=0; i<m_d->wdgProperties->children().size(); i++) {
KisUniformPaintOpPropertyWidget *w = qobject_cast<KisUniformPaintOpPropertyWidget*>(m_d->wdgProperties->children().at(i));
if (w) {
w->slotThemeChanged(qApp->palette());
}
}
m_d->btnConfigure->setIcon(KisIconUtils::loadIcon("applications-system"));