From f998705c5a0e50021875a811537962083b73ed26 Mon Sep 17 00:00:00 2001 From: BossCode45 Date: Sun, 29 Oct 2023 18:34:27 +1300 Subject: feat: Pretty much done IPC Still need to add a program that uses the IPC, this potentially requires restructuring the files --- ewmh.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'ewmh.cpp') diff --git a/ewmh.cpp b/ewmh.cpp index 5878e82..a3cc505 100644 --- a/ewmh.cpp +++ b/ewmh.cpp @@ -1,5 +1,9 @@ #include "ewmh.h" +#include +#include #include +#include +#include #include Display** dpy_; @@ -67,16 +71,22 @@ void setCurrentDesktop(int desktop) void setFullscreen(Window w, bool fullscreen) { - Atom netWMState = XInternAtom(*dpy_, "_NET_WM_STATE", true); + Atom netWMState = XInternAtom(*dpy_, "_NET_WM_STATE", false); Atom netWMStateVal; if(fullscreen) - netWMStateVal = XInternAtom(*dpy_, "_NET_WM_STATE_FULLSCREEN", true); + netWMStateVal = XInternAtom(*dpy_, "_NET_WM_STATE_FULLSCREEN", false); else - netWMStateVal = XInternAtom(*dpy_, "", true); + netWMStateVal = XInternAtom(*dpy_, "", false); XChangeProperty(*dpy_, w, netWMState, XA_ATOM, 32, PropModeReplace, (unsigned char*)&netWMStateVal, 1); } +void setIPCPath(unsigned char* path, int len) +{ + Atom socketPathAtom = XInternAtom(*dpy_, "YATWM_SOCKET_PATH", false); + XChangeProperty(*dpy_, *root_, socketPathAtom, XA_STRING, 8, PropModeReplace, path, len); +} + int getProp(Window w, char* propName, Atom* type, unsigned char** data) { Atom prop_type = XInternAtom(*dpy_, propName, false); -- cgit v1.2.3