diff options
author | Jason Ekstrand <jason@jlekstrand.net> | 2013-06-06 22:34:41 -0500 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2013-06-12 15:04:49 -0400 |
commit | 26ed73cee858956f6af07c3e4bb49b5514f17b8b (patch) | |
tree | 9103be3c5be45637f49fb58e10e6eb2839d47322 /src/xwayland | |
parent | a2ce68fd0346b41b99c6dbbd3c33a5272ce31421 (diff) | |
download | weston-26ed73cee858956f6af07c3e4bb49b5514f17b8b.tar.gz weston-26ed73cee858956f6af07c3e4bb49b5514f17b8b.tar.bz2 weston-26ed73cee858956f6af07c3e4bb49b5514f17b8b.zip |
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.
Diffstat (limited to 'src/xwayland')
-rw-r--r-- | src/xwayland/window-manager.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c index 366f2e04..5d003a94 100644 --- a/src/xwayland/window-manager.c +++ b/src/xwayland/window-manager.c @@ -1621,7 +1621,7 @@ weston_wm_create(struct weston_xserver *wxs) } xserver_send_client(wxs->resource, sv[1]); - wl_client_flush(wxs->resource->client); + wl_client_flush(wl_resource_get_client(wxs->resource)); close(sv[1]); /* xcb_connect_to_fd takes ownership of the fd. */ @@ -1715,10 +1715,9 @@ surface_destroy(struct wl_listener *listener, void *data) static struct weston_wm_window * get_wm_window(struct weston_surface *surface) { - struct wl_resource *resource = &surface->resource; struct wl_listener *listener; - listener = wl_signal_get(&resource->destroy_signal, surface_destroy); + listener = wl_signal_get(&surface->destroy_signal, surface_destroy); if (listener) return container_of(listener, struct weston_wm_window, surface_destroy_listener); @@ -1850,9 +1849,10 @@ static void xserver_set_window_id(struct wl_client *client, struct wl_resource *resource, struct wl_resource *surface_resource, uint32_t id) { - struct weston_xserver *wxs = resource->data; + struct weston_xserver *wxs = wl_resource_get_user_data(resource); struct weston_wm *wm = wxs->wm; - struct weston_surface *surface = surface_resource->data; + struct weston_surface *surface = + wl_resource_get_user_data(surface_resource); struct weston_wm_window *window; if (client != wxs->client) @@ -1870,7 +1870,7 @@ xserver_set_window_id(struct wl_client *client, struct wl_resource *resource, window->surface = (struct weston_surface *) surface; window->surface_destroy_listener.notify = surface_destroy; - wl_signal_add(&surface->resource.destroy_signal, + wl_signal_add(&surface->destroy_signal, &window->surface_destroy_listener); weston_wm_window_schedule_repaint(window); |