On Thu, 16 May 2019 05:59:20 +0100 adlo <adloco...@gmail.com> wrote: > On Wed, 2019-05-01 at 12:34 +0300, Pekka Paalanen wrote: > > > > it is all just the normal Wayland protocol exchange but with a new > > interface of your own design. I'm not sure if there is a really > > minimal example, but I'll list at least some. > > > > One example of such private protocol extension is > > https://gitlab.freedesktop.org/wayland/weston/blob/master/protocol/weston-desktop-shell.xml > > > > I wrote a test client to test an initial limited implementation of my > protocol. WAYLAND_DEBUG indicates that my client binds to the > interface, but my protocol's server-side bind() function doesn't run. > > Here is some of my code: > > Server-side: > > static void > bind_desktop_shell(struct wl_client *client, > void *data, uint32_t version, uint32_t id) > { > > // This log message never appears > weston_log ("\nbind desktop shell\n"); > > } > > void shell_init () > { > > wl_global_create (server->compositor->wl_display, > &xyz_shell_interface, 1, > server, bind_desktop_shell); > > } > > Client-side: > > void global_add(void *our_data, > struct wl_registry *registry, > uint32_t name, > const char *interface, > uint32_t version) { > > if (strcmp(interface, "xyz_shell") == 0) { > struct xyz_shell *xshell = NULL; > xshell = wl_registry_bind (registry, 1, &xyz_shell_interface, > 1); > } > > } > > int main (int argc, > char **argv) > { > display = wl_display_connect (NULL); > > registry = wl_display_get_registry (display); > > wl_registry_add_listener(registry, ®istry_listener, NULL); > > wl_display_dispatch (display); > wl_display_dispatch (display); > > return 0; > } > > How can I fix this?
Hi, you should run an actual event loop in the client, which will then flush your requests to the compositor. Your issue seems to be a missing flush. See also https://wayland.freedesktop.org/extras.html "Protocol dumpers" and the link "is not enough". See: wl_display_flush() Thanks, pq
pgp6YY_kou3F9.pgp
Description: OpenPGP digital signature
_______________________________________________ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel