aboutsummaryrefslogtreecommitdiff
path: root/sway/tree
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree')
-rw-r--r--sway/tree/container.c8
-rw-r--r--sway/tree/root.c6
-rw-r--r--sway/tree/view.c19
-rw-r--r--sway/tree/workspace.c10
4 files changed, 14 insertions, 29 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index b8af7564..53b127b7 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -463,11 +463,17 @@ static void update_title_texture(struct sway_container *con,
cairo_surface_t *surface = cairo_image_surface_create(
CAIRO_FORMAT_ARGB32, width, height);
cairo_t *cairo = cairo_create(surface);
+ cairo_set_antialias(cairo, CAIRO_ANTIALIAS_BEST);
+ cairo_font_options_t *fo = cairo_font_options_create();
+ cairo_font_options_set_hint_style(fo, CAIRO_HINT_STYLE_FULL);
+ cairo_font_options_set_antialias(fo, CAIRO_ANTIALIAS_SUBPIXEL);
+ cairo_font_options_set_subpixel_order(fo, to_cairo_subpixel_order(output->wlr_output->subpixel));
+ cairo_set_font_options(cairo, fo);
+ cairo_font_options_destroy(fo);
cairo_set_source_rgba(cairo, class->background[0], class->background[1],
class->background[2], class->background[3]);
cairo_paint(cairo);
PangoContext *pango = pango_cairo_create_context(cairo);
- cairo_set_antialias(cairo, CAIRO_ANTIALIAS_BEST);
cairo_set_source_rgba(cairo, class->text[0], class->text[1],
class->text[2], class->text[3]);
cairo_move_to(cairo, 0, 0);
diff --git a/sway/tree/root.c b/sway/tree/root.c
index ecc04ddb..d6f67bd7 100644
--- a/sway/tree/root.c
+++ b/sway/tree/root.c
@@ -265,10 +265,10 @@ void root_for_each_container(void (*f)(struct sway_container *con, void *data),
// Scratchpad
for (int i = 0; i < root->scratchpad->length; ++i) {
struct sway_container *container = root->scratchpad->items[i];
- // If the container has a parent then it's visible on a workspace
+ // If the container has a workspace then it's visible on a workspace
// and will have been iterated in the previous for loop. So we only
// iterate the hidden scratchpad containers here.
- if (!container->parent) {
+ if (!container->workspace) {
f(container, data);
container_for_each_child(container, f, data);
}
@@ -311,7 +311,7 @@ struct sway_container *root_find_container(
// Scratchpad
for (int i = 0; i < root->scratchpad->length; ++i) {
struct sway_container *container = root->scratchpad->items[i];
- if (!container->parent) {
+ if (!container->workspace) {
if (test(container, data)) {
return container;
}
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 4398f518..e370443c 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -391,8 +391,6 @@ static bool view_has_executed_criteria(struct sway_view *view,
}
void view_execute_criteria(struct sway_view *view) {
- struct sway_seat *seat = input_manager_current_seat(input_manager);
- struct sway_node *prior_focus = seat_get_focus(seat);
list_t *criterias = criteria_for_view(view, CT_COMMAND);
for (int i = 0; i < criterias->length; i++) {
struct criteria *criteria = criterias->items[i];
@@ -403,16 +401,12 @@ void view_execute_criteria(struct sway_view *view) {
}
wlr_log(WLR_DEBUG, "for_window '%s' matches view %p, cmd: '%s'",
criteria->raw, view, criteria->cmdlist);
- seat_set_focus_container(seat, view->container);
list_add(view->executed_criteria, criteria);
- struct cmd_results *res = execute_command(criteria->cmdlist, NULL);
- if (res->status != CMD_SUCCESS) {
- wlr_log(WLR_ERROR, "Command '%s' failed: %s", res->input, res->error);
- }
+ struct cmd_results *res = execute_command(
+ criteria->cmdlist, NULL, view->container);
free_cmd_results(res);
}
list_free(criterias);
- seat_set_focus(seat, prior_focus);
}
static struct sway_workspace *select_workspace(struct sway_view *view) {
@@ -785,14 +779,9 @@ static size_t parse_title_format(struct sway_view *view, char *buffer) {
}
static char *escape_title(char *buffer) {
- int length = escape_markup_text(buffer, NULL, 0);
+ size_t length = escape_markup_text(buffer, NULL);
char *escaped_title = calloc(length + 1, sizeof(char));
- int result = escape_markup_text(buffer, escaped_title, length);
- if (result != length) {
- wlr_log(WLR_ERROR, "Could not escape title: %s", buffer);
- free(escaped_title);
- return buffer;
- }
+ escape_markup_text(buffer, escaped_title);
free(buffer);
return escaped_title;
}
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c
index 18746430..b0c440c1 100644
--- a/sway/tree/workspace.c
+++ b/sway/tree/workspace.c
@@ -389,13 +389,11 @@ bool workspace_switch(struct sway_workspace *workspace,
struct sway_output *next_output = workspace->output;
struct sway_workspace *next_output_prev_ws =
output_get_active_workspace(next_output);
- bool has_sticky = false;
if (workspace != next_output_prev_ws) {
for (int i = 0; i < next_output_prev_ws->floating->length; ++i) {
struct sway_container *floater =
next_output_prev_ws->floating->items[i];
if (floater->is_sticky) {
- has_sticky = true;
container_detach(floater);
workspace_add_floating(workspace, floater);
if (&floater->node == focus) {
@@ -414,14 +412,6 @@ bool workspace_switch(struct sway_workspace *workspace,
if (next == NULL) {
next = &workspace->node;
}
- if (has_sticky) {
- // If there's a sticky container, we might be setting focus to the same
- // container that's already focused, so seat_set_focus is effectively a
- // no op. We therefore need to send the IPC event and clean up the old
- // workspace here.
- ipc_event_workspace(active_ws, workspace, "focus");
- workspace_consider_destroy(active_ws);
- }
seat_set_focus(seat, next);
arrange_workspace(workspace);
cursor_send_pointer_motion(seat->cursor, 0, true);