Activated 'maskUpdate' for MAC + QT >= 5.10, which solves MAC desktop

issue, where events would not be propagated to apps on the background
(cf https://bugreports.qt.io/browse/QTBUG-81456).
preferencesAboutTextFull
jpapale 4 years ago
parent 4293bfa51f
commit b841793de7
  1. 4
      src/core/UB.h
  2. 28
      src/desktop/UBDesktopAnnotationController.cpp
  3. 4
      src/desktop/UBDesktopPalette.cpp

@ -35,6 +35,10 @@
#define UB_MAX_ZOOM 9
#if defined(Q_OS_LINUX) || (defined(Q_OS_OSX) && (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)))
#define UB_REQUIRES_MASK_UPDATE 1
#endif
struct UBMimeType
{
enum Enum

@ -86,19 +86,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB
mTransparentDrawingView->setAttribute(Qt::WA_MacNoShadow, true);
#endif //Q_OS_OSX
#if defined(Q_OS_OSX) && (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
/* https://bugreports.qt.io/browse/QTBUG-81456 */
if (QOperatingSystemVersion::current().minorVersion() > 12) /* > Sierra */
{
mTransparentDrawingView->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnBottomHint | Qt::Window | Qt::NoDropShadowWindowHint | Qt::X11BypassWindowManagerHint);
}
else
{
mTransparentDrawingView->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Window | Qt::NoDropShadowWindowHint | Qt::X11BypassWindowManagerHint);
}
#else
mTransparentDrawingView->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Window | Qt::NoDropShadowWindowHint | Qt::X11BypassWindowManagerHint);
#endif
mTransparentDrawingView->setCacheMode(QGraphicsView::CacheNone);
mTransparentDrawingView->resize(UBApplication::desktop()->width(), UBApplication::desktop()->height());
@ -124,7 +112,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB
connect( UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(keyboardActivated(bool)),
mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool)));
#ifdef Q_OS_LINUX
#ifdef UB_REQUIRES_MASK_UPDATE
connect(UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(moved(QPoint)), this, SLOT(refreshMask()));
connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(refreshMask()));
connect(mDesktopPalette,SIGNAL(refreshMask()), this, SLOT(refreshMask()));
@ -179,7 +167,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB
connect(&mHoldTimerMarker, SIGNAL(timeout()), this, SLOT(markerActionReleased()));
connect(&mHoldTimerEraser, SIGNAL(timeout()), this, SLOT(eraserActionReleased()));
#ifdef Q_OS_LINUX
#ifdef UB_REQUIRES_MASK_UPDATE
connect(mDesktopPalette, SIGNAL(moving()), this, SLOT(refreshMask()));
connect(UBApplication::boardController->paletteManager()->rightPalette(), SIGNAL(resized()), this, SLOT(refreshMask()));
connect(UBApplication::boardController->paletteManager()->addItemPalette(), SIGNAL(closed()), this, SLOT(refreshMask()));
@ -359,9 +347,9 @@ void UBDesktopAnnotationController::showWindow()
mDesktopPalette->appear();
#ifdef Q_OS_LINUX
#ifdef UB_REQUIRES_MASK_UPDATE
updateMask(true);
#endif
#endif // UB_REQUIRES_MASK_UPDATE
}
@ -404,9 +392,9 @@ void UBDesktopAnnotationController::updateBackground()
|| UBDrawingController::drawingController()->stylusTool() == UBStylusTool::Selector)
{
newBrush = QBrush(Qt::transparent);
#ifdef Q_OS_LINUX
#ifdef UB_REQUIRES_MASK_UPDATE
updateMask(true);
#endif
#endif //UB_REQUIRES_MASK_UPDATE
}
else
{
@ -415,9 +403,9 @@ void UBDesktopAnnotationController::updateBackground()
#else
newBrush = QBrush(QColor(127, 127, 127, 1));
#endif
#ifdef Q_OS_LINUX
#ifdef UB_REQUIRES_MASK_UPDATE
updateMask(false);
#endif
#endif //UB_REQUIRES_MASK_UPDATE
}
if (mTransparentDrawingScene && mTransparentDrawingScene->backgroundBrush() != newBrush)

@ -173,7 +173,7 @@ void UBDesktopPalette::minimizeMe(eMinimizedLocation location)
adjustSizeAndPosition();
#ifdef Q_OS_LINUX
#ifdef UB_REQUIRES_MASK_UPDATE
emit refreshMask();
#endif
}
@ -203,7 +203,7 @@ void UBDesktopPalette::maximizeMe()
// Notify that the maximization has been done
emit maximized();
#ifdef Q_OS_LINUX
#ifdef UB_REQUIRES_MASK_UPDATE
emit refreshMask();
#endif
}

Loading…
Cancel
Save