From ee833dfa9e17521e59ad84634cf3ef4115bda606 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 22 Jun 2017 06:46:54 -0400 Subject: Get the LuminaRandR class all finished up for *information purposes only*. 1. All the information retrieval systems are now in place and functional (much easier to use than parsing xrandr output manually). 2. Also get the "setPrimaryMonitor" functionality all setup and working. This *does* change the running X session in an atomic fashion. --- src-qt5/core/libLumina/LuminaRandR.h | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'src-qt5/core/libLumina/LuminaRandR.h') diff --git a/src-qt5/core/libLumina/LuminaRandR.h b/src-qt5/core/libLumina/LuminaRandR.h index 6d205680..6175a9d0 100644 --- a/src-qt5/core/libLumina/LuminaRandR.h +++ b/src-qt5/core/libLumina/LuminaRandR.h @@ -25,23 +25,18 @@ #include "xcb/xcb_atom.h" struct p_objects{ -//public: - xcb_atom_t monitor_atom; //This is the index used to identify particular monitors (unique ID) + xcb_randr_output_t output; //This is the index used to identify particular monitors (unique ID) //Cached Information - bool primary, automatic; + bool primary; QRect geometry; - QList resolutions; - QSize physicalSizeMM; + + QSize physicalSizeMM; //physical size of the display in MM QString name; - xcb_randr_output_t output; - QList modes; - /*p_objects(){ - // Set the defaults for non-default-constructed variables - primary = automatic = false; - monitor_atom = 0; - }*/ + xcb_randr_mode_t current_mode; + QList modes; //each mode is a combination of resolution + refresh rate + QList resolutions; //smaller subset of modes - just unique resolutions }; @@ -68,12 +63,12 @@ public: bool isEnabled(); bool isPrimary(); - bool isAutomatic(); bool isConnected(); QList availableResolutions(); QSize currentResolution(); //could be different from geometry.size() if things like panning/rotation are enabled QRect currentGeometry(); QSize physicalSizeMM(); + QSize physicalDPI(); //Modification bool setAsPrimary(bool); @@ -107,6 +102,8 @@ public: //Simplification functions for dealing with multiple monitors void setPrimaryMonitor(QString id); + QString primaryMonitor(); + void disableMonitor(QString id); //void enableMonitor(QString id, QRect geom); -- cgit