mirror of
https://github.com/labwc/labwc.git
synced 2026-04-04 07:15:41 -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 view_edges = { 0 };
|
||||||
struct border target_edges = { 0 };
|
struct border target_edges = { 0 };
|
||||||
|
|
||||||
edges_for_target_geometry(&view_edges, view,
|
struct wlr_box *view_geom =
|
||||||
use_pending ? view->pending : view->current);
|
use_pending ? &view->pending : &view->current;
|
||||||
|
|
||||||
|
edges_for_target_geometry(&view_edges, view, *view_geom);
|
||||||
edges_for_target_geometry(&target_edges, view, target);
|
edges_for_target_geometry(&target_edges, view, target);
|
||||||
|
|
||||||
struct view *v;
|
struct view *v;
|
||||||
|
|
@ -151,6 +153,20 @@ edges_find_neighbors(struct border *nearest_edges, struct view *view,
|
||||||
continue;
|
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 border = ssd_get_margin(v->ssd);
|
||||||
|
|
||||||
struct border win_edges = {
|
struct border win_edges = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue