]> git.mdlowis.com Git - proto/labwc.git/commitdiff
magnifier: show magnifier only in one output
authortokyo4j <hrak1529@gmail.com>
Sun, 30 Mar 2025 07:09:39 +0000 (16:09 +0900)
committerJohan Malm <johanmalm@users.noreply.github.com>
Mon, 31 Mar 2025 20:19:12 +0000 (21:19 +0100)
This may slightly degrade UX, but this prevents the temporary buffer from
being reallocated for every frame when the magnifier spans multiple
outputs with different scales/transforms.

src/magnifier.c

index 0b2da20ba326e1871a9fa58adefbde6406c45072..e1b3fcd9b87db069ab15304ca4282159aa94eb4a 100644 (file)
@@ -57,9 +57,8 @@ magnifier_draw(struct output *output, struct wlr_buffer *output_buffer, struct w
        };
        box_logical_to_physical(&cursor_pos, output->wlr_output);
 
-       bool cursor_in_output = wlr_box_contains_point(&output_box,
-               cursor_pos.x, cursor_pos.y);
-       if (fullscreen && !cursor_in_output) {
+       if (!wlr_box_contains_point(&output_box,
+                       cursor_pos.x, cursor_pos.y)) {
                return;
        }