From 21c2da549a7b661c1742ef82c7ebefa674bdccef Mon Sep 17 00:00:00 2001 From: Arda Atci Date: Wed, 20 Sep 2023 01:19:14 +0300 Subject: [PATCH] multi monitor desktop switch fixed --- src/picom.c | 2 +- src/win.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/picom.c b/src/picom.c index 69d0410..cd8d873 100644 --- a/src/picom.c +++ b/src/picom.c @@ -2566,7 +2566,7 @@ static session_t *session_init(int argc, char **argv, Display *dpy, // Monitor screen changes if vsync_sw is enabled and we are using // an auto-detected refresh rate, or when X RandR features are enabled - if (ps->randr_exists && ps->o.crop_shadow_to_monitor) { + if (ps->randr_exists) { xcb_randr_select_input(ps->c.c, ps->c.screen_info->root, XCB_RANDR_NOTIFY_MASK_SCREEN_CHANGE); x_update_monitors(&ps->c, &ps->monitors); diff --git a/src/win.c b/src/win.c index ecbf79f..7f6ca1f 100644 --- a/src/win.c +++ b/src/win.c @@ -2777,11 +2777,9 @@ bool win_skip_fading(session_t *ps, struct managed_win *w) { // TODO(absolutelynothelix): rename to x_update_win_(randr_?)monitor and move to // the x.c. void win_update_monitor(struct x_monitors *monitors, struct managed_win *mw) { - mw->randr_monitor = -1; for (int i = 0; i < monitors->count; i++) { auto e = pixman_region32_extents(&monitors->regions[i]); - if (e->x1 <= mw->g.x && e->y1 <= mw->g.y && - e->x2 >= mw->g.x + mw->widthb && e->y2 >= mw->g.y + mw->heightb) { + if ((e->x1 <= mw->g.x || e->x1 <= mw->pending_g.x) && (e->x2 >= mw->g.x + mw->widthb || e->x2 >= mw->pending_g.x + mw->widthb)) { mw->randr_monitor = i; log_debug("Window %#010x (%s), %dx%d+%dx%d, is entirely on the " "monitor %d (%dx%d+%dx%d)",