aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/xwayland.c
diff options
context:
space:
mode:
authorRyan Dwyer <RyanDwyer@users.noreply.github.com>2018-07-18 09:32:03 +1000
committerGitHub <noreply@github.com>2018-07-18 09:32:03 +1000
commit8ce7e3b44eea0a270ecc35a9da2ae801aaf6bce1 (patch)
tree6badffb0c6ee33b4e23e914c4c9f9b39a625b5f3 /sway/desktop/xwayland.c
parent621d2666b1ac214c63628bbe0ac8f5d6485cb501 (diff)
parent48b911a4596f50b585a1073d32413236d9defb60 (diff)
downloadsway-8ce7e3b44eea0a270ecc35a9da2ae801aaf6bce1.tar.xz
Merge branch 'master' into destroy-output-destroy-empty-workspaces
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r--sway/desktop/xwayland.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index b2874cfe..9df7977d 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -119,7 +119,7 @@ static struct sway_xwayland_unmanaged *create_unmanaged(
struct sway_xwayland_unmanaged *surface =
calloc(1, sizeof(struct sway_xwayland_unmanaged));
if (surface == NULL) {
- wlr_log(L_ERROR, "Allocation failed");
+ wlr_log(WLR_ERROR, "Allocation failed");
return NULL;
}
@@ -246,6 +246,14 @@ static bool wants_floating(struct sway_view *view) {
return false;
}
+static bool has_client_side_decorations(struct sway_view *view) {
+ if (xwayland_view_from_view(view) == NULL) {
+ return false;
+ }
+ struct wlr_xwayland_surface *surface = view->wlr_xwayland_surface;
+ return surface->decorations != WLR_XWAYLAND_SURFACE_DECORATIONS_ALL;
+}
+
static void _close(struct sway_view *view) {
if (xwayland_view_from_view(view) == NULL) {
return;
@@ -269,6 +277,7 @@ static const struct sway_view_impl view_impl = {
.set_tiled = set_tiled,
.set_fullscreen = set_fullscreen,
.wants_floating = wants_floating,
+ .has_client_side_decorations = has_client_side_decorations,
.close = _close,
.destroy = destroy,
};
@@ -288,6 +297,10 @@ static void handle_commit(struct wl_listener *listener, void *data) {
}
view_damage_from(view);
+
+ if (view->allow_request_urgent) {
+ view_set_urgent(view, (bool)xsurface->hints_urgency);
+ }
}
static void handle_unmap(struct wl_listener *listener, void *data) {
@@ -324,10 +337,11 @@ static void handle_map(struct wl_listener *listener, void *data) {
if (xsurface->fullscreen) {
view_set_fullscreen(view, true);
struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
- arrange_and_commit(ws);
+ arrange_windows(ws);
} else {
- arrange_and_commit(view->swayc->parent);
+ arrange_windows(view->swayc->parent);
}
+ transaction_commit_dirty();
}
static void handle_destroy(struct wl_listener *listener, void *data) {
@@ -383,7 +397,8 @@ static void handle_request_fullscreen(struct wl_listener *listener, void *data)
view_set_fullscreen(view, xsurface->fullscreen);
struct sway_container *output = container_parent(view->swayc, C_OUTPUT);
- arrange_and_commit(output);
+ arrange_windows(output);
+ transaction_commit_dirty();
}
static void handle_set_title(struct wl_listener *listener, void *data) {
@@ -432,12 +447,12 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) {
if (wlr_xwayland_surface_is_unmanaged(xsurface) ||
xsurface->override_redirect) {
- wlr_log(L_DEBUG, "New xwayland unmanaged surface");
+ wlr_log(WLR_DEBUG, "New xwayland unmanaged surface");
create_unmanaged(xsurface);
return;
}
- wlr_log(L_DEBUG, "New xwayland surface title='%s' class='%s'",
+ wlr_log(WLR_DEBUG, "New xwayland surface title='%s' class='%s'",
xsurface->title, xsurface->class);
struct sway_xwayland_view *xwayland_view =
@@ -490,7 +505,7 @@ void handle_xwayland_ready(struct wl_listener *listener, void *data) {
xcb_connection_t *xcb_conn = xcb_connect(NULL, NULL);
int err = xcb_connection_has_error(xcb_conn);
if (err) {
- wlr_log(L_ERROR, "XCB connect failed: %d", err);
+ wlr_log(WLR_ERROR, "XCB connect failed: %d", err);
return;
}
@@ -509,7 +524,7 @@ void handle_xwayland_ready(struct wl_listener *listener, void *data) {
free(reply);
if (error != NULL) {
- wlr_log(L_ERROR, "could not resolve atom %s, X11 error code %d",
+ wlr_log(WLR_ERROR, "could not resolve atom %s, X11 error code %d",
atom_map[i], error->error_code);
free(error);
break;