aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop')
-rw-r--r--sway/desktop/output.c17
-rw-r--r--sway/desktop/render.c30
-rw-r--r--sway/desktop/transaction.c16
3 files changed, 38 insertions, 25 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index ed9300bb..2b90f151 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -39,6 +39,19 @@ struct sway_output *output_by_name(const char *name) {
return NULL;
}
+struct sway_output *output_by_identifier(const char *identifier) {
+ for (int i = 0; i < root->outputs->length; ++i) {
+ struct sway_output *output = root->outputs->items[i];
+ char output_identifier[128];
+ snprintf(output_identifier, sizeof(output_identifier), "%s %s %s", output->wlr_output->make,
+ output->wlr_output->model, output->wlr_output->serial);
+ if (strcasecmp(output_identifier, identifier) == 0) {
+ return output;
+ }
+ }
+ return NULL;
+}
+
/**
* Rotate a child's position relative to a parent. The parent size is (pw, ph),
* the child position is (*sx, *sy) and its size is (sw, sh).
@@ -519,9 +532,7 @@ static void handle_transform(struct wl_listener *listener, void *data) {
static void update_textures(struct sway_container *con, void *data) {
container_update_title_textures(con);
- if (con->view) {
- view_update_marks_textures(con->view);
- }
+ container_update_marks_textures(con);
}
static void handle_scale(struct wl_listener *listener, void *data) {
diff --git a/sway/desktop/render.c b/sway/desktop/render.c
index 1a72f752..cf6da682 100644
--- a/sway/desktop/render.c
+++ b/sway/desktop/render.c
@@ -625,19 +625,19 @@ static void render_containers_linear(struct sway_output *output,
if (view_is_urgent(view)) {
colors = &config->border_colors.urgent;
title_texture = child->title_urgent;
- marks_texture = view->marks_urgent;
+ marks_texture = child->marks_urgent;
} else if (state->focused || parent->focused) {
colors = &config->border_colors.focused;
title_texture = child->title_focused;
- marks_texture = view->marks_focused;
+ marks_texture = child->marks_focused;
} else if (child == parent->active_child) {
colors = &config->border_colors.focused_inactive;
title_texture = child->title_focused_inactive;
- marks_texture = view->marks_focused_inactive;
+ marks_texture = child->marks_focused_inactive;
} else {
colors = &config->border_colors.unfocused;
title_texture = child->title_unfocused;
- marks_texture = view->marks_unfocused;
+ marks_texture = child->marks_unfocused;
}
if (state->border == B_NORMAL) {
@@ -681,19 +681,19 @@ static void render_containers_tabbed(struct sway_output *output,
if (urgent) {
colors = &config->border_colors.urgent;
title_texture = child->title_urgent;
- marks_texture = view ? view->marks_urgent : NULL;
+ marks_texture = child->marks_urgent;
} else if (cstate->focused || parent->focused) {
colors = &config->border_colors.focused;
title_texture = child->title_focused;
- marks_texture = view ? view->marks_focused : NULL;
+ marks_texture = child->marks_focused;
} else if (child == parent->active_child) {
colors = &config->border_colors.focused_inactive;
title_texture = child->title_focused_inactive;
- marks_texture = view ? view->marks_focused_inactive : NULL;
+ marks_texture = child->marks_focused_inactive;
} else {
colors = &config->border_colors.unfocused;
title_texture = child->title_unfocused;
- marks_texture = view ? view->marks_unfocused : NULL;
+ marks_texture = child->marks_unfocused;
}
int x = cstate->con_x + tab_width * i;
@@ -746,19 +746,19 @@ static void render_containers_stacked(struct sway_output *output,
if (urgent) {
colors = &config->border_colors.urgent;
title_texture = child->title_urgent;
- marks_texture = view ? view->marks_urgent : NULL;
+ marks_texture = child->marks_urgent;
} else if (cstate->focused || parent->focused) {
colors = &config->border_colors.focused;
title_texture = child->title_focused;
- marks_texture = view ? view->marks_focused : NULL;
+ marks_texture = child->marks_focused;
} else if (child == parent->active_child) {
colors = &config->border_colors.focused_inactive;
title_texture = child->title_focused_inactive;
- marks_texture = view ? view->marks_focused_inactive : NULL;
+ marks_texture = child->marks_focused_inactive;
} else {
colors = &config->border_colors.unfocused;
title_texture = child->title_unfocused;
- marks_texture = view ? view->marks_unfocused : NULL;
+ marks_texture = child->marks_unfocused;
}
int y = parent->box.y + titlebar_height * i;
@@ -841,15 +841,15 @@ static void render_floating_container(struct sway_output *soutput,
if (view_is_urgent(view)) {
colors = &config->border_colors.urgent;
title_texture = con->title_urgent;
- marks_texture = view->marks_urgent;
+ marks_texture = con->marks_urgent;
} else if (con->current.focused) {
colors = &config->border_colors.focused;
title_texture = con->title_focused;
- marks_texture = view->marks_focused;
+ marks_texture = con->marks_focused;
} else {
colors = &config->border_colors.unfocused;
title_texture = con->title_unfocused;
- marks_texture = view->marks_unfocused;
+ marks_texture = con->marks_unfocused;
}
if (con->current.border == B_NORMAL) {
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c
index 955b05d6..44156d41 100644
--- a/sway/desktop/transaction.c
+++ b/sway/desktop/transaction.c
@@ -137,6 +137,12 @@ static void copy_container_state(struct sway_container *container,
state->is_fullscreen = container->is_fullscreen;
state->parent = container->parent;
state->workspace = container->workspace;
+ state->border = container->border;
+ state->border_thickness = container->border_thickness;
+ state->border_top = container->border_top;
+ state->border_left = container->border_left;
+ state->border_right = container->border_right;
+ state->border_bottom = container->border_bottom;
if (container->view) {
struct sway_view *view = container->view;
@@ -144,12 +150,6 @@ static void copy_container_state(struct sway_container *container,
state->view_y = view->y;
state->view_width = view->width;
state->view_height = view->height;
- state->border = view->border;
- state->border_thickness = view->border_thickness;
- state->border_top = view->border_top;
- state->border_left = view->border_left;
- state->border_right = view->border_right;
- state->border_bottom = view->border_bottom;
} else {
state->children = create_list();
list_cat(state->children, container->children);
@@ -301,7 +301,9 @@ static void transaction_apply(struct sway_transaction *transaction) {
if (root->outputs->length) {
struct sway_seat *seat;
wl_list_for_each(seat, &server.input->seats, link) {
- cursor_rebase(seat->cursor);
+ if (seat->operation == OP_NONE) {
+ cursor_rebase(seat->cursor);
+ }
}
}
}