aboutsummaryrefslogtreecommitdiffstats
path: root/sway/server.c
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-06-18 22:49:28 +0100
committerLibravatar emersion <contact@emersion.fr>2018-06-18 22:52:10 +0100
commitcda66e9a263d8467b6d1857808305d5e9f7bc3cd (patch)
tree7e773d03ea9cecf959ba75598fd1a2d18dbd604c /sway/server.c
parentMerge pull request #2143 from vilhalmer/mark-pool-buffers-busy (diff)
downloadsway-cda66e9a263d8467b6d1857808305d5e9f7bc3cd.tar.gz
sway-cda66e9a263d8467b6d1857808305d5e9f7bc3cd.tar.zst
sway-cda66e9a263d8467b6d1857808305d5e9f7bc3cd.zip
Automatically float xwayland windows
Diffstat (limited to 'sway/server.c')
-rw-r--r--sway/server.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/sway/server.c b/sway/server.c
index 824b1d8e..878b530d 100644
--- a/sway/server.c
+++ b/sway/server.c
@@ -18,12 +18,11 @@
18#include <wlr/types/wlr_xdg_output.h> 18#include <wlr/types/wlr_xdg_output.h>
19#include <wlr/util/log.h> 19#include <wlr/util/log.h>
20// TODO WLR: make Xwayland optional 20// TODO WLR: make Xwayland optional
21#include <wlr/xwayland.h>
22#include "sway/config.h" 21#include "sway/config.h"
23#include "sway/input/input-manager.h" 22#include "sway/input/input-manager.h"
24#include "sway/server.h" 23#include "sway/server.h"
25#include "sway/tree/layout.h" 24#include "sway/tree/layout.h"
26 25#include "sway/xwayland.h"
27 26
28bool server_init(struct sway_server *server) { 27bool server_init(struct sway_server *server) {
29 wlr_log(L_DEBUG, "Initializing Wayland server"); 28 wlr_log(L_DEBUG, "Initializing Wayland server");
@@ -72,20 +71,23 @@ bool server_init(struct sway_server *server) {
72 server->xdg_shell_surface.notify = handle_xdg_shell_surface; 71 server->xdg_shell_surface.notify = handle_xdg_shell_surface;
73 72
74 // TODO make xwayland optional 73 // TODO make xwayland optional
75 server->xwayland = 74 server->xwayland.wlr_xwayland =
76 wlr_xwayland_create(server->wl_display, server->compositor, true); 75 wlr_xwayland_create(server->wl_display, server->compositor, true);
77 wl_signal_add(&server->xwayland->events.new_surface, 76 wl_signal_add(&server->xwayland.wlr_xwayland->events.new_surface,
78 &server->xwayland_surface); 77 &server->xwayland_surface);
79 server->xwayland_surface.notify = handle_xwayland_surface; 78 server->xwayland_surface.notify = handle_xwayland_surface;
79 wl_signal_add(&server->xwayland.wlr_xwayland->events.ready,
80 &server->xwayland_ready);
81 server->xwayland_ready.notify = handle_xwayland_ready;
80 82
81 // TODO: configurable cursor theme and size 83 // TODO: configurable cursor theme and size
82 server->xcursor_manager = wlr_xcursor_manager_create(NULL, 24); 84 server->xwayland.xcursor_manager = wlr_xcursor_manager_create(NULL, 24);
83 wlr_xcursor_manager_load(server->xcursor_manager, 1); 85 wlr_xcursor_manager_load(server->xwayland.xcursor_manager, 1);
84 struct wlr_xcursor *xcursor = wlr_xcursor_manager_get_xcursor( 86 struct wlr_xcursor *xcursor = wlr_xcursor_manager_get_xcursor(
85 server->xcursor_manager, "left_ptr", 1); 87 server->xwayland.xcursor_manager, "left_ptr", 1);
86 if (xcursor != NULL) { 88 if (xcursor != NULL) {
87 struct wlr_xcursor_image *image = xcursor->images[0]; 89 struct wlr_xcursor_image *image = xcursor->images[0];
88 wlr_xwayland_set_cursor(server->xwayland, image->buffer, 90 wlr_xwayland_set_cursor(server->xwayland.wlr_xwayland, image->buffer,
89 image->width * 4, image->width, image->height, image->hotspot_x, 91 image->width * 4, image->width, image->height, image->hotspot_x,
90 image->hotspot_y); 92 image->hotspot_y);
91 } 93 }