diff options
author | Shawn Rutledge <shawn.rutledge@nokia.com> | 2012-09-05 13:44:44 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-09-18 14:12:27 +0200 |
commit | beab941e1fc11c8fe0914c6a3207ba029eb96112 (patch) | |
tree | d8e7a2a56130edbfeef1a6790013815fe99106e5 /src/plugins/platforms/xcb/qxcbscreen.h | |
parent | 5ea896fbc63593f424a7dfbb11387599c0025c74 (diff) |
X11 (xcb) support for QScreen-per-output and runtime changes
QScreen has notifiers for its properties, but they were not being
emitted when one changes the resolution or arrangement of individual
outputs, e.g. via xrandr. Also there should be one QScreen per
"output", e.g. laptop LCD + external monitor means 2 QScreens
which will be siblings, rather than just 1 QScreen to represent
the whole desktop.
Change-Id: Ia61bbc5e6a3506f813ab11f87c03d14cf7f4ce85
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbscreen.h')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbscreen.h | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h index 7a81d8b43a..dfec3609a5 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.h +++ b/src/plugins/platforms/xcb/qxcbscreen.h @@ -46,6 +46,7 @@ #include <QtCore/QString> #include <xcb/xcb.h> +#include <xcb/randr.h> #include "qxcbobject.h" @@ -57,21 +58,26 @@ class QXcbCursor; class QXcbScreen : public QXcbObject, public QPlatformScreen { public: - QXcbScreen(QXcbConnection *connection, xcb_screen_t *screen, int number); + QXcbScreen(QXcbConnection *connection, xcb_screen_t *screen, + xcb_randr_get_output_info_reply_t *output, QString outputName, int number); ~QXcbScreen(); QPixmap grabWindow(WId window, int x, int y, int width, int height) const; QWindow *topLevelAt(const QPoint &point) const; - QRect geometry() const; - int depth() const; + QRect geometry() const { return m_geometry; } + QRect availableGeometry() const {return m_availableGeometry;} + int depth() const { return m_screen->root_depth; } QImage::Format format() const; - QSizeF physicalSize() const; + QSizeF physicalSize() const { return m_sizeMillimeters; } QPlatformCursor *cursor() const; - qreal refreshRate() const; + qreal refreshRate() const { return m_refreshRate; } + Qt::ScreenOrientation orientation() const { return m_orientation; } + QList<QPlatformScreen *> virtualSiblings() const { return m_siblings; } + void setVirtualSiblings(QList<QPlatformScreen *> sl) { m_siblings = sl; } - int screenNumber() const; + int screenNumber() const { return m_number; } xcb_screen_t *screen() const { return m_screen; } xcb_window_t root() const { return m_screen->root; } @@ -83,12 +89,23 @@ public: const xcb_visualtype_t *visualForId(xcb_visualid_t) const; - QString name() const; + QString name() const { return m_outputName; } + void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); + void updateGeometry(xcb_timestamp_t timestamp); void updateRefreshRate(); private: xcb_screen_t *m_screen; + xcb_randr_crtc_t m_crtc; + QString m_outputName; + QSizeF m_sizeMillimeters; + QRect m_geometry; + QRect m_availableGeometry; + QSize m_virtualSize; + QSizeF m_virtualSizeMillimeters; + QList<QPlatformScreen *> m_siblings; + Qt::ScreenOrientation m_orientation; int m_number; QString m_windowManagerName; bool m_syncRequestSupported; |