diff options
author | Ken Moore <ken@ixsystems.com> | 2017-06-22 06:46:54 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-06-22 06:46:54 -0400 |
commit | ee833dfa9e17521e59ad84634cf3ef4115bda606 (patch) | |
tree | c9101032fe84ba42823e0616de2216a6eaaf67a7 /src-qt5/core/libLumina/test/main.cpp | |
parent | Merge branch 'master' of github.com:trueos/lumina (diff) | |
download | lumina-ee833dfa9e17521e59ad84634cf3ef4115bda606.tar.gz lumina-ee833dfa9e17521e59ad84634cf3ef4115bda606.tar.bz2 lumina-ee833dfa9e17521e59ad84634cf3ef4115bda606.zip |
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.
Diffstat (limited to 'src-qt5/core/libLumina/test/main.cpp')
-rw-r--r-- | src-qt5/core/libLumina/test/main.cpp | 32 |
1 files changed, 24 insertions, 8 deletions
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; i<devList.length(); i++){ qDebug() << "["+devList.at(i)->ID()+"]"; - 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; i<devList.length(); i++){ + if(devList.at(i)->ID() == setprimary){ + devList.at(i)->updateInfoCache(); //resync with X server info + qDebug() << "Successful:" << devList.at(i)->isPrimary(); + } + } + } qDebug() << "Finished Test!"; return 0; } |