xwayland: Split a helper out
This will make the next commit, which ports to the new ClientMessage API, more understandable.
This commit is contained in:
parent
e07bd15fc2
commit
9653b79a35
@ -37,6 +37,25 @@
|
|||||||
#include "meta-window-actor-private.h"
|
#include "meta-window-actor-private.h"
|
||||||
#include "xserver-server-protocol.h"
|
#include "xserver-server-protocol.h"
|
||||||
|
|
||||||
|
static void
|
||||||
|
associate_window_with_surface (MetaWindow *window,
|
||||||
|
MetaWaylandSurface *surface)
|
||||||
|
{
|
||||||
|
MetaDisplay *display = window->display;
|
||||||
|
|
||||||
|
/* If the window has an existing surface, like if we're
|
||||||
|
* undecorating or decorating the window, then we need
|
||||||
|
* to detach the window from its old surface.
|
||||||
|
*/
|
||||||
|
if (window->surface)
|
||||||
|
window->surface->window = NULL;
|
||||||
|
|
||||||
|
meta_wayland_surface_set_window (surface, window);
|
||||||
|
window->surface = surface;
|
||||||
|
|
||||||
|
meta_compositor_window_surface_changed (display->compositor, window);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
xserver_set_window_id (struct wl_client *client,
|
xserver_set_window_id (struct wl_client *client,
|
||||||
struct wl_resource *compositor_resource,
|
struct wl_resource *compositor_resource,
|
||||||
@ -51,17 +70,7 @@ xserver_set_window_id (struct wl_client *client,
|
|||||||
if (!window)
|
if (!window)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* If the window has an existing surface, like if we're
|
associate_window_with_surface (window, surface);
|
||||||
* undecorating or decorating the window, then we need
|
|
||||||
* to detach the window from its old surface.
|
|
||||||
*/
|
|
||||||
if (window->surface)
|
|
||||||
window->surface->window = NULL;
|
|
||||||
|
|
||||||
meta_wayland_surface_set_window (surface, window);
|
|
||||||
window->surface = surface;
|
|
||||||
|
|
||||||
meta_compositor_window_surface_changed (display->compositor, window);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct xserver_interface xserver_implementation = {
|
static const struct xserver_interface xserver_implementation = {
|
||||||
|
Loading…
Reference in New Issue
Block a user