fixed desktop mode on gnome desktop

preferencesAboutTextFull
Antoine Girard-Vallee 8 years ago
parent 2263c46d50
commit 7f662cfd18
  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());
@ -945,9 +945,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