mirror of
https://github.com/swaywm/sway.git
synced 2026-05-03 06:46:26 -04:00
fix merge conflict after rebasing for wlr_renderer_scissor
This commit is contained in:
parent
c7b3f9854f
commit
505e34b6ef
4 changed files with 11 additions and 20 deletions
|
|
@ -11,13 +11,11 @@ struct cmd_results *cmd_default_orientation(int argc, char **argv) {
|
||||||
config->default_orientation = L_HORIZ;
|
config->default_orientation = L_HORIZ;
|
||||||
} else if (strcasecmp(argv[0], "vertical") == 0) {
|
} else if (strcasecmp(argv[0], "vertical") == 0) {
|
||||||
config->default_orientation = L_VERT;
|
config->default_orientation = L_VERT;
|
||||||
} else if (strcasecmp(argv[0], "tabbed") == 0) {
|
|
||||||
config->default_orientation = L_TABBED;
|
|
||||||
} else if (strcasecmp(argv[0], "auto") == 0) {
|
} else if (strcasecmp(argv[0], "auto") == 0) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
} else {
|
} else {
|
||||||
return cmd_results_new(CMD_INVALID, "default_orientation",
|
return cmd_results_new(CMD_INVALID, "default_orientation",
|
||||||
"Expected 'orientation <horizontal|vertical|tabbed|auto>'");
|
"Expected 'orientation <horizontal|vertical|auto>'");
|
||||||
}
|
}
|
||||||
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
|
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,7 @@ struct cmd_results *cmd_layout(int argc, char **argv) {
|
||||||
parent = parent->parent;
|
parent = parent->parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: stacks and tabs
|
// TODO: stacks
|
||||||
|
|
||||||
|
|
||||||
if (strcasecmp(argv[0], "default") == 0) {
|
if (strcasecmp(argv[0], "default") == 0) {
|
||||||
parent->layout = parent->prev_layout;
|
parent->layout = parent->prev_layout;
|
||||||
|
|
@ -36,14 +35,12 @@ struct cmd_results *cmd_layout(int argc, char **argv) {
|
||||||
parent->prev_layout = parent->layout;
|
parent->prev_layout = parent->layout;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcasecmp(argv[0], "tabbed") == 0) {
|
|
||||||
parent->layout = L_TABBED;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strcasecmp(argv[0], "splith") == 0) {
|
if (strcasecmp(argv[0], "splith") == 0) {
|
||||||
parent->layout = L_HORIZ;
|
parent->layout = L_HORIZ;
|
||||||
} else if (strcasecmp(argv[0], "splitv") == 0) {
|
} else if (strcasecmp(argv[0], "splitv") == 0) {
|
||||||
parent->layout = L_VERT;
|
parent->layout = L_VERT;
|
||||||
|
} else if (strcasecmp(argv[0], "tabbed") == 0) {
|
||||||
|
parent->layout = L_TABBED;
|
||||||
} else if (strcasecmp(argv[0], "toggle") == 0 && argc == 2 && strcasecmp(argv[1], "split") == 0) {
|
} else if (strcasecmp(argv[0], "toggle") == 0 && argc == 2 && strcasecmp(argv[1], "split") == 0) {
|
||||||
if (parent->layout == L_HORIZ) {
|
if (parent->layout == L_HORIZ) {
|
||||||
parent->layout = L_VERT;
|
parent->layout = L_VERT;
|
||||||
|
|
|
||||||
|
|
@ -228,19 +228,16 @@ static void render_view(struct sway_view *view, struct sway_output *output) {
|
||||||
*/
|
*/
|
||||||
static void render_container_simple_border_normal(struct sway_output *output,
|
static void render_container_simple_border_normal(struct sway_output *output,
|
||||||
struct sway_container *con, struct border_colors *colors,
|
struct sway_container *con, struct border_colors *colors,
|
||||||
struct wlr_texture *title_texture, int iteration) {
|
struct wlr_texture *title_texture, int depth) {
|
||||||
struct wlr_renderer *renderer =
|
struct wlr_renderer *renderer =
|
||||||
wlr_backend_get_renderer(output->wlr_output->backend);
|
wlr_backend_get_renderer(output->wlr_output->backend);
|
||||||
struct wlr_box box;
|
struct wlr_box box;
|
||||||
float color[4];
|
float color[4];
|
||||||
size_t num_tabs;
|
size_t num_tabs = 1;
|
||||||
|
|
||||||
if (con->parent->layout == L_TABBED) {
|
if (con->parent->layout == L_TABBED) {
|
||||||
num_tabs = con->parent->children->length;
|
num_tabs = con->parent->children->length;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
num_tabs = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Child border - left edge
|
// Child border - left edge
|
||||||
memcpy(&color, colors->child_border, sizeof(float) * 4);
|
memcpy(&color, colors->child_border, sizeof(float) * 4);
|
||||||
|
|
@ -286,7 +283,7 @@ static void render_container_simple_border_normal(struct sway_output *output,
|
||||||
// Single pixel bar above title
|
// Single pixel bar above title
|
||||||
memcpy(&color, colors->border, sizeof(float) * 4);
|
memcpy(&color, colors->border, sizeof(float) * 4);
|
||||||
color[3] *= con->alpha;
|
color[3] *= con->alpha;
|
||||||
box.x = con->x + iteration * (con->width / num_tabs);
|
box.x = con->x + depth * (con->width / num_tabs);
|
||||||
box.y = con->y;
|
box.y = con->y;
|
||||||
box.width = con->width / num_tabs;
|
box.width = con->width / num_tabs;
|
||||||
box.height = 1;
|
box.height = 1;
|
||||||
|
|
@ -295,7 +292,7 @@ static void render_container_simple_border_normal(struct sway_output *output,
|
||||||
output->wlr_output->transform_matrix);
|
output->wlr_output->transform_matrix);
|
||||||
|
|
||||||
// Single pixel bar below title
|
// Single pixel bar below title
|
||||||
box.x = con->x + iteration * (con->width / num_tabs);
|
box.x = con->x + depth * (con->width / num_tabs);
|
||||||
box.y = con->sway_view->y - 1;
|
box.y = con->sway_view->y - 1;
|
||||||
box.width = con->width / num_tabs;
|
box.width = con->width / num_tabs;
|
||||||
box.height = 1;
|
box.height = 1;
|
||||||
|
|
@ -306,7 +303,7 @@ static void render_container_simple_border_normal(struct sway_output *output,
|
||||||
// Title background
|
// Title background
|
||||||
memcpy(&color, colors->background, sizeof(float) * 4);
|
memcpy(&color, colors->background, sizeof(float) * 4);
|
||||||
color[3] *= con->alpha;
|
color[3] *= con->alpha;
|
||||||
box.x = con->x + iteration * (con->width / num_tabs);
|
box.x = con->x + depth * (con->width / num_tabs);
|
||||||
box.y = con->y + 1;
|
box.y = con->y + 1;
|
||||||
box.width = con->width / num_tabs;
|
box.width = con->width / num_tabs;
|
||||||
box.height = con->sway_view->y - con->y - 2;
|
box.height = con->sway_view->y - con->y - 2;
|
||||||
|
|
@ -476,8 +473,7 @@ static void render_container_tabbed(struct sway_output *output,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
render_container(output, child);
|
render_container(output, child);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ static void apply_tabbed_layout(struct sway_container *parent) {
|
||||||
if (!num_children) {
|
if (!num_children) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (size_t i=0; i < num_children; ++i) {
|
for (size_t i = 0; i < num_children; ++i) {
|
||||||
struct sway_container *child = parent->children->items[i];
|
struct sway_container *child = parent->children->items[i];
|
||||||
child->x = parent->x;
|
child->x = parent->x;
|
||||||
child->y = parent->y;
|
child->y = parent->y;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue