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/test/main.cpp | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'src-qt5/core/libLumina/test/main.cpp') diff --git a/src-qt5/core/libLumina/test/main.cpp b/src-qt5/core/libLumina/test/main.cpp index 5c6fa67f..22f068dd 100644 --- a/src-qt5/core/libLumina/test/main.cpp +++ b/src-qt5/core/libLumina/test/main.cpp @@ -11,16 +11,32 @@ int main(int argc, char** argv){ qDebug() << "Detected Information:"; for(int i=0; iID()+"]"; - qDebug() << " - isEnabled:" << devList.at(i)->isEnabled(); - qDebug() << " - isPrimary:" << devList.at(i)->isPrimary(); - qDebug() << " - isAutomatic:" << devList.at(i)->isAutomatic(); - qDebug() << " - Current Geometry:" << devList.at(i)->currentGeometry(); - qDebug() << " - Physical Size (mm):" << devList.at(i)->physicalSizeMM(); - qDebug() << " - Available Resolutions:" << devList.at(i)->availableResolutions(); + qDebug() << " - isConnected:" << devList.at(i)->isConnected(); + if(devList.at(i)->isConnected()){ + qDebug() << " - isEnabled:" << devList.at(i)->isEnabled(); + qDebug() << " - isPrimary:" << devList.at(i)->isPrimary(); + qDebug() << " - Current Geometry:" << devList.at(i)->currentGeometry(); + qDebug() << " - Physical Size (mm):" << devList.at(i)->physicalSizeMM(); + qDebug() << " - Current DPI:" << devList.at(i)->physicalDPI(); + qDebug() << " - Available Resolutions:" << devList.at(i)->availableResolutions(); + } } - QString disable = "DVI-I-1"; + /*QString disable = "DVI-I-1"; qDebug() << "Try Disabling Monitor:" << disable; - devList.disableMonitor(disable); + devList.disableMonitor(disable);*/ + + QString setprimary = "eDP-1"; + if(devList.primaryMonitor() != setprimary){ + qDebug() << "Try setting monitor as primary:" << setprimary; + devList.setPrimaryMonitor(setprimary); + //Now see if the status changed on X itself + for(int i=0; iID() == setprimary){ + devList.at(i)->updateInfoCache(); //resync with X server info + qDebug() << "Successful:" << devList.at(i)->isPrimary(); + } + } + } qDebug() << "Finished Test!"; return 0; } -- cgit