summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Ritter2016-11-11 10:16:30 +0100
committerSteffen Ritter2016-11-11 10:16:30 +0100
commitc66d1407c8edd9a0b9b2e055fefa5490e5fab12e (patch)
treeb86eff07b5d398f4b7401bca5e6ed5456b11dba8
parentFix beamer detection in clone mode for some cases (diff)
downloadbeamergui-c66d1407c8edd9a0b9b2e055fefa5490e5fab12e.tar.gz
beamergui-c66d1407c8edd9a0b9b2e055fefa5490e5fab12e.tar.xz
beamergui-c66d1407c8edd9a0b9b2e055fefa5490e5fab12e.zip
Stupid mistake in formula for diagonal calculation...
-rw-r--r--src/widget.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/widget.cpp b/src/widget.cpp
index 8833630..02e3b20 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -31,7 +31,7 @@ Widget::Widget(QWidget *parent) :
switch ( _connectedOutputList.size() ){
/*************************************************************************/
case 1:// In case of one connected output - xrandr --auto
- qDebug() << "Normal output";
+ qDebug() << "One connected output";
exit(0);
break;
case 2: // In case of two connected outputs
@@ -41,8 +41,9 @@ Widget::Widget(QWidget *parent) :
// Check if we are in clone mode
if (cloneMode()) {
- qDebug() << "Clone mode!";
+ qDebug() << "Dual output with cloned screen!";
+ // TODO make that mess nice and clean
double_t w0 = _outputMap[_connectedOutputList[0]]->mm_width;
double_t h0 = _outputMap[_connectedOutputList[0]]->mm_height;
@@ -57,8 +58,8 @@ Widget::Widget(QWidget *parent) :
_beamer = _connectedOutputList[1];
_monitor = _connectedOutputList[0];
} else {
- double_t d0 = sqrt((pow(w0, 2) * pow(h0, 2)));
- double_t d1 = sqrt((pow(w1, 2) * pow(h1, 2)));
+ double_t d0 = sqrt((pow(w0, 2) + pow(h0, 2)));
+ double_t d1 = sqrt((pow(w1, 2) + pow(h1, 2)));
if (d0 > d1) {
_beamer = _connectedOutputList[0];
@@ -222,7 +223,7 @@ Widget::Widget(QWidget *parent) :
// If NEITHER of the outputs is a beamer (likely dualscreen setup)
else {
// TODO(manuel): Future feature. Setup dualscreen
- qDebug() << "Dual output with extended screen";
+ qDebug() << "Dual output with extended screen!";
exit(0);
}
break;
@@ -230,7 +231,7 @@ Widget::Widget(QWidget *parent) :
default:
// If there are more than 3 outputs
// its up to the user. Quit.
- qDebug() << ">2 outputs. Quit.";
+ qDebug() << "More than two outputs. Quit.";
exit(0);
break;
}