summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-02-26 11:22:50 +0100
committerSimon Rettberg2019-02-26 11:22:50 +0100
commit873a955b60f26fc682dd3a2d079c4885d373c126 (patch)
tree729bc2420698ec44e08597e2a7f3ea78d51e2156
parentDEBUG SPAAAM (diff)
downloadbeamergui-873a955b60f26fc682dd3a2d079c4885d373c126.tar.gz
beamergui-873a955b60f26fc682dd3a2d079c4885d373c126.tar.xz
beamergui-873a955b60f26fc682dd3a2d079c4885d373c126.zip
Show GUI on startup with auto-setup if there's a screen without EDID
-rw-r--r--src/main.cpp2
-rw-r--r--src/xx.cpp11
-rw-r--r--src/xx.h1
3 files changed, 13 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index db82370..ac28a68 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -70,7 +70,7 @@ int main(int argc, char *argv[])
Widget *w = nullptr;
if (CommandLine::backgroundMode() || CommandLine::showGui()) {
w = new Widget();
- if (CommandLine::showGui()) {
+ if (CommandLine::showGui() || ScreenSetup::inst()->hasScreenWithoutEdid()) {
w->show();
}
}
diff --git a/src/xx.cpp b/src/xx.cpp
index e5749d5..8be1d96 100644
--- a/src/xx.cpp
+++ b/src/xx.cpp
@@ -318,6 +318,17 @@ ScreenMode ScreenSetup::getCurrentMode()
return ScreenMode::Clone;
}
+bool ScreenSetup::hasScreenWithoutEdid()
+{
+ for (auto oi : a->_outputMap) {
+ // no preferred modes pretty much means no EDID, although technically I think you could have EDID
+ // that doesn't provide a preferred mode...
+ if (oi->output != nullptr && oi->output->connection != RR_Disconnected && oi->output->npreferred == 0)
+ return true;
+ }
+ return false;
+}
+
ConfigBackup ScreenSetup::setDefaultMode(bool dryRun, ScreenMode &mode)
{
ConfigBackup retval;
diff --git a/src/xx.h b/src/xx.h
index 8bd151e..0ca91d9 100644
--- a/src/xx.h
+++ b/src/xx.h
@@ -67,6 +67,7 @@ public:
void updateScreenResources();
void initModes();
ScreenMode getCurrentMode();
+ bool hasScreenAndSecondDeviceWithoutEdidSoItCouldBeAProjector();
ConfigBackup setDefaultMode(bool dryRun, ScreenMode &mode);
bool createMode(unsigned int resX, unsigned int resY, float refresh, QString name);
ConfigBackup setCenteredClone();