x11: fix icc profile when the window goes near off screen

On a multi monitor setup, when the center of the window was going off
screen, the icc profile would always switch to the profile of the first
screen.

This fixes the issue by defaulting the value to the current screen.
This commit is contained in:
slatchurie 2018-10-14 02:37:55 +02:00 committed by sfan5
parent 0f3e25cb0a
commit 24e21a0236
1 changed files with 1 additions and 1 deletions

View File

@ -1642,7 +1642,7 @@ static int get_icc_screen(struct vo *vo)
struct vo_x11_state *x11 = vo->x11; struct vo_x11_state *x11 = vo->x11;
int cx = x11->winrc.x0 + (x11->winrc.x1 - x11->winrc.x0)/2, int cx = x11->winrc.x0 + (x11->winrc.x1 - x11->winrc.x0)/2,
cy = x11->winrc.y0 + (x11->winrc.y1 - x11->winrc.y0)/2; cy = x11->winrc.y0 + (x11->winrc.y1 - x11->winrc.y0)/2;
int screen = 0; // xinerama screen number int screen = x11->current_icc_screen; // xinerama screen number
for (int n = 0; n < x11->num_displays; n++) { for (int n = 0; n < x11->num_displays; n++) {
struct xrandr_display *disp = &x11->displays[n]; struct xrandr_display *disp = &x11->displays[n];
if (mp_rect_contains(&disp->rc, cx, cy)) { if (mp_rect_contains(&disp->rc, cx, cy)) {