summaryrefslogtreecommitdiff
path: root/src/mplayerwindow.cpp
diff options
context:
space:
mode:
authorMateusz Łukasik <mati75@linuxmint.pl>2016-07-05 19:43:17 +0200
committerMateusz Łukasik <mati75@linuxmint.pl>2016-07-05 19:43:17 +0200
commit7b04f55feb0d50e03d013b2be0ec555d363a40b2 (patch)
tree589da3860728c7328161810e8893d7dbe6e664a0 /src/mplayerwindow.cpp
parent42be0eb4f1d7a25dca97e8e2eb4ec4d03b7931fb (diff)
Imported Upstream version 16.7.0~ds0
Diffstat (limited to 'src/mplayerwindow.cpp')
-rw-r--r--src/mplayerwindow.cpp34
1 files changed, 10 insertions, 24 deletions
diff --git a/src/mplayerwindow.cpp b/src/mplayerwindow.cpp
index 7781a62..228a760 100644
--- a/src/mplayerwindow.cpp
+++ b/src/mplayerwindow.cpp
@@ -129,16 +129,6 @@ MplayerLayer::MplayerLayer(QWidget* parent, Qt::WindowFlags f)
#endif
, playing(false)
{
-#ifndef Q_OS_WIN
- #if QT_VERSION < 0x050000
- setAttribute(Qt::WA_OpaquePaintEvent);
- #if QT_VERSION >= 0x040400
- setAttribute(Qt::WA_NativeWindow);
- #endif
- setAttribute(Qt::WA_PaintUnclipped);
- //setAttribute(Qt::WA_PaintOnScreen);
- #endif
-#endif
}
MplayerLayer::~MplayerLayer() {
@@ -149,25 +139,15 @@ void MplayerLayer::setRepaintBackground(bool b) {
qDebug("MplayerLayer::setRepaintBackground: %d", b);
repaint_background = b;
}
-
-void MplayerLayer::paintEvent( QPaintEvent * e ) {
- //qDebug("MplayerLayer::paintEvent: repaint_background: %d", repaint_background);
- if (repaint_background || !playing) {
- //qDebug("MplayerLayer::paintEvent: painting");
- QPainter painter(this);
- painter.eraseRect( e->rect() );
- //painter.fillRect( e->rect(), QColor(255,0,0) );
- }
-}
#endif
void MplayerLayer::playingStarted() {
qDebug("MplayerLayer::playingStarted");
- repaint();
+// repaint();
playing = true;
#ifndef Q_OS_WIN
- setAttribute(Qt::WA_PaintOnScreen);
+ if (!repaint_background) setUpdatesEnabled(false);
#endif
Screen::playingStarted();
@@ -178,10 +158,10 @@ void MplayerLayer::playingStopped() {
playing = false;
#ifndef Q_OS_WIN
- setAttribute(Qt::WA_PaintOnScreen, false);
+ setUpdatesEnabled(true);
#endif
- repaint();
+// repaint();
Screen::playingStopped();
}
@@ -295,6 +275,12 @@ void MplayerWindow::retranslateStrings() {
}
void MplayerWindow::setLogoVisible( bool b) {
+ qDebug() << "MplayerWindow::setLogoVisible:" << b;
+
+#if REPAINT_BACKGROUND_OPTION
+ if (b) mplayerlayer->setUpdatesEnabled(true);
+#endif
+
if (corner_widget) {
corner_widget->setVisible(b);
}