sway 1.5.1

This is a bugfix release which adds support for wlroots 0.12.0.
 
 Simon Ser (2):
       build: bump wlroots dependency to 0.12.0
       build: bump version to 1.5.1
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEENP+VJs/vDpejQOLkD9574OiPXkgFAl+qxYUACgkQD9574OiP
 Xki2BBAAusN/5OJQfNQZ5UWVDff4ZRcp5Lty8xgloLtSFm8Rn2FRhaJjP1p+dsiw
 2NBmoixnds/ziRMpyR/82HxQBpHXE/Zm73lamvQ695QwyFU1EcCaicMZrHAEl5op
 b+ZySCH1zEEyZU5ltN1buVerkG0QM70aFjTau6h7BAfbVPJymTmSvXssIhdGt6Mb
 RdHtxoDn++D4UmHDkt7+YznHnOskyw8SKHcbW2oVpf65a0NKyDhUnFV2mLCX89+u
 zDC+3IDw+FV+Bu8bZHOxfgs1lkbnxD1DGCKf3v/n8BOvOxykygbS3ZMN2g907jmN
 TDXpIOevL3b5OqDs3kMQayIPxCVpt9Iqqlkg6K99b2d4SgmjzNuHMFOp81u+nIre
 U/RwO20U94fYWA2yut1MrtlMm0b12OTNoQYxQJZCzrIJuStmJ6rqonoJEFdfj7g6
 wR3SdVkGEaBGzDjZTZVFibgt67TiSQc0RMaGEK5zi1wFnmKLR/O4cZvI1fOXUr5V
 aVEuhlTeHjcUJTPKmFYiKxcz71260pyvy2VRIYcs3cke+086p5ZLMIgVZ7uEDm7x
 40CH5i40Lb0J/acruMgEzZF6U0AmJyJmy37NF914v8Zc4uzjX8LX9J4GIZ93bcZd
 PUvD/KfNOJi8eS7SMimjSbwo1yT7nTkCwXOXpqGNRdlhCM2XFFY=
 =e4ID
 -----END PGP SIGNATURE-----

Merge tag '1.5.1' into color-profiles

sway 1.5.1

This is a bugfix release which adds support for wlroots 0.12.0.

Simon Ser (2):
      build: bump wlroots dependency to 0.12.0
      build: bump version to 1.5.1
This commit is contained in:
Devin Bayer 2021-01-21 17:08:25 +01:00
commit 8a7f4d5333
10 changed files with 84 additions and 56 deletions

View file

@ -37,8 +37,7 @@ output * bg @datadir@/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
#
# exec swayidle -w \
# timeout 300 'swaylock -f -c 000000' \
# timeout 600 'swaymsg "output * dpms off"' \
# resume 'swaymsg "output * dpms on"' \
# timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
# before-sleep 'swaylock -f -c 000000'
#
# This will lock your screen after 300 seconds of inactivity, then turn off
@ -112,27 +111,27 @@ output * bg @datadir@/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
# Workspaces:
#
# Switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10
# Move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10
bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
bindsym $mod+Shift+4 move container to workspace number 4
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
#

View file

@ -111,6 +111,10 @@ if [ "$ACTION" = "check" ] ; then
exit
elif [ "$SUBJECT" = "area" ] ; then
GEOM=$(slurp -d)
# Check if user exited slurp without selecting the area
if [ -z "$GEOM" ]; then
exit
fi
WHAT="Area"
elif [ "$SUBJECT" = "active" ] ; then
FOCUSED=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]?, .floating_nodes[]?) | select(.focused)')
@ -126,6 +130,10 @@ elif [ "$SUBJECT" = "output" ] ; then
WHAT="$OUTPUT"
elif [ "$SUBJECT" = "window" ] ; then
GEOM=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp)
# Check if user exited slurp without selecting the area
if [ -z "$GEOM" ]; then
exit
fi
WHAT="Window"
else
die "Unknown subject to take a screen shot from" "$SUBJECT"

View file

@ -37,7 +37,7 @@ struct sway_output {
// last applied mode when the output is DPMS'ed
struct wlr_output_mode *current_mode;
bool enabled, configured;
bool enabling, enabled;
list_t *workspaces;
struct sway_output_state current;
@ -99,7 +99,7 @@ struct sway_output *all_output_by_name_or_id(const char *name_or_id);
void output_sort_workspaces(struct sway_output *output);
void output_configure(struct sway_output *output);
void output_enable(struct sway_output *output);
void output_disable(struct sway_output *output);

View file

@ -1,7 +1,7 @@
project(
'sway',
'c',
version: 'v1.5-rc2', #release_version
version: '1.5.1', #release_version
license: 'MIT',
meson_version: '>=0.53.0',
default_options: [
@ -60,7 +60,7 @@ math = cc.find_library('m')
rt = cc.find_library('rt')
# Try first to find wlroots as a subproject, then as a system dependency
wlroots_version = ['>=0.10.0', '<0.11.0']
wlroots_version = ['>=0.12.0', '<0.13.0']
wlroots_proj = subproject(
'wlroots',
default_options: ['examples=false'],

View file

@ -401,17 +401,8 @@ bool apply_output_config(struct output_config *oc, struct sway_output *output) {
struct wlr_output *wlr_output = output->wlr_output;
bool was_enabled = output->enabled;
if (oc && !oc->enabled) {
// Output is configured to be disabled
sway_log(SWAY_DEBUG, "Disabling output %s", oc->name);
if (output->enabled) {
output_disable(output);
wlr_output_layout_remove(root->output_layout, wlr_output);
}
} else {
output->enabled = true;
}
// Flag to prevent the output mode event handler from calling us
output->enabling = (!oc || oc->enabled);
queue_output_config(oc, output);
@ -425,11 +416,18 @@ bool apply_output_config(struct output_config *oc, struct sway_output *output) {
// Leave the output disabled for now and try again when the output gets
// the mode we asked for.
sway_log(SWAY_ERROR, "Failed to commit output %s", wlr_output->name);
output->enabled = was_enabled;
output->enabling = false;
return false;
}
output->enabling = false;
if (oc && !oc->enabled) {
sway_log(SWAY_DEBUG, "Disabling output %s", oc->name);
if (output->enabled) {
output_disable(output);
wlr_output_layout_remove(root->output_layout, wlr_output);
}
return true;
}
@ -472,8 +470,8 @@ bool apply_output_config(struct output_config *oc, struct sway_output *output) {
output->width = output_box->width;
output->height = output_box->height;
if (!output->configured) {
output_configure(output);
if (!output->enabled) {
output_enable(output);
}
if (oc && oc->max_render_time >= 0) {

View file

@ -844,7 +844,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
static void handle_mode(struct wl_listener *listener, void *data) {
struct sway_output *output = wl_container_of(listener, output, mode);
if (!output->configured && !output->enabled) {
if (!output->enabled && !output->enabling) {
struct output_config *oc = find_output_config(output);
if (output->wlr_output->current_mode != NULL &&
(!oc || oc->enabled)) {
@ -857,7 +857,7 @@ static void handle_mode(struct wl_listener *listener, void *data) {
}
return;
}
if (!output->enabled || !output->configured) {
if (!output->enabled) {
return;
}
arrange_layers(output);
@ -869,7 +869,7 @@ static void handle_mode(struct wl_listener *listener, void *data) {
static void handle_transform(struct wl_listener *listener, void *data) {
struct sway_output *output = wl_container_of(listener, output, transform);
if (!output->enabled || !output->configured) {
if (!output->enabled) {
return;
}
arrange_layers(output);
@ -886,7 +886,7 @@ static void update_textures(struct sway_container *con, void *data) {
static void handle_scale(struct wl_listener *listener, void *data) {
struct sway_output *output = wl_container_of(listener, output, scale);
if (!output->enabled || !output->configured) {
if (!output->enabled) {
return;
}
arrange_layers(output);

View file

@ -360,6 +360,11 @@ static void handle_request_fullscreen(struct wl_listener *listener, void *data)
transaction_commit_dirty();
}
static void handle_request_maximize(struct wl_listener *listener, void *data) {
struct wlr_xdg_surface *surface = data;
wlr_xdg_surface_schedule_configure(surface);
}
static void handle_request_move(struct wl_listener *listener, void *data) {
struct sway_xdg_shell_view *xdg_shell_view =
wl_container_of(listener, xdg_shell_view, request_move);
@ -402,6 +407,7 @@ static void handle_unmap(struct wl_listener *listener, void *data) {
wl_list_remove(&xdg_shell_view->commit.link);
wl_list_remove(&xdg_shell_view->new_popup.link);
wl_list_remove(&xdg_shell_view->request_fullscreen.link);
wl_list_remove(&xdg_shell_view->request_maximize.link);
wl_list_remove(&xdg_shell_view->request_move.link);
wl_list_remove(&xdg_shell_view->request_resize.link);
wl_list_remove(&xdg_shell_view->set_title.link);
@ -450,6 +456,10 @@ static void handle_map(struct wl_listener *listener, void *data) {
wl_signal_add(&xdg_surface->toplevel->events.request_fullscreen,
&xdg_shell_view->request_fullscreen);
xdg_shell_view->request_maximize.notify = handle_request_maximize;
wl_signal_add(&xdg_surface->toplevel->events.request_maximize,
&xdg_shell_view->request_maximize);
xdg_shell_view->request_move.notify = handle_request_move;
wl_signal_add(&xdg_surface->toplevel->events.request_move,
&xdg_shell_view->request_move);

View file

@ -99,8 +99,8 @@ struct sway_node *node_at_coords(
return NULL;
}
struct sway_output *output = wlr_output->data;
if (!output || !output->configured) {
// output is being destroyed or is being configured
if (!output || !output->enabled) {
// output is being destroyed or is being enabled
return NULL;
}
double ox = lx, oy = ly;
@ -1244,6 +1244,10 @@ static void warp_to_constraint_cursor_hint(struct sway_cursor *cursor) {
double ly = sy + con->content_y - view->geometry.y;
wlr_cursor_warp(cursor->cursor, NULL, lx, ly);
// Warp the pointer as well, so that on the next pointer rebase we don't
// send an unexpected synthetic motion event to clients.
wlr_seat_pointer_warp(constraint->seat, sx, sy);
}
}

View file

@ -110,12 +110,12 @@ struct sway_output *output_create(struct wlr_output *wlr_output) {
return output;
}
void output_configure(struct sway_output *output) {
if (!sway_assert(!output->configured, "output is already configured")) {
void output_enable(struct sway_output *output) {
if (!sway_assert(!output->enabled, "output is already enabled")) {
return;
}
struct wlr_output *wlr_output = output->wlr_output;
output->configured = true;
output->enabled = true;
list_add(root->outputs, output);
restore_workspaces(output);
@ -251,6 +251,11 @@ void output_disable(struct sway_output *output) {
if (!sway_assert(output->enabled, "Expected an enabled output")) {
return;
}
int index = list_find(root->outputs, output);
if (!sway_assert(index >= 0, "Output not found in root node")) {
return;
}
sway_log(SWAY_DEBUG, "Disabling output '%s'", output->wlr_output->name);
wl_signal_emit(&output->events.destroy, output);
@ -258,11 +263,9 @@ void output_disable(struct sway_output *output) {
root_for_each_container(untrack_output, output);
int index = list_find(root->outputs, output);
list_del(root->outputs, index);
output->enabled = false;
output->configured = false;
output->current_mode = NULL;
arrange_root();

View file

@ -44,12 +44,18 @@ _swaymsg_ [options...] [message]
The message is a sway command (the same commands you can bind to keybindings
in your sway config file). It will be executed immediately.
See **sway**(5) for a list of commands.
See *sway*(5) for a list of commands.
Tip: If you are proving a command that contains a leading hyphen (_-_),
insert two hyphens (_--_) before the command to signal to swaymsg not to
parse anything beyond that point as an option. For example, use
_swaymsg -- mark --add test_ instead of _swaymsg mark --add test_
Tips:
- Command expansion is performed twice: once by swaymsg, and again by sway.
If you have quoted multi-word strings in your command, enclose the entire
command in single-quotes. For example, use
_swaymsg 'output "Foobar Display" enable'_ instead of
_swaymsg output "Foobar Display" enable_.
- If you are proving a command that contains a leading hyphen (_-_), insert
two hyphens (_--_) before the command to signal to swaymsg not to parse
anything beyond that point as an option. For example, use
_swaymsg -- mark --add test_ instead of _swaymsg mark --add test_.
*get\_workspaces*
Gets a JSON-encoded list of workspaces and their status.