summaryrefslogtreecommitdiff
path: root/old/setdispsrvproto.cc
blob: a423ccc3711805eb2f08fc68c5f50d3543c1c8a6 (plain) (blame)
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
# 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
}