mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
edges: only snap to neighbors on outputs containing the changing view
This commit is contained in:
parent
b82d4783ea
commit
9693100e16
1 changed files with 18 additions and 2 deletions
20
src/edges.c
20
src/edges.c
|
|
@ -137,8 +137,10 @@ edges_find_neighbors(struct border *nearest_edges, struct view *view,
|
|||
struct border view_edges = { 0 };
|
||||
struct border target_edges = { 0 };
|
||||
|
||||
edges_for_target_geometry(&view_edges, view,
|
||||
use_pending ? view->pending : view->current);
|
||||
struct wlr_box *view_geom =
|
||||
use_pending ? &view->pending : &view->current;
|
||||
|
||||
edges_for_target_geometry(&view_edges, view, *view_geom);
|
||||
edges_for_target_geometry(&target_edges, view, target);
|
||||
|
||||
struct view *v;
|
||||
|
|
@ -151,6 +153,20 @@ edges_find_neighbors(struct border *nearest_edges, struct view *view,
|
|||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* If view and v are on different outputs, make sure part of
|
||||
* view is actually in the usable area of the output of v.
|
||||
*/
|
||||
if (view->output != v->output) {
|
||||
struct wlr_box usable =
|
||||
output_usable_area_in_layout_coords(v->output);
|
||||
|
||||
struct wlr_box ol;
|
||||
if (!wlr_box_intersection(&ol, view_geom, &usable)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
struct border border = ssd_get_margin(v->ssd);
|
||||
|
||||
struct border win_edges = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue