mirror of
https://github.com/cage-kiosk/cage.git
synced 2026-03-30 11:10:50 -04:00
view: replace view_has_children with view_is_transient_for
This is a much cleaner implementation but allows us to do the same things.
This commit is contained in:
parent
7de253386c
commit
5c403edc0b
5 changed files with 36 additions and 22 deletions
7
seat.c
7
seat.c
|
|
@ -89,9 +89,14 @@ press_cursor_button(struct cg_seat *seat, struct wlr_input_device *device,
|
|||
struct wlr_surface *surface;
|
||||
struct cg_view *view = desktop_view_at(server, lx, ly,
|
||||
&surface, &sx, &sy);
|
||||
struct cg_view *current = seat_get_focus(seat);
|
||||
if (view == current) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Focus that client if the button was pressed and
|
||||
it has no open dialogs. */
|
||||
if (view && !view_has_children(server, view)) {
|
||||
if (view && !view_is_transient_for(current, view)) {
|
||||
seat_set_focus(seat, view);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue