mirror of
https://github.com/swaywm/sway.git
synced 2024-11-14 22:43:58 +01:00
Compare commits
1 Commits
dd224b36f3
...
e10a24677c
Author | SHA1 | Date | |
---|---|---|---|
|
e10a24677c |
@ -1,5 +1,7 @@
|
|||||||
# sway
|
# sway
|
||||||
|
|
||||||
|
[English][en] - [عربي][ar] - **[Česky][cs]** - [Deutsch][de] - [Dansk][dk] - [Español][es] - [Français][fr] - [ქართული][ge] - [Ελληνικά][gr] - [हिन्दी][hi] - [Magyar][hu] - [فارسی][ir] - [Italiano][it] - [日本語][ja] - [한국어][ko] - [Nederlands][nl] - [Norsk][no] - [Polski][pl] - [Português][pt] - [Română][ro] - [Русский][ru] - [Svenska][sv] - [Türkçe][tr] - [Українська][uk] - [中文-简体][zh-CN] - [中文-繁體][zh-TW]
|
||||||
|
|
||||||
sway je s [i3] kompatibilní [Wayland] kompozitor. Přečtěte si [FAQ]. Připojte se na
|
sway je s [i3] kompatibilní [Wayland] kompozitor. Přečtěte si [FAQ]. Připojte se na
|
||||||
[IRC kanál][IRC channel] \(#sway na irc.libera.chat).
|
[IRC kanál][IRC channel] \(#sway na irc.libera.chat).
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# sway
|
# sway
|
||||||
|
|
||||||
|
[English][en] - [Deutsch][de] - [Dansk][dk] - [Español][es] - [Français][fr] - **[Svenska][sv]** - [Ελληνικά][gr] - [Magyar][hu] - [فارسی][ir] - [Italiano][it] - [日本語][ja] - [한국어][ko] - [Nederlands][nl] - [Polski][pl] - [Português][pt] - [Română][ro] - [Русский][ru] - [Türkçe][tr] - [Українська][uk] - [中文-简体][zh-CN] - [中文-繁體][zh-TW]
|
||||||
|
|
||||||
sway är en [i3]-kompatibel [Wayland] compositor. Läs våran [FAQ]-sida. Gå med i vår
|
sway är en [i3]-kompatibel [Wayland] compositor. Läs våran [FAQ]-sida. Gå med i vår
|
||||||
[IRC-kanal] \(#sway på irc.libera.chat).
|
[IRC-kanal] \(#sway på irc.libera.chat).
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh -eu
|
#!/bin/sh -eu
|
||||||
|
|
||||||
prev=$(git describe --tags --abbrev=0)
|
prev=$(git describe --tags --abbrev=0)
|
||||||
next=$(meson rewrite kwargs info project / | jq -r '.kwargs["project#/"].version')
|
next=$(meson rewrite kwargs info project / 2>&1 >/dev/null | jq -r '.kwargs["project#/"].version')
|
||||||
|
|
||||||
case "$next" in
|
case "$next" in
|
||||||
*-dev)
|
*-dev)
|
||||||
|
@ -188,8 +188,8 @@ static enum wlr_scale_filter_mode get_scale_filter(struct sway_output *output,
|
|||||||
struct wlr_scene_buffer *buffer) {
|
struct wlr_scene_buffer *buffer) {
|
||||||
// if we are scaling down, we should always choose linear
|
// if we are scaling down, we should always choose linear
|
||||||
if (buffer->dst_width > 0 && buffer->dst_height > 0 && (
|
if (buffer->dst_width > 0 && buffer->dst_height > 0 && (
|
||||||
buffer->dst_width < buffer->WLR_PRIVATE.buffer_width ||
|
buffer->dst_width < buffer->buffer_width ||
|
||||||
buffer->dst_height < buffer->WLR_PRIVATE.buffer_height)) {
|
buffer->dst_height < buffer->buffer_height)) {
|
||||||
return WLR_SCALE_FILTER_BILINEAR;
|
return WLR_SCALE_FILTER_BILINEAR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -457,47 +457,19 @@ static void handle_request_state(struct wl_listener *listener, void *data) {
|
|||||||
struct sway_output *output =
|
struct sway_output *output =
|
||||||
wl_container_of(listener, output, request_state);
|
wl_container_of(listener, output, request_state);
|
||||||
const struct wlr_output_event_request_state *event = data;
|
const struct wlr_output_event_request_state *event = data;
|
||||||
const struct wlr_output_state *state = event->state;
|
|
||||||
|
|
||||||
// Store the requested changes so that the active configuration is
|
uint32_t committed = event->state->committed;
|
||||||
// consistent with the current state, and to avoid duplicate logic to apply
|
wlr_output_commit_state(output->wlr_output, event->state);
|
||||||
// the changes.
|
|
||||||
struct output_config *oc = new_output_config(output->wlr_output->name);
|
|
||||||
if (!oc) {
|
|
||||||
sway_log(SWAY_ERROR, "Allocation failed");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int committed = state->committed;
|
if (committed & (
|
||||||
if (committed & WLR_OUTPUT_STATE_MODE) {
|
WLR_OUTPUT_STATE_MODE |
|
||||||
if (state->mode != NULL) {
|
WLR_OUTPUT_STATE_TRANSFORM |
|
||||||
oc->width = state->mode->width;
|
WLR_OUTPUT_STATE_SCALE)) {
|
||||||
oc->height = state->mode->height;
|
arrange_layers(output);
|
||||||
oc->refresh_rate = state->mode->refresh / 1000.f;
|
arrange_output(output);
|
||||||
} else {
|
transaction_commit_dirty();
|
||||||
oc->width = state->custom_mode.width;
|
|
||||||
oc->height = state->custom_mode.height;
|
|
||||||
oc->refresh_rate = state->custom_mode.refresh / 1000.f;
|
|
||||||
}
|
|
||||||
committed &= ~WLR_OUTPUT_STATE_MODE;
|
|
||||||
}
|
|
||||||
if (committed & WLR_OUTPUT_STATE_SCALE) {
|
|
||||||
oc->scale = state->scale;
|
|
||||||
committed &= ~WLR_OUTPUT_STATE_SCALE;
|
|
||||||
}
|
|
||||||
if (committed & WLR_OUTPUT_STATE_TRANSFORM) {
|
|
||||||
oc->transform = state->transform;
|
|
||||||
committed &= ~WLR_OUTPUT_STATE_TRANSFORM;
|
|
||||||
}
|
|
||||||
|
|
||||||
// We do not expect or support any other changes here
|
update_output_manager_config(output->server);
|
||||||
assert(committed == 0);
|
|
||||||
store_output_config(oc);
|
|
||||||
apply_stored_output_configs();
|
|
||||||
|
|
||||||
if (server.delayed_modeset != NULL) {
|
|
||||||
wl_event_source_remove(server.delayed_modeset);
|
|
||||||
server.delayed_modeset = NULL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -582,10 +554,6 @@ void handle_new_output(struct wl_listener *listener, void *data) {
|
|||||||
static struct output_config *output_config_for_config_head(
|
static struct output_config *output_config_for_config_head(
|
||||||
struct wlr_output_configuration_head_v1 *config_head) {
|
struct wlr_output_configuration_head_v1 *config_head) {
|
||||||
struct output_config *oc = new_output_config(config_head->state.output->name);
|
struct output_config *oc = new_output_config(config_head->state.output->name);
|
||||||
if (!oc) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
oc->enabled = config_head->state.enabled;
|
oc->enabled = config_head->state.enabled;
|
||||||
if (!oc->enabled) {
|
if (!oc->enabled) {
|
||||||
return oc;
|
return oc;
|
||||||
@ -616,8 +584,7 @@ static void output_manager_apply(struct sway_server *server,
|
|||||||
size_t configs_len = config->output_configs->length + wl_list_length(&cfg->heads);
|
size_t configs_len = config->output_configs->length + wl_list_length(&cfg->heads);
|
||||||
struct output_config **configs = calloc(configs_len, sizeof(*configs));
|
struct output_config **configs = calloc(configs_len, sizeof(*configs));
|
||||||
if (!configs) {
|
if (!configs) {
|
||||||
sway_log(SWAY_ERROR, "Allocation failed");
|
goto done;
|
||||||
goto error;
|
|
||||||
}
|
}
|
||||||
size_t start_new_configs = config->output_configs->length;
|
size_t start_new_configs = config->output_configs->length;
|
||||||
for (size_t idx = 0; idx < start_new_configs; idx++) {
|
for (size_t idx = 0; idx < start_new_configs; idx++) {
|
||||||
@ -630,10 +597,6 @@ static void output_manager_apply(struct sway_server *server,
|
|||||||
// Generate the configuration and store it as a temporary
|
// Generate the configuration and store it as a temporary
|
||||||
// config. We keep a record of it so we can remove it later.
|
// config. We keep a record of it so we can remove it later.
|
||||||
struct output_config *oc = output_config_for_config_head(config_head);
|
struct output_config *oc = output_config_for_config_head(config_head);
|
||||||
if (!oc) {
|
|
||||||
sway_log(SWAY_ERROR, "Allocation failed");
|
|
||||||
goto error_config;
|
|
||||||
}
|
|
||||||
configs[config_idx++] = oc;
|
configs[config_idx++] = oc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -641,8 +604,6 @@ static void output_manager_apply(struct sway_server *server,
|
|||||||
// if any output configured for enablement fails to be enabled, even if it
|
// if any output configured for enablement fails to be enabled, even if it
|
||||||
// was not part of the config heads we were asked to configure.
|
// was not part of the config heads we were asked to configure.
|
||||||
ok = apply_output_configs(configs, configs_len, test_only, false);
|
ok = apply_output_configs(configs, configs_len, test_only, false);
|
||||||
|
|
||||||
error_config:
|
|
||||||
for (size_t idx = start_new_configs; idx < configs_len; idx++) {
|
for (size_t idx = start_new_configs; idx < configs_len; idx++) {
|
||||||
struct output_config *cfg = configs[idx];
|
struct output_config *cfg = configs[idx];
|
||||||
if (!test_only && ok) {
|
if (!test_only && ok) {
|
||||||
@ -653,7 +614,7 @@ error_config:
|
|||||||
}
|
}
|
||||||
free(configs);
|
free(configs);
|
||||||
|
|
||||||
error:
|
done:
|
||||||
if (ok) {
|
if (ok) {
|
||||||
wlr_output_configuration_v1_send_succeeded(cfg);
|
wlr_output_configuration_v1_send_succeeded(cfg);
|
||||||
if (server->delayed_modeset != NULL) {
|
if (server->delayed_modeset != NULL) {
|
||||||
@ -688,11 +649,6 @@ void handle_output_power_manager_set_mode(struct wl_listener *listener,
|
|||||||
struct sway_output *output = event->output->data;
|
struct sway_output *output = event->output->data;
|
||||||
|
|
||||||
struct output_config *oc = new_output_config(output->wlr_output->name);
|
struct output_config *oc = new_output_config(output->wlr_output->name);
|
||||||
if (!oc) {
|
|
||||||
sway_log(SWAY_ERROR, "Allocation failed");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (event->mode) {
|
switch (event->mode) {
|
||||||
case ZWLR_OUTPUT_POWER_V1_MODE_OFF:
|
case ZWLR_OUTPUT_POWER_V1_MODE_OFF:
|
||||||
oc->power = 0;
|
oc->power = 0;
|
||||||
|
@ -70,7 +70,6 @@
|
|||||||
#define SWAY_XDG_SHELL_VERSION 5
|
#define SWAY_XDG_SHELL_VERSION 5
|
||||||
#define SWAY_LAYER_SHELL_VERSION 4
|
#define SWAY_LAYER_SHELL_VERSION 4
|
||||||
#define SWAY_FOREIGN_TOPLEVEL_LIST_VERSION 1
|
#define SWAY_FOREIGN_TOPLEVEL_LIST_VERSION 1
|
||||||
#define SWAY_PRESENTATION_VERSION 2
|
|
||||||
|
|
||||||
bool allow_unsupported_gpu = false;
|
bool allow_unsupported_gpu = false;
|
||||||
|
|
||||||
@ -328,7 +327,7 @@ bool server_init(struct sway_server *server) {
|
|||||||
wl_signal_add(&server->pointer_constraints->events.new_constraint,
|
wl_signal_add(&server->pointer_constraints->events.new_constraint,
|
||||||
&server->pointer_constraint);
|
&server->pointer_constraint);
|
||||||
|
|
||||||
wlr_presentation_create(server->wl_display, server->backend, SWAY_PRESENTATION_VERSION);
|
wlr_presentation_create(server->wl_display, server->backend);
|
||||||
wlr_alpha_modifier_v1_create(server->wl_display);
|
wlr_alpha_modifier_v1_create(server->wl_display);
|
||||||
|
|
||||||
server->output_manager_v1 =
|
server->output_manager_v1 =
|
||||||
|
@ -349,7 +349,7 @@ void container_arrange_title_bar(struct sway_container *con) {
|
|||||||
h_padding = width - config->titlebar_h_padding - marks_buffer_width;
|
h_padding = width - config->titlebar_h_padding - marks_buffer_width;
|
||||||
}
|
}
|
||||||
|
|
||||||
h_padding = MAX(h_padding, config->titlebar_h_padding);
|
h_padding = MAX(h_padding, 0);
|
||||||
|
|
||||||
int alloc_width = MIN((int)node->width,
|
int alloc_width = MIN((int)node->width,
|
||||||
width - h_padding - config->titlebar_h_padding);
|
width - h_padding - config->titlebar_h_padding);
|
||||||
@ -375,7 +375,7 @@ void container_arrange_title_bar(struct sway_container *con) {
|
|||||||
h_padding = config->titlebar_h_padding;
|
h_padding = config->titlebar_h_padding;
|
||||||
}
|
}
|
||||||
|
|
||||||
h_padding = MAX(h_padding, config->titlebar_h_padding);
|
h_padding = MAX(h_padding, 0);
|
||||||
|
|
||||||
int alloc_width = MIN((int) node->width,
|
int alloc_width = MIN((int) node->width,
|
||||||
width - h_padding - config->titlebar_h_padding);
|
width - h_padding - config->titlebar_h_padding);
|
||||||
|
Loading…
Reference in New Issue
Block a user