GNOME Bugzilla – Bug 704104
gdk/wayland: cope with the compositor implementing an older protocol than us
Last modified: 2013-07-16 16:21:48 UTC
If we bind to a global with an higher version than implemented, or we make requests that appeared in a later version, we would get fatal wayland errors.
Created attachment 249018 [details] [review] gdk/wayland: cope with the compositor implementing an older protocol than us
Review of attachment 249018 [details] [review]: if we make requests that appeared in a later version I assume we'll have fallbacks in place. as a side note: at some point, we'll have to fix the coding style of this whole backend to fit in with the GDK coding style. ::: gdk/wayland/gdkdisplay-wayland.c @@ +170,3 @@ } else if (strcmp(interface, "wl_output") == 0) { output = + wl_registry_bind(display_wayland->wl_registry, id, &wl_output_interface, MIN (version, 2)); we're not using it, right now, but should we save the output version as well, for later use? ::: gdk/wayland/gdkwindow-wayland.c @@ +587,3 @@ wl_surface_attach (impl->surface, data->buffer, dx, dy); + if (GDK_WAYLAND_DISPLAY (gdk_window_get_display (window))->compositor_version >= + WL_SURFACE_HAS_BUFFER_SCALE) don't break the condition; if the line feels too long, take out the cast from GdkDisplay to GdkWaylandDisplay into a separate assignment.
(In reply to comment #2) > Review of attachment 249018 [details] [review]: > > if we make requests that appeared in a later version I assume we'll have > fallbacks in place. Yes, the only request we make is set_buffer_scale (wl_surface v3), which we can skip by disabling the scaled window support. > as a side note: at some point, we'll have to fix the coding style of this whole > backend to fit in with the GDK coding style. > > ::: gdk/wayland/gdkdisplay-wayland.c > @@ +170,3 @@ > } else if (strcmp(interface, "wl_output") == 0) { > output = > + wl_registry_bind(display_wayland->wl_registry, id, &wl_output_interface, > MIN (version, 2)); > > we're not using it, right now, but should we save the output version as well, > for later use? We do save the output version and use it (line 173), although we probably should save the version we're actually requesting, rather than the compositor version, for forward compatibility.
Created attachment 249161 [details] [review] gdk/wayland: cope with the compositor implementing an older protocol than us If we bind to a global with an higher version than implemented, or we make requests that appeared in a later version, we would get fatal wayland errors.
(In reply to comment #4) > Created an attachment (id=249161) [details] [review] > gdk/wayland: cope with the compositor implementing an older protocol than us > > If we bind to a global with an higher version than implemented, or > we make requests that appeared in a later version, we would get > fatal wayland errors. That looks good.
Review of attachment 249161 [details] [review]: Yeh lets go with this. Thanks!
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report. (I forgot to git-bz :D )