aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop')
-rw-r--r--sway/desktop/output.c13
-rw-r--r--sway/desktop/render.c7
-rw-r--r--sway/desktop/transaction.c4
3 files changed, 23 insertions, 1 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index ed9300bb..4d6c0336 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).
diff --git a/sway/desktop/render.c b/sway/desktop/render.c
index 1a72f752..c1fa0c8c 100644
--- a/sway/desktop/render.c
+++ b/sway/desktop/render.c
@@ -781,6 +781,13 @@ static void render_containers_stacked(struct sway_output *output,
static void render_containers(struct sway_output *output,
pixman_region32_t *damage, struct parent_data *parent) {
+ if (parent->children->length == 1) {
+ struct sway_container *child = parent->children->items[0];
+ if (child->view) {
+ render_containers_linear(output, damage, parent);
+ return;
+ }
+ }
switch (parent->layout) {
case L_NONE:
case L_HORIZ:
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c
index 955b05d6..c3efb210 100644
--- a/sway/desktop/transaction.c
+++ b/sway/desktop/transaction.c
@@ -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);
+ }
}
}
}