diff options
| author | BossCode45 <human.cyborg42@gmail.com> | 2024-11-26 15:21:56 +1300 |
|---|---|---|
| committer | BossCode45 <human.cyborg42@gmail.com> | 2024-11-26 15:21:56 +1300 |
| commit | 72300460c1c1fa294cc4d1f1026d203a5adf4d28 (patch) | |
| tree | babbfba0ca2c9994609238b49e281476660a356d /src/main.cpp | |
| parent | 8b48a9cfc4b0795a62a515e2519e7194d1d57347 (diff) | |
| download | YATwm-72300460c1c1fa294cc4d1f1026d203a5adf4d28.tar.gz YATwm-72300460c1c1fa294cc4d1f1026d203a5adf4d28.zip | |
feat: Added a program (YATmsg) to communicate with YATwm
Currently just sends a hello message and nothing else, more to come later
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 77f4dbc..a11b203 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1028,11 +1028,11 @@ int main(int argc, char** argv) return 0; } } + //Important init stuff mX = mY = 0; dpy = XOpenDisplay(nullptr); root = Window(DefaultRootWindow(dpy)); - // Adding commands commandsModule.addCommand("exit", exit, 0, {}); commandsModule.addCommand("spawn", spawn, 1, {STR_REST}); @@ -1051,6 +1051,8 @@ int main(int argc, char** argv) //Config std::vector<Err> cfgErr; + + cout << "Registered commands" << endl; char* confDir = getenv("XDG_CONFIG_HOME"); if(confDir != NULL) @@ -1063,6 +1065,8 @@ int main(int argc, char** argv) cfgErr = cfg.loadFromFile(home + "/.config/YATwm/config"); } + cout << "Done config" << endl; + //Log yatlog.open(cfg.logFile, std::ios_base::app); yatlog << "\n" << endl; @@ -1119,7 +1123,7 @@ int main(int argc, char** argv) FD_ZERO(&fdset); FD_SET(x11fd, &fdset); FD_SET(ipc.getFD(), &fdset); - int ready = select(x11fd + 1, &fdset, NULL, NULL, NULL); + int ready = select(std::max(x11fd, ipc.getFD()) + 1, &fdset, NULL, NULL, NULL); if(FD_ISSET(ipc.getFD(), &fdset)) { ipc.doListen(); |
