aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/drm/drm.c4
-rw-r--r--include/xwayland/xwm.h1
-rw-r--r--protocol/wlr-data-control-unstable-v1.xml9
-rw-r--r--types/wlr_data_control_v1.c4
-rw-r--r--types/wlr_surface.c16
-rw-r--r--xwayland/xwm.c27
6 files changed, 41 insertions, 20 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index a2a733f5..635a78e2 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -537,10 +537,6 @@ static bool drm_connector_set_mode(struct wlr_output *output,
conn->desired_mode = mode;
return false;
}
- if (conn->output.current_mode == mode) {
- // Nothing to do
- return true;
- }
wlr_log(WLR_INFO, "Modesetting '%s' with '%ux%u@%u mHz'",
conn->output.name, mode->width, mode->height, mode->refresh);
diff --git a/include/xwayland/xwm.h b/include/xwayland/xwm.h
index a3bdc48c..00f2f3d5 100644
--- a/include/xwayland/xwm.h
+++ b/include/xwayland/xwm.h
@@ -80,6 +80,7 @@ enum atom_name {
DND_ACTION_COPY,
DND_ACTION_ASK,
DND_ACTION_PRIVATE,
+ _NET_CLIENT_LIST,
ATOM_LAST,
};
diff --git a/protocol/wlr-data-control-unstable-v1.xml b/protocol/wlr-data-control-unstable-v1.xml
index 3e39f2ac..75e8671b 100644
--- a/protocol/wlr-data-control-unstable-v1.xml
+++ b/protocol/wlr-data-control-unstable-v1.xml
@@ -69,15 +69,6 @@
appropriate destroy request has been called.
</description>
</request>
-
- <!-- Version 2 additions -->
-
- <event name="primary_selection" since="2">
- <description summary="advertise primary selection support">
- This event can be sent when binding to the wlr_data_control_manager
- global to advertise that it supports the primary selection.
- </description>
- </event>
</interface>
<interface name="zwlr_data_control_device_v1" version="2">
diff --git a/types/wlr_data_control_v1.c b/types/wlr_data_control_v1.c
index 99dd0dae..b23e37ee 100644
--- a/types/wlr_data_control_v1.c
+++ b/types/wlr_data_control_v1.c
@@ -667,10 +667,6 @@ static void manager_bind(struct wl_client *client, void *data, uint32_t version,
manager_handle_resource_destroy);
wl_list_insert(&manager->resources, wl_resource_get_link(resource));
-
- if (version >= ZWLR_DATA_CONTROL_MANAGER_V1_PRIMARY_SELECTION_SINCE_VERSION) {
- zwlr_data_control_manager_v1_send_primary_selection(resource);
- }
}
static void handle_display_destroy(struct wl_listener *listener, void *data) {
diff --git a/types/wlr_surface.c b/types/wlr_surface.c
index 27176ef0..de63bdae 100644
--- a/types/wlr_surface.c
+++ b/types/wlr_surface.c
@@ -450,15 +450,25 @@ static void surface_commit(struct wl_client *client,
}
static void surface_set_buffer_transform(struct wl_client *client,
- struct wl_resource *resource, int transform) {
+ struct wl_resource *resource, int32_t transform) {
+ if (transform < WL_OUTPUT_TRANSFORM_NORMAL ||
+ transform > WL_OUTPUT_TRANSFORM_FLIPPED_270) {
+ wl_resource_post_error(resource, WL_SURFACE_ERROR_INVALID_TRANSFORM,
+ "Specified transform value (%d) is invalid", transform);
+ return;
+ }
struct wlr_surface *surface = wlr_surface_from_resource(resource);
surface->pending.committed |= WLR_SURFACE_STATE_TRANSFORM;
surface->pending.transform = transform;
}
static void surface_set_buffer_scale(struct wl_client *client,
- struct wl_resource *resource,
- int32_t scale) {
+ struct wl_resource *resource, int32_t scale) {
+ if (scale <= 0) {
+ wl_resource_post_error(resource, WL_SURFACE_ERROR_INVALID_SCALE,
+ "Specified scale value (%d) is not positive", scale);
+ return;
+ }
struct wlr_surface *surface = wlr_surface_from_resource(resource);
surface->pending.committed |= WLR_SURFACE_STATE_SCALE;
surface->pending.scale = scale;
diff --git a/xwayland/xwm.c b/xwayland/xwm.c
index fc294674..9ca2c721 100644
--- a/xwayland/xwm.c
+++ b/xwayland/xwm.c
@@ -78,6 +78,7 @@ const char *atom_map[ATOM_LAST] = {
"XdndActionCopy",
"XdndActionAsk",
"XdndActionPrivate",
+ "_NET_CLIENT_LIST",
};
static const struct wlr_surface_role xwayland_surface_role;
@@ -212,6 +213,28 @@ static void xwm_send_wm_message(struct wlr_xwayland_surface *surface,
xcb_flush(xwm->xcb_conn);
}
+static void xwm_set_net_client_list(struct wlr_xwm *xwm) {
+ size_t mapped_surfaces = 0;
+ struct wlr_xwayland_surface *surface;
+ wl_list_for_each(surface, &xwm->surfaces, link) {
+ if (surface->mapped) {
+ mapped_surfaces++;
+ }
+ }
+
+ xcb_window_t windows[mapped_surfaces + 1];
+ size_t index = 0;
+ wl_list_for_each(surface, &xwm->surfaces, link) {
+ if (surface->mapped) {
+ windows[index++] = surface->window_id;
+ }
+ }
+
+ xcb_change_property(xwm->xcb_conn, XCB_PROP_MODE_REPLACE,
+ xwm->screen->root, xwm->atoms[_NET_CLIENT_LIST],
+ XCB_ATOM_WINDOW, 32, mapped_surfaces, windows);
+}
+
static void xwm_send_focus_window(struct wlr_xwm *xwm,
struct wlr_xwayland_surface *xsurface) {
if (!xsurface) {
@@ -702,6 +725,7 @@ static void xwayland_surface_role_commit(struct wlr_surface *wlr_surface) {
if (!surface->mapped && wlr_surface_has_buffer(surface->surface)) {
wlr_signal_emit_safe(&surface->events.map, surface);
surface->mapped = true;
+ xwm_set_net_client_list(surface->xwm);
}
}
@@ -718,6 +742,7 @@ static void xwayland_surface_role_precommit(struct wlr_surface *wlr_surface) {
if (surface->mapped) {
wlr_signal_emit_safe(&surface->events.unmap, surface);
surface->mapped = false;
+ xwm_set_net_client_list(surface->xwm);
}
}
}
@@ -770,6 +795,7 @@ static void xsurface_unmap(struct wlr_xwayland_surface *surface) {
if (surface->mapped) {
surface->mapped = false;
wlr_signal_emit_safe(&surface->events.unmap, surface);
+ xwm_set_net_client_list(surface->xwm);
}
if (surface->surface_id) {
@@ -1712,6 +1738,7 @@ struct wlr_xwm *xwm_create(struct wlr_xwayland *wlr_xwayland) {
xwm->atoms[_NET_WM_STATE_FULLSCREEN],
xwm->atoms[_NET_WM_STATE_MAXIMIZED_VERT],
xwm->atoms[_NET_WM_STATE_MAXIMIZED_HORZ],
+ xwm->atoms[_NET_CLIENT_LIST],
};
xcb_change_property(xwm->xcb_conn,
XCB_PROP_MODE_REPLACE,