summaryrefslogtreecommitdiff
path: root/old/setdispsrvproto.cc
diff options
context:
space:
mode:
Diffstat (limited to 'old/setdispsrvproto.cc')
-rw-r--r--old/setdispsrvproto.cc35
1 files changed, 35 insertions, 0 deletions
diff --git a/old/setdispsrvproto.cc b/old/setdispsrvproto.cc
new file mode 100644
index 0000000..a423ccc
--- /dev/null
+++ b/old/setdispsrvproto.cc
@@ -0,0 +1,35 @@
+# include <luma/main.hh>
+void luma::app_t::setdispsrvproto() {
+ this->dispsrvproto = this->dispsrvproto_t::wayland;
+# if 0
+ char const * envval = this->getenv("LUMA__DISPSRVPROTO");
+ if(envval != "") {
+ if(envval == "x") {
+ this->dbgmsg("Setting the display server protocol to X.\n");
+ this->dispsrvproto = this->dispsrvproto_t::x;
+ }
+ else if(envval == "wayland") {
+ this->dbgmsg("Setting the display server protocol to Wayland.\n");
+ this->dispsrvproto = this->dispsrvproto_t::wayland;
+ }
+ else {
+ //std::cerr << "$LUMA__DISPSRVPROTO is set to \"" + envval + "\", which is an unrecognized display server protocol.\n";
+ }
+ }
+ else {
+ this->dbgmsg("Getting current display server protocol.\n");
+ std::string xdgsesstype = std::getenv("XDG_SESSION_TYPE");
+ if(xdgsesstype == "wayland") {
+ this->dbgmsg("It appears to be Wayland.\n");
+ this->dispsrvproto = this->dispsrvproto_t::wayland;
+ }
+ else if(xdgsesstype == "x11") {
+ this->dbgmsg("It appears to be X.\n");
+ this->dispsrvproto = this->dispsrvproto_t::x;
+ }
+ else {
+ this->dbgmsg("Error\n");
+ }
+ }
+# endif
+}