mirror of
https://github.com/gwenhael-le-moine/sway-patched-tray-menu.git
synced 2024-12-28 22:23:42 +01:00
Moved visibility check of of loop, added asserts
This commit is contained in:
parent
740234a4bc
commit
820a8c9c2d
1 changed files with 5 additions and 1 deletions
|
@ -167,10 +167,12 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
|
|||
// If pointed container is in nested containers which are
|
||||
// inside tabbed/stacked layout we should skip them
|
||||
bool do_mouse_focus = true;
|
||||
sway_assert(c->type == C_VIEW, "pointed container is not a view");
|
||||
bool is_visible = view_is_visible(c->sway_view);
|
||||
struct sway_container *p = c->parent;
|
||||
while (p) {
|
||||
if ((p->layout == L_TABBED || p->layout == L_STACKED)
|
||||
&& !view_is_visible(c->sway_view)) {
|
||||
&& !is_visible) {
|
||||
do_mouse_focus = false;
|
||||
break;
|
||||
}
|
||||
|
@ -179,6 +181,8 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
|
|||
if (!do_mouse_focus) {
|
||||
struct sway_container *next_focus = seat_get_focus_inactive(
|
||||
cursor->seat, p);
|
||||
sway_assert(next_focus->type == C_VIEW,
|
||||
"focus inactive container is not a view");
|
||||
if (next_focus && view_is_visible(next_focus->sway_view)) {
|
||||
seat_set_focus_warp(cursor->seat, next_focus, false);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue