mirror of
https://codeberg.org/dwl/dwl.git
synced 2025-10-28 02:34:15 +00:00
add asserts/notes
This commit is contained in:
parent
7185888772
commit
ceb9ab9a6b
17
dwl.c
17
dwl.c
@ -247,6 +247,7 @@ assert_pointer_focus_invariants(void)
|
|||||||
xytoclient(cursor->x, cursor->y, &surface, &sx, &sy);
|
xytoclient(cursor->x, cursor->y, &surface, &sx, &sy);
|
||||||
if (cursor_mode == CurNormal) {
|
if (cursor_mode == CurNormal) {
|
||||||
/* Pointer focus is surface under pointer */
|
/* Pointer focus is surface under pointer */
|
||||||
|
/* XXX fails when popups are created under pointer */
|
||||||
assert(wlr_seat_pointer_surface_has_focus(seat, surface));
|
assert(wlr_seat_pointer_surface_has_focus(seat, surface));
|
||||||
} else {
|
} else {
|
||||||
/* No surface has pointer focus */
|
/* No surface has pointer focus */
|
||||||
@ -1620,8 +1621,8 @@ view(const Arg *arg)
|
|||||||
assert_pointer_focus_invariants();
|
assert_pointer_focus_invariants();
|
||||||
}
|
}
|
||||||
|
|
||||||
Client *
|
static Client *
|
||||||
xytoclient(double x, double y,
|
_xytoclient(double x, double y,
|
||||||
struct wlr_surface **surface, double *sx, double *sy)
|
struct wlr_surface **surface, double *sx, double *sy)
|
||||||
{
|
{
|
||||||
/* XXX what if (x,y) is within a window's border? */
|
/* XXX what if (x,y) is within a window's border? */
|
||||||
@ -1655,6 +1656,18 @@ xytoclient(double x, double y,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Client *
|
||||||
|
xytoclient(double x, double y,
|
||||||
|
struct wlr_surface **surface, double *sx, double *sy)
|
||||||
|
{
|
||||||
|
assert(surface != NULL);
|
||||||
|
assert(sx != NULL);
|
||||||
|
assert(sy != NULL);
|
||||||
|
Client *ret = _xytoclient(x, y, surface, sx, sy);
|
||||||
|
assert(EQV(ret != NULL, *surface != NULL));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
Monitor *
|
Monitor *
|
||||||
xytomon(double x, double y)
|
xytomon(double x, double y)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user