Merge pull request #67 from antoine-girard-vallee/dev

Fixing "drawing on Gnome Desktop fails" (WIP, as some issues with the left floating palette still occuring)
preferencesAboutTextFull
kaamui 5 years ago committed by GitHub
commit d71beaa2e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      src/desktop/UBDesktopAnnotationController.cpp

@ -85,7 +85,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB
#ifdef Q_OS_OSX #ifdef Q_OS_OSX
mTransparentDrawingView->setAttribute(Qt::WA_MacNoShadow, true); mTransparentDrawingView->setAttribute(Qt::WA_MacNoShadow, true);
#endif #endif
mTransparentDrawingView->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Window | Qt::NoDropShadowWindowHint); mTransparentDrawingView->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Window | Qt::NoDropShadowWindowHint | Qt::X11BypassWindowManagerHint);
mTransparentDrawingView->setCacheMode(QGraphicsView::CacheNone); mTransparentDrawingView->setCacheMode(QGraphicsView::CacheNone);
mTransparentDrawingView->resize(UBApplication::desktop()->width(), UBApplication::desktop()->height()); mTransparentDrawingView->resize(UBApplication::desktop()->width(), UBApplication::desktop()->height());
@ -948,9 +948,20 @@ void UBDesktopAnnotationController::updateMask(bool bTransparent)
} }
else else
{ {
// Remove the mask mMask = QPixmap(mTransparentDrawingView->width(), mTransparentDrawingView->height());
QPixmap noMask(mTransparentDrawingView->width(), mTransparentDrawingView->height()); mMask.fill(Qt::transparent);
mTransparentDrawingView->setMask(noMask.mask());
QPainter p;
p.begin(&mMask);
p.setPen(Qt::red);
p.setBrush(QBrush(Qt::red));
p.drawRect(mTransparentDrawingView->geometry().x(), mTransparentDrawingView->geometry().y(), mTransparentDrawingView->width(), mTransparentDrawingView->height());
p.end();
mTransparentDrawingView->setMask(mMask.mask());
} }
} }

Loading…
Cancel
Save