Bugfix/resolution change event Fixes part of #620 (#867)

* Detect resolution changes

* include Qt5Widgets

* find Qt5Widgets

Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
This commit is contained in:
Murat Seker
2020-07-12 09:23:13 +02:00
committed by GitHub
parent 22ace55447
commit c32a4df587
9 changed files with 55 additions and 10 deletions

View File

@@ -1,5 +1,7 @@
#pragma once
#include <QAbstractEventDispatcher>
#include <QAbstractNativeEventFilter>
#include <QCoreApplication>
#include <QObject>
// Hyperion-utils includes
@@ -8,12 +10,13 @@
// X11 includes
#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>
#include <X11/extensions/Xrender.h>
#include <X11/extensions/XShm.h>
#include <sys/ipc.h>
#include <sys/shm.h>
class X11Grabber : public Grabber
class X11Grabber : public Grabber , public QAbstractNativeEventFilter
{
public:
@@ -58,8 +61,11 @@ public:
///
virtual void setCropping(unsigned cropLeft, unsigned cropRight, unsigned cropTop, unsigned cropBottom);
protected:
bool nativeEventFilter(const QByteArray & eventType, void * message, long int * result) override;
private:
bool _XShmAvailable, _XShmPixmapAvailable, _XRenderAvailable;
bool _XShmAvailable, _XShmPixmapAvailable, _XRenderAvailable, _XRandRAvailable;
XImage* _xImage;
XShmSegmentInfo _shminfo;
@@ -76,6 +82,8 @@ private:
Picture _srcPicture;
Picture _dstPicture;
int _XRandREventBase;
XTransform _transform;
int _pixelDecimation;