-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore spontaneous tablet events in canvas instead
Rather than doing it with an event filter, because that apparently doesn't work properly and still lets spontaneous events through. They're now ignored in the canvas controller/canvas view instead.
- Loading branch information
1 parent
6e84573
commit 9ed28b7
Showing
10 changed files
with
141 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#ifndef DESKTOP_UTILS_TABLETFILTER_H | ||
#define DESKTOP_UTILS_TABLETFILTER_H | ||
#include "desktop/tabletinput.h" | ||
#include <QTabletEvent> | ||
|
||
class TabletFilter { | ||
public: | ||
TABLETINPUT_CONSTEXPR_OR_INLINE void reset() | ||
{ | ||
#ifdef Q_OS_WIN | ||
m_ignoreSpontaneous = false; | ||
#endif | ||
} | ||
|
||
TABLETINPUT_CONSTEXPR_OR_INLINE bool shouldIgnore(const QTabletEvent *event) | ||
{ | ||
#ifdef Q_OS_WIN | ||
bool spontaneous = event->spontaneous(); | ||
if(m_ignoreSpontaneous) { | ||
return spontaneous; | ||
} else { | ||
if(!spontaneous && tabletinput::ignoreSpontaneous()) { | ||
m_ignoreSpontaneous = true; | ||
} | ||
return false; | ||
} | ||
#else | ||
Q_UNUSED(event); | ||
return false; | ||
#endif | ||
} | ||
|
||
#ifdef Q_OS_WIN | ||
private: | ||
bool m_ignoreSpontaneous = false; | ||
#endif | ||
}; | ||
|
||
#endif |
Oops, something went wrong.