Commit f386cdb7 authored by Halla Rempt's avatar Halla Rempt
Browse files

Improve stylus precision on OSX

Patch by Bernhard Liebl
Differential Revision: https://phabricator.kde.org/D7880
CCBUG:373676
parent 281995ae
......@@ -13,6 +13,7 @@ add_subdirectory( tests )
if (APPLE)
find_library(FOUNDATION_LIBRARY Foundation)
find_library(APPKIT_LIBRARY AppKit)
endif ()
set(kritaui_LIB_SRCS
......@@ -425,6 +426,12 @@ if(UNIX)
endif()
endif()
if(APPLE)
set(kritaui_LIB_SRCS
${kritaui_LIB_SRCS}
osx.mm
)
endif()
ki18n_wrap_ui(kritaui_LIB_SRCS
forms/wdgdlgpngimport.ui
......@@ -524,6 +531,7 @@ endif()
if(APPLE)
target_link_libraries(kritaui ${FOUNDATION_LIBRARY})
target_link_libraries(kritaui ${APPKIT_LIBRARY})
endif ()
......
......@@ -16,7 +16,7 @@
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
Boston, MA 02110-1301, USA.
*/
#include "KisApplication.h"
......@@ -27,6 +27,10 @@
#include <tchar.h>
#endif
#ifdef Q_OS_OSX
#include "osx.h"
#endif
#include <QDesktopServices>
#include <QDesktopWidget>
#include <QDir>
......@@ -150,6 +154,10 @@ KisApplication::KisApplication(const QString &key, int &argc, char **argv)
, m_mainWindow(0)
, m_batchRun(false)
{
#ifdef Q_OS_OSX
setMouseCoalescingEnabled(false);
#endif
QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath());
setApplicationDisplayName("Krita");
......
/*
* Copyright (c) 2017 Bernhard Liebl
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
extern "C" {
bool isMouseCoalescingEnabled();
void setMouseCoalescingEnabled(bool enabled);
}
/*
* Copyright (c) 2017 Bernhard Liebl
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#import <AppKit/Appkit.h>
extern "C" {
bool isMouseCoalescingEnabled();
void setMouseCoalescingEnabled(bool enabled);
}
bool isMouseCoalescingEnabled() {
return NSEvent.isMouseCoalescingEnabled;
}
void setMouseCoalescingEnabled(bool enabled) {
NSEvent.mouseCoalescingEnabled = enabled;
}
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