Fix broken WId refactoring

Actually remove the WId member from the abtract framebuffer class and use the member in xcbframebuffer

qtframebuffer also uses the WId so add a member there
This commit is contained in:
Nicolas Fella
2022-08-04 11:57:55 +02:00
parent 4169a9f50a
commit 04494dfeb0
4 changed files with 9 additions and 7 deletions

View File

@@ -13,7 +13,8 @@
#include <QRegion> #include <QRegion>
#include <QPixmap> #include <QPixmap>
#include <QBitmap> #include <QBitmap>
#include <QGuiApplication> #include <QApplication>
#include <QDesktopWidget>
#include <QScreen> #include <QScreen>
@@ -22,6 +23,7 @@ const int UPDATE_TIME = 500;
QtFrameBuffer::QtFrameBuffer(QObject *parent) QtFrameBuffer::QtFrameBuffer(QObject *parent)
: FrameBuffer(parent) : FrameBuffer(parent)
{ {
win = QApplication::desktop()->winId();
QScreen *screen = QGuiApplication::primaryScreen(); QScreen *screen = QGuiApplication::primaryScreen();
if (screen) { if (screen) {
primaryScreen = screen; primaryScreen = screen;

View File

@@ -38,6 +38,7 @@ public Q_SLOTS:
void updateFrameBuffer(); void updateFrameBuffer();
private: private:
WId win;
QImage fbImage; QImage fbImage;
QTimer *t; QTimer *t;
QScreen *primaryScreen; QScreen *primaryScreen;

View File

@@ -180,7 +180,7 @@ XCBFrameBuffer::XCBFrameBuffer(QObject *parent):
} }
d->framebufferImage = xcb_image_get(QX11Info::connection(), d->framebufferImage = xcb_image_get(QX11Info::connection(),
this->win, d->win,
d->area.left(), d->area.left(),
d->area.top(), d->area.top(),
d->area.width(), d->area.width(),
@@ -249,7 +249,7 @@ XCBFrameBuffer::XCBFrameBuffer(QObject *parent):
// will return 1 on success (yes!) // will return 1 on success (yes!)
int shmget_res = xcb_image_shm_get( int shmget_res = xcb_image_shm_get(
QX11Info::connection(), QX11Info::connection(),
this->win, d->win,
d->updateTile, d->updateTile,
d->shminfo, d->shminfo,
d->area.left(), // x d->area.left(), // x
@@ -557,7 +557,7 @@ QList<QRect> XCBFrameBuffer::modifiedTiles() {
// translate whe coordinates // translate whe coordinates
xcb_shm_get_image_cookie_t sgi_cookie = xcb_shm_get_image( xcb_shm_get_image_cookie_t sgi_cookie = xcb_shm_get_image(
QX11Info::connection(), QX11Info::connection(),
this->win, d->win,
d->area.left() + r.left(), d->area.left() + r.left(),
d->area.top() + r.top(), d->area.top() + r.top(),
r.width(), r.width(),
@@ -612,7 +612,7 @@ QList<QRect> XCBFrameBuffer::modifiedTiles() {
// need function that copies pixels from one image to another // need function that copies pixels from one image to another
xcb_image_t *damagedImage = xcb_image_get( xcb_image_t *damagedImage = xcb_image_get(
QX11Info::connection(), QX11Info::connection(),
this->win, d->win,
r.left(), r.left(),
r.top(), r.top(),
r.width(), r.width(),
@@ -652,7 +652,7 @@ void XCBFrameBuffer::startMonitor() {
d->running = true; d->running = true;
d->damage = xcb_generate_id(QX11Info::connection()); d->damage = xcb_generate_id(QX11Info::connection());
xcb_damage_create(QX11Info::connection(), d->damage, this->win, xcb_damage_create(QX11Info::connection(), d->damage, d->win,
XCB_DAMAGE_REPORT_LEVEL_RAW_RECTANGLES); XCB_DAMAGE_REPORT_LEVEL_RAW_RECTANGLES);
// (currently) we do not call xcb_damage_subtract() EVER, because // (currently) we do not call xcb_damage_subtract() EVER, because

View File

@@ -52,7 +52,6 @@ Q_SIGNALS:
void frameBufferChanged(); void frameBufferChanged();
protected: protected:
WId win;
char *fb = nullptr; char *fb = nullptr;
QList<QRect> tiles; QList<QRect> tiles;