From 79b5685b7a562b5ec7175773a7cfad5a3e50217e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 5 May 2015 10:54:13 +0200 Subject: [PATCH] [wayland] Add protected AbstractBackend::repaint(const QRect&) Allows to trigger a repaint in the Compositor. This way the implementation does not need to call into Compositor. --- abstract_backend.cpp | 8 ++++++++ abstract_backend.h | 1 + x11windowed_backend.cpp | 6 +----- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/abstract_backend.cpp b/abstract_backend.cpp index 55e7c583b9..18633944b9 100644 --- a/abstract_backend.cpp +++ b/abstract_backend.cpp @@ -292,4 +292,12 @@ void AbstractBackend::touchUp(qint32 id, quint32 time) input()->processTouchUp(id, time); } +void AbstractBackend::repaint(const QRect &rect) +{ + if (!Compositor::self()) { + return; + } + Compositor::self()->addRepaint(rect); +} + } diff --git a/abstract_backend.h b/abstract_backend.h index 6819f3dbac..8f8be9d208 100644 --- a/abstract_backend.h +++ b/abstract_backend.h @@ -88,6 +88,7 @@ protected: void handleOutputs() { m_handlesOutputs = true; } + void repaint(const QRect &rect); private Q_SLOTS: void installThemeCursor(quint32 id, const QPoint &hotspot); diff --git a/x11windowed_backend.cpp b/x11windowed_backend.cpp index 4fbe39e3da..14373ec690 100644 --- a/x11windowed_backend.cpp +++ b/x11windowed_backend.cpp @@ -18,7 +18,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ #include "x11windowed_backend.h" -#include "composite.h" #include "scene_qpainter.h" #include "screens_x11windowed.h" #include "utils.h" @@ -241,10 +240,7 @@ void X11WindowedBackend::handleButtonPress(xcb_button_press_event_t *event) void X11WindowedBackend::handleExpose(xcb_expose_event_t *event) { - if (!Compositor::self()) { - return; - } - Compositor::self()->addRepaint(QRect(event->x, event->y, event->width, event->height)); + repaint(QRect(event->x, event->y, event->width, event->height)); } void X11WindowedBackend::updateSize(xcb_configure_notify_event_t *event)