Created
May 29, 2023 16:34
-
-
Save tur11ng/2f946b30f0c2e96c57619af5d03ccbaf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <X11/Xlib.h> | |
#include <X11/Xatom.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
int main() { | |
Display *d = NULL; | |
d = XOpenDisplay(NULL); | |
Window w; | |
XEvent e; | |
Atom atom; | |
int screen; | |
if (d == NULL) { | |
printf("Error opening display\n"); | |
exit(1); | |
} | |
screen = DefaultScreen(d); | |
static char net_wm_cm[] = "_NET_WM_CM_Sxx"; | |
snprintf (net_wm_cm, sizeof (net_wm_cm), "_NET_WM_CM_S%d", screen); | |
atom = XInternAtom (d, net_wm_cm, False); | |
w = XGetSelectionOwner(d, atom); | |
if (w == None) { | |
printf("Compositor isn't registered."); | |
} else { | |
printf("Compositor is registered."); | |
} | |
XCloseDisplay(d); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment