aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/libLumina/test/main.cpp
blob: 22f068dde4b5a6909c1de51d584073c27cfb0759 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <QDebug>
#include <QApplication>

#include "../LuminaRandR.h"


int main(int argc, char** argv){
  QApplication A(argc, argv);
  qDebug() << "Load Monitor Device Information";
  OutputDeviceList devList;
  qDebug() << "Detected Information:";
  for(int i=0; i<devList.length(); i++){
    qDebug() << "["+devList.at(i)->ID()+"]";
    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";
  qDebug() << "Try Disabling Monitor:" << 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;
}
bgstack15