diff --git a/README.md b/README.md index a8bc5c6..fee0d6a 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ wlroots-based Wayland compositor with virtual outputs and physical cursor continuity. Originally forked from dwl. -`LOC: 7441 total, 2878 vwl.c` +`LOC: 7442 total, 2878 vwl.c` ## Features diff --git a/config.def.h b/config.def.h index a7687c8..ff36590 100644 --- a/config.def.h +++ b/config.def.h @@ -5,6 +5,7 @@ (hex & 0xFF) / 255.0f } /* appearance */ static const int sloppyfocus = 1; /* focus follows mouse */ +static const int enable_cursor_warp_to_vout = 1; /* warp cursor to the center of the target vout */ static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */ static const int fullscreen_idle_inhibit = 1; /* 1 inhibits idle whenever a visible client is fullscreen */ static const int passthrough_on_pointer_lock = 0; /* 1 passes keybindings to client when pointer is locked (eg QEMU grab) */ diff --git a/vwl.c b/vwl.c index c3cd12d..33d0d45 100644 --- a/vwl.c +++ b/vwl.c @@ -1168,10 +1168,10 @@ cursorwarptovout(VirtualOutput *vout) struct wlr_box area; double cx, cy; - if (!cursor || !vout || !vout->mon) + if (!enable_cursor_warp_to_vout || !cursor || !vout || !vout->mon) return; area = !wlr_box_empty(&vout->layout_geom) ? vout->layout_geom : vout->mon->window_area; - if (area.width <= 0 || area.height <= 0) + if (wlr_box_empty(&area)) return; cx = area.x + area.width / 2.0; cy = area.y + area.height / 2.0;