Change weston_surface.resource to a wl_resource pointer.
This is the first in what will be a series of weston patches to convert
instances of wl_resource to pointers so we can make wl_resource opaque.
This patch handles weston_surface and should be the most invasive of the
entire series. I am sending this one out ahead of the rest for review.
Specifically, my machine is not set up to build XWayland so I have no
ability to test it fully. Could someone please test with XWayland and let
me know if this causes problems?
Because a surface may be created from XWayland, the resource may not always
exist. Therefore, a destroy signal was added to weston_surface and
everything used to listen to surface->resource.destroy_signal now listens
to surface->destroy_signal.
diff --git a/src/shell.c b/src/shell.c
index 3d10eef..57dbb0a 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -2001,7 +2001,7 @@
pointer->x, pointer->y,
&sx, &sy);
- if (surface && surface->resource.client == client) {
+ if (surface && wl_resource_get_client(surface->resource) == client) {
weston_pointer_set_focus(pointer, surface, sx, sy);
} else {
weston_pointer_set_focus(pointer, NULL,
@@ -2263,7 +2263,7 @@
wl_signal_init(&shsurf->resource.destroy_signal);
shsurf->surface_destroy_listener.notify = shell_handle_surface_destroy;
- wl_signal_add(&surface->resource.destroy_signal,
+ wl_signal_add(&surface->destroy_signal,
&shsurf->surface_destroy_listener);
/* init link so its safe to always remove it in destroy_shell_surface */
@@ -2937,8 +2937,7 @@
state->keyboard_focus = es;
wl_list_remove(&state->surface_destroy_listener.link);
- wl_signal_add(&es->resource.destroy_signal,
- &state->surface_destroy_listener);
+ wl_signal_add(&es->destroy_signal, &state->surface_destroy_listener);
switch (get_shell_surface_type(main_surface)) {
case SHELL_SURFACE_FULLSCREEN:
@@ -3789,7 +3788,7 @@
wl_signal_init(&input_panel_surface->resource.destroy_signal);
input_panel_surface->surface_destroy_listener.notify = input_panel_handle_surface_destroy;
- wl_signal_add(&surface->resource.destroy_signal,
+ wl_signal_add(&surface->destroy_signal,
&input_panel_surface->surface_destroy_listener);
wl_list_init(&input_panel_surface->link);
@@ -3956,7 +3955,7 @@
return;
wl_list_remove(&switcher->listener.link);
- wl_signal_add(&next->resource.destroy_signal, &switcher->listener);
+ wl_signal_add(&next->destroy_signal, &switcher->listener);
switcher->current = next;
next->alpha = 1.0;
@@ -4213,7 +4212,7 @@
wl_signal_emit(&compositor->kill_signal, focus_surface);
- client = focus_surface->resource.client;
+ client = wl_resource_get_client(focus_surface->resource);
wl_client_get_credentials(client, &pid, NULL, NULL);
/* Skip clients that we launched ourselves (the credentials of