From e3da99fb5e883450ca7f73ea6fec62ce8be8c9e8 Mon Sep 17 00:00:00 2001 From: Sergii Stoian Date: Mon, 3 Feb 2020 15:27:40 +0200 Subject: [PATCH] * Source/x11/XGServerWindow.m (screenList): call windowDepthForScreen: with monitor index, not screen ID (screen_id field has already set to defScreen above). (windowDepthForScreen:): get Xlib screen with screen_id from monitor lit. --- Source/x11/XGServerWindow.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/x11/XGServerWindow.m b/Source/x11/XGServerWindow.m index a8b4690..e46cd11 100644 --- a/Source/x11/XGServerWindow.m +++ b/Source/x11/XGServerWindow.m @@ -4457,7 +4457,7 @@ _computeDepth(int class, int bpp) crtc_info = XRRGetCrtcInfo(dpy, screen_res, output_info->crtc); // Fill the cache of device parameters - monitors[i].depth = [self windowDepthForScreen: defScreen]; + monitors[i].depth = [self windowDepthForScreen: i]; monitors[i].resolution = [self resolutionForScreen: defScreen]; monitors[i].frame = NSMakeRect(crtc_info->x, crtc_info->y, crtc_info->width, crtc_info->height); @@ -4489,7 +4489,7 @@ _computeDepth(int class, int bpp) return screens; } -// `screen` is a Xlib screen number. +// `screen` is a monitor index not X11 screen - (NSWindowDepth) windowDepthForScreen: (int)screen { Screen *x_screen; @@ -4500,7 +4500,7 @@ _computeDepth(int class, int bpp) return 0; } - x_screen = XScreenOfDisplay(dpy, screen); + x_screen = XScreenOfDisplay(dpy, monitors[screen].screen_id); if (x_screen == NULL) {