From: Christian Pulvermacher Date: Sun, 29 Jan 2012 19:59:27 +0000 (+0100) Subject: use update() instead of repaint(); get rid of useless window attributes X-Git-Tag: 0.8~19 X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;ds=sidebyside;h=b3afa5ba8037d923c246032835eeebc06b334ba8;p=presencevnc use update() instead of repaint(); get rid of useless window attributes --- diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ce3afc5..d89af5a 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -252,7 +252,7 @@ void MainWindow::statusChanged(RemoteView::RemoteStatus status) vnc_view->setZoomLevel(zoom_slider->value()); vnc_view->useFastTransformations(false); - vnc_view->repaint(); + vnc_view->update(); break; case RemoteView::Disconnecting: if(old_status == RemoteView::Disconnected) //Disconnecting also occurs while connecting, so check last state diff --git a/src/vncview.cpp b/src/vncview.cpp index dc1427d..d0a8e1b 100644 --- a/src/vncview.cpp +++ b/src/vncview.cpp @@ -289,8 +289,7 @@ void VncView::updateImage(int x, int y, int w, int h) m_frame = vncThread.image(); if (!m_initDone) { //TODO this seems an odd place for initialization - setAttribute(Qt::WA_StaticContents); - setAttribute(Qt::WA_OpaquePaintEvent); + setAttribute(Qt::WA_NoSystemBackground); installEventFilter(this); setCursor(((m_dotCursorState == CursorOn) || m_forceLocalCursor) ? localDotCursor() : Qt::BlankCursor); @@ -315,7 +314,7 @@ void VncView::updateImage(int x, int y, int w, int h) emit framebufferSizeChanged(m_frame.width(), m_frame.height()); } - repaint(qRound(m_x * m_horizontalFactor), qRound(m_y * m_verticalFactor), qRound(m_w * m_horizontalFactor), qRound(m_h * m_verticalFactor)); + update(qRound(m_x * m_horizontalFactor), qRound(m_y * m_verticalFactor), qRound(m_w * m_horizontalFactor), qRound(m_h * m_verticalFactor)); } void VncView::setViewOnly(bool viewOnly) @@ -538,9 +537,9 @@ void VncView::mouseEventHandler(QMouseEvent *e) if(((m_dotCursorState == CursorOn) || m_forceLocalCursor) and (cursor_x != old_cursor_x or cursor_y != old_cursor_y)) { //clear last position - repaint(old_cursor_x*m_horizontalFactor - CURSOR_SIZE/2, old_cursor_y*m_verticalFactor - CURSOR_SIZE/2, CURSOR_SIZE, CURSOR_SIZE); + update(old_cursor_x*m_horizontalFactor - CURSOR_SIZE/2, old_cursor_y*m_verticalFactor - CURSOR_SIZE/2, CURSOR_SIZE, CURSOR_SIZE); //and refresh new one - repaint(cursor_x*m_horizontalFactor - CURSOR_SIZE/2, cursor_y*m_verticalFactor - CURSOR_SIZE/2, CURSOR_SIZE, CURSOR_SIZE); + update(cursor_x*m_horizontalFactor - CURSOR_SIZE/2, cursor_y*m_verticalFactor - CURSOR_SIZE/2, CURSOR_SIZE, CURSOR_SIZE); old_cursor_x = cursor_x; old_cursor_y = cursor_y;