aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop')
-rw-r--r--sway/desktop/output.c6
-rw-r--r--sway/desktop/render.c3
-rw-r--r--sway/desktop/xwayland.c22
3 files changed, 23 insertions, 8 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index c228979d..c30e52a1 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -559,12 +559,6 @@ void handle_new_output(struct wl_listener *listener, void *data) {
wl_list_insert(&root_container.sway_root->all_outputs, &output->link);
- if (!wl_list_empty(&wlr_output->modes)) {
- struct wlr_output_mode *mode =
- wl_container_of(wlr_output->modes.prev, mode, link);
- wlr_output_set_mode(wlr_output, mode);
- }
-
output_enable(output);
}
diff --git a/sway/desktop/render.c b/sway/desktop/render.c
index 5556e5b3..695213eb 100644
--- a/sway/desktop/render.c
+++ b/sway/desktop/render.c
@@ -346,7 +346,8 @@ static void render_titlebar(struct sway_output *output,
float output_scale = output->wlr_output->scale;
enum sway_container_layout layout = state->parent->current.layout;
list_t *children = state->parent->current.children;
- bool is_last_child = children->items[children->length - 1] == con;
+ bool is_last_child = children->length == 0 ||
+ children->items[children->length - 1] == con;
double output_x = output->swayc->current.swayc_x;
double output_y = output->swayc->current.swayc_y;
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index 2adc28c5..10faf91d 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -218,7 +218,9 @@ static bool wants_floating(struct sway_view *view) {
struct wlr_xwayland_surface *surface = view->wlr_xwayland_surface;
struct sway_xwayland *xwayland = &server.xwayland;
- // TODO: return true if the NET_WM_STATE is MODAL
+ if (surface->modal) {
+ return true;
+ }
for (size_t i = 0; i < surface->window_type_len; ++i) {
xcb_atom_t type = surface->window_type[i];
@@ -335,6 +337,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
wl_list_remove(&xwayland_view->request_fullscreen.link);
wl_list_remove(&xwayland_view->request_move.link);
wl_list_remove(&xwayland_view->request_resize.link);
+ wl_list_remove(&xwayland_view->request_activate.link);
wl_list_remove(&xwayland_view->set_title.link);
wl_list_remove(&xwayland_view->set_class.link);
wl_list_remove(&xwayland_view->set_window_type.link);
@@ -461,6 +464,19 @@ static void handle_request_resize(struct wl_listener *listener, void *data) {
seat_begin_resize_floating(seat, view->swayc, seat->last_button, e->edges);
}
+static void handle_request_activate(struct wl_listener *listener, void *data) {
+ struct sway_xwayland_view *xwayland_view =
+ wl_container_of(listener, xwayland_view, request_activate);
+ struct sway_view *view = &xwayland_view->view;
+ struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface;
+ if (!xsurface->mapped) {
+ return;
+ }
+ view_request_activate(view);
+
+ transaction_commit_dirty();
+}
+
static void handle_set_title(struct wl_listener *listener, void *data) {
struct sway_xwayland_view *xwayland_view =
wl_container_of(listener, xwayland_view, set_title);
@@ -553,6 +569,10 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) {
&xwayland_view->request_fullscreen);
xwayland_view->request_fullscreen.notify = handle_request_fullscreen;
+ wl_signal_add(&xsurface->events.request_activate,
+ &xwayland_view->request_activate);
+ xwayland_view->request_activate.notify = handle_request_activate;
+
wl_signal_add(&xsurface->events.request_move,
&xwayland_view->request_move);
xwayland_view->request_move.notify = handle_request_move;