aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-08-24 07:06:18 -0500
committerGitHub <noreply@github.com>2017-08-24 07:06:18 -0500
commitf10da8291b3f0d51b55262bd623511c8b8349a9e (patch)
treefebfff4ace5017dee7d6796eb1d1ac9f53604f1d /examples
parenta138657598efafbd3cfd7c77cb32ba294d0b841c (diff)
parentb29c7d01b19fc8c6bda70af016bc536cc72fe4f9 (diff)
Merge pull request #119 from martinetd/xwayland
Xwayland
Diffstat (limited to 'examples')
-rw-r--r--examples/compositor.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/compositor.c b/examples/compositor.c
index fb00032a..024324cd 100644
--- a/examples/compositor.c
+++ b/examples/compositor.c
@@ -19,6 +19,7 @@
#include <wlr/types/wlr_seat.h>
#include <wlr/types/wlr_data_device_manager.h>
#include "wlr/types/wlr_compositor.h"
+#include <wlr/xwayland.h>
#include <xkbcommon/xkbcommon.h>
#include <wlr/util/log.h>
#include "shared.h"
@@ -35,6 +36,7 @@ struct sample_state {
struct wlr_data_device_manager *data_device_manager;
struct wl_resource *focus;
struct wl_listener keyboard_bound;
+ struct wlr_xwayland *xwayland;
int keymap_fd;
size_t keymap_size;
uint32_t serial;
@@ -83,6 +85,10 @@ static void handle_output_frame(struct output_state *output, struct timespec *ts
wl_list_for_each(xdg_surface, &sample->xdg_shell->surfaces, link) {
output_frame_handle_surface(sample, wlr_output, ts, xdg_surface->surface);
}
+ struct wlr_x11_window *x11_window;
+ wl_list_for_each(x11_window, &sample->xwayland->displayable_windows, link) {
+ output_frame_handle_surface(sample, wlr_output, ts, x11_window->surface);
+ }
wlr_renderer_end(sample->renderer);
wlr_output_swap_buffers(wlr_output);
@@ -176,11 +182,13 @@ int main() {
free(keymap);
break;
}
+ state.xwayland = wlr_xwayland_create(compositor.display, state.wlr_compositor);
compositor.keyboard_key_cb = handle_keyboard_key;
wl_display_run(compositor.display);
+ wlr_xwayland_destroy(state.xwayland);
close(state.keymap_fd);
wlr_seat_destroy(state.wl_seat);
wlr_data_device_manager_destroy(state.data_device_manager);