mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
output: Add output_is_usable() helper
This commit is contained in:
parent
fe7edf82d9
commit
6efc6a9db4
5 changed files with 20 additions and 18 deletions
|
|
@ -110,21 +110,16 @@ void
|
|||
foreign_toplevel_update_outputs(struct view *view)
|
||||
{
|
||||
assert(view->toplevel.handle);
|
||||
|
||||
struct wlr_box view_geo = view->current;
|
||||
struct wlr_output_layout *layout = view->server->output_layout;
|
||||
|
||||
struct output *output;
|
||||
wl_list_for_each(output, &view->server->outputs, link) {
|
||||
if (output->wlr_output->enabled && !output->leased) {
|
||||
if (wlr_output_layout_intersects(layout,
|
||||
output->wlr_output, &view_geo)) {
|
||||
wlr_foreign_toplevel_handle_v1_output_enter(
|
||||
view->toplevel.handle, output->wlr_output);
|
||||
continue;
|
||||
}
|
||||
if (output_is_usable(output) && wlr_output_layout_intersects(
|
||||
layout, output->wlr_output, &view->current)) {
|
||||
wlr_foreign_toplevel_handle_v1_output_enter(
|
||||
view->toplevel.handle, output->wlr_output);
|
||||
} else {
|
||||
wlr_foreign_toplevel_handle_v1_output_leave(
|
||||
view->toplevel.handle, output->wlr_output);
|
||||
}
|
||||
wlr_foreign_toplevel_handle_v1_output_leave(
|
||||
view->toplevel.handle, output->wlr_output);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue