diff options
author | Simon Ser <contact@emersion.fr> | 2020-05-05 10:24:08 +0200 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-05-19 22:07:47 +0200 |
commit | 27609ba0d9d140660f0cc077ad7af8670fa0ed21 (patch) | |
tree | 3d8d134dd18fdc2f837755d07c08c8a86aa575a8 /include | |
parent | d28a7da95d1adeabb9f628d91c872fb2cb7fcee3 (diff) |
xwayland: split server
Split the server part of wlr_xwayland into wlr_xwayland_server. This
allows compositors to implement their own XWM when wlroots' isn't a good
fit.
Diffstat (limited to 'include')
-rw-r--r-- | include/wlr/xwayland.h | 39 | ||||
-rw-r--r-- | include/xwayland/xwm.h | 2 |
2 files changed, 34 insertions, 7 deletions
diff --git a/include/wlr/xwayland.h b/include/wlr/xwayland.h index 8646e7ac..c4c5842c 100644 --- a/include/wlr/xwayland.h +++ b/include/wlr/xwayland.h @@ -18,14 +18,11 @@ struct wlr_xwm; struct wlr_xwayland_cursor; -struct wlr_gtk_primary_selection_device_manager; -struct wlr_xwayland { +struct wlr_xwayland_server { pid_t pid; struct wl_client *client; struct wl_event_source *sigusr1_source; - struct wlr_xwm *xwm; - struct wlr_xwayland_cursor *cursor; int wm_fd[2], wl_fd[2]; time_t server_start; @@ -39,6 +36,31 @@ struct wlr_xwayland { bool lazy; struct wl_display *wl_display; + + struct { + struct wl_signal ready; + struct wl_signal destroy; + } events; + + struct wl_listener client_destroy; + struct wl_listener display_destroy; + + void *data; +}; + +struct wlr_xwayland_server_ready_event { + struct wlr_xwayland_server *server; + int wm_fd; +}; + +struct wlr_xwayland { + struct wlr_xwayland_server *server; + struct wlr_xwm *xwm; + struct wlr_xwayland_cursor *cursor; + + const char *display_name; + + struct wl_display *wl_display; struct wlr_compositor *compositor; struct wlr_seat *seat; @@ -54,8 +76,9 @@ struct wlr_xwayland { */ int (*user_event_handler)(struct wlr_xwm *xwm, xcb_generic_event_t *event); + struct wl_listener server_ready; + struct wl_listener server_destroy; struct wl_listener client_destroy; - struct wl_listener display_destroy; struct wl_listener seat_destroy; void *data; @@ -192,7 +215,11 @@ struct wlr_xwayland_resize_event { uint32_t edges; }; -/** Create an Xwayland server. +struct wlr_xwayland_server *wlr_xwayland_server_create( + struct wl_display *display, bool lazy); +void wlr_xwayland_server_destroy(struct wlr_xwayland_server *server); + +/** Create an Xwayland server and XWM. * * The server supports a lazy mode in which Xwayland is only started when a * client tries to connect. diff --git a/include/xwayland/xwm.h b/include/xwayland/xwm.h index 351fce44..2569092f 100644 --- a/include/xwayland/xwm.h +++ b/include/xwayland/xwm.h @@ -138,7 +138,7 @@ struct wlr_xwm { struct wl_listener seat_drag_source_destroy; }; -struct wlr_xwm *xwm_create(struct wlr_xwayland *wlr_xwayland); +struct wlr_xwm *xwm_create(struct wlr_xwayland *wlr_xwayland, int wm_fd); void xwm_destroy(struct wlr_xwm *xwm); |