jjsullivan5196 / wvkbd

On-screen keyboard for wlroots
GNU General Public License v3.0
271 stars 54 forks source link

"error 0: Specified scale value (0) is not positive" #43

Closed flexibeast closed 1 year ago

flexibeast commented 1 year ago

Context: Gentoo; wlroots 0.16.2(-r1); sway 1.8.1; unmodified config.def.h.

After a successful build, running wvkbd-mobintl results in the error mentioned in the title:

Initializing keyboard
Found 54 layouts
Found 2 layers
wl_surface@15: error 0: Specified scale value (0) is not positive

This is due to keyboard.preferred_scale not having been changed from its default value of 0, which in turn is due to current_output not having been initialised by the time display_handle_scale is called, meaning that the conditional in the if:

if (current_output == output) {
    keyboard.preferred_scale = scale;
    flip_landscape();

never succeeds. Further, inserting a printf in wl_surface_enter shows that the function is never called, leaving current_output uninitialised.

If the default value of keyboard.preferred_scale is changed to 1, wvkbd-mobintl displays a keyboard.

EinarArnason commented 1 year ago

I'm also having this issue

proycon commented 1 year ago

Thanks, I have changed the default to 1 now, hopefully patching the most urgent problem, but we probably need to investigate further as you determined that current_output is not initialised properly either.

flexibeast commented 1 year ago

Thanks, I have changed the default to 1 now, hopefully patching the most urgent problem, but we probably need to investigate further as you determined that current_output is not initialised properly either.

Thanks! Happy to provide output with WAYLAND_DEBUG enabled, if you think that might be helpful .... ?

stacyharper commented 1 year ago

I think your work-arround should be enough @proycon.

Sway probably fixed something in master. I was receiving surface events before the layer_surface_configure notice.

This ticket also means that sometime there is no alternative to the blurry first frame, if the compositor decide to send the events in a crazy order.

proycon commented 1 year ago

The fix is released now, closing this issue

flexibeast commented 1 year ago

@proycon Thanks!