-
Notifications
You must be signed in to change notification settings - Fork 278
Remove some redundant function calls #463
base: main
Are you sure you want to change the base?
Conversation
@@ -1808,9 +1810,6 @@ outputmgrapplyortest(struct wlr_output_configuration_v1 *config, int test) | |||
else | |||
wlr_output_configuration_v1_send_failed(config); | |||
wlr_output_configuration_v1_destroy(config); | |||
|
|||
/* TODO: use a wrapper function? */ | |||
updatemons(NULL, NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is actually needed. While testing it turned out that without this call some changes didn't apply.
BTW, it can be replaced with wl_signal_emit_mutable(&output_layout->events.change, output_layout);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird. Do you remember what kind of changes didn't apply, and are we sure it's not a wlroots bug? These lines came from cb01ce9, in case that helps jog your memory.
(I don't have an external on me right now, so I had to test using the wl backend instead of drm.)
dwl.c
Outdated
@@ -1531,7 +1534,6 @@ void | |||
maplayersurfacenotify(struct wl_listener *listener, void *data) | |||
{ | |||
LayerSurface *l = wl_container_of(listener, l, map); | |||
wlr_surface_send_enter(l->layer_surface->surface, l->mon->wlr_output); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far I remember this is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, it's not needed, but I found a funny thing, seems like the surfaces don't receive the wl_pointer.enter at all (with and without send wl_suface.enter ourselves)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I discovered that swaynag is a better test (guessing dtao and bemenu are binding to older protocol versions), and there I'm still seeing both surface-enter-output and pointer-enter-surface:
$ WAYLAND_DEBUG=1 swaynag -m hello |& grep -Fw -e enter -e leave
[ 631375.417] [email protected](wl_output@8)
[ 633471.854] [email protected](1155, wl_surface@10, 1476.41406250, 33.74218750)
[ 635047.065] [email protected](1156, wl_surface@10)
[ 636230.590] [email protected](1159, wl_surface@10, 1490.90625000, 32.12109375)
For the record, bemenu showed keyboard-enter with a similar test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I meant, it does not receive wl_pointer.enter until the cursor is moved, to reproduce:
- run
WAYLAND_DEBUG=1 fnott
- move the cursor where the notification will be placed
- send a notify
EDIT: fnott link: https://codeberg.org/dnkl/fnott
8d71123
to
c352729
Compare
Merged "No need to send surface.leave/enter events" and "Style: use early-return to clarify code" I still need to check the call of updatemons |
The output manager in wlroots emits an output_layout.change event when anything changes, so updatemons will be called anyway. ΔSLOC: -1
c352729
to
b1cea77
Compare
Spotted a couple of things that wlroots already does for us, and a couple of places where we were called
printstatus()
after making no changes.Net ΔSLOC: -5