michaelforney / swc

a library for making a simple Wayland compositor
MIT License
614 stars 52 forks source link

Firefox (and possibly others) only renders black window #48

Closed ianbeyst closed 5 years ago

ianbeyst commented 5 years ago

Minimal working example.

Besides the blank screen, it seems that Firefox runs perfectly fine otherwise. By carefully moving the mouse around and inspecting changes in the title bar, it is obvious that websites are loaded. Platform: void linux x86_64-musl, tested on velox and the example wm included with swc.

Any idea what causes this?

michaelforney commented 5 years ago

I was able to reproduce this issue. I don't think the hello-wayland example is related (it doesn't call wl_surface.damage, so none of the surface is updated).

It looks to be lack of subsurface support (#25). But I'm happy to see that firefox wayland support almost works with swc. This should be good motivation for finally getting subsurfaces implemented.

ianbeyst commented 5 years ago

Thanks for taking a look at this. I double checked and indeed, if I call wl_surface_damage the cat shows up on swc. The question that I still have (if you don't mind me asking) is that even without calling wl_surface_damage, the cat shows up under weston. Is this some non-standard behaviour of weston that the hello-wayland example (ab)uses, or is it non-standard behaviour of swc? Just trying to make sense of how wayland is supposed to work.

michaelforney commented 5 years ago

I'm not sure. The spec says that the initial damaged region is empty (link):

The initial value for pending damage is empty: no damage. wl_surface.damage adds pending damage: the new pending damage is the union of old pending damage and the given rectangle.

I suppose the compositor could assume some implicit damage when a buffer is initially attached, or resized to a larger size, though I don't think the spec mentions this anywhere. In practice, this is the first client I've run into that doesn't ever report damage for a surface.