use DefaultRootWindow.

This commit is contained in:
Miroslav Šedivý 2023-04-18 23:48:44 +02:00
parent 0ea1c2870f
commit 3ef4c5ce0f
2 changed files with 5 additions and 5 deletions

View File

@ -16,7 +16,7 @@ static int XEventError(Display *display, XErrorEvent *event) {
void XEventLoop(char *name) {
Display *display = XOpenDisplay(name);
Window root = RootWindow(display, 0);
Window root = DefaultRootWindow(display);
int xfixes_event_base, xfixes_error_base;
if (!XFixesQueryExtension(display, &xfixes_event_base, &xfixes_error_base)) {

View File

@ -231,7 +231,7 @@ void XKey(KeySym keysym, int down) {
Status XSetScreenConfiguration(int width, int height, short rate) {
Display *display = getXDisplay();
Window root = RootWindow(display, 0);
Window root = DefaultRootWindow(display);
XRRScreenConfiguration *conf = XRRGetScreenInfo(display, root);
XRRScreenSize *xrrs;
@ -260,7 +260,7 @@ Status XSetScreenConfiguration(int width, int height, short rate) {
void XGetScreenConfiguration(int *width, int *height, short *rate) {
Display *display = getXDisplay();
Window root = RootWindow(display, 0);
Window root = DefaultRootWindow(display);
XRRScreenConfiguration *conf = XRRGetScreenInfo(display, root);
Rotation current_rotation;
@ -284,7 +284,7 @@ void XGetScreenConfiguration(int *width, int *height, short *rate) {
void XGetScreenConfigurations() {
Display *display = getXDisplay();
Window root = RootWindow(display, 0);
Window root = DefaultRootWindow(display);
XRRScreenSize *xrrs;
int num_sizes;
@ -304,7 +304,7 @@ void XGetScreenConfigurations() {
// Inspired by https://github.com/raboof/xrandr/blob/master/xrandr.c
void XCreateScreenMode(int width, int height, short rate) {
Display *display = getXDisplay();
Window root = RootWindow(display, 0);
Window root = DefaultRootWindow(display);
char name[128];
XRRModeInfo mode;