Remove raise_floating directive

The directive controlled whether floating views should raise to the top
when the cursor is moved over it while using focus_follows_mouse. The
default was enabled, which is undesirable. For example, if you have two
floating views where one completely covers the other, the smaller one
would be inaccessible because moving the mouse over the bigger one would
raise it above the smaller one.

There is no known use case for having raise_floating enabled, so this
patch removes the directive and implements the raise_floating disabled
behaviour instead.
This commit is contained in:
Ryan Dwyer 2018-10-20 17:51:32 +10:00
parent 75ea19c71b
commit b9b1b0e566
8 changed files with 4 additions and 42 deletions

View file

@ -126,7 +126,6 @@ sway_cmd cmd_floating_modifier;
sway_cmd cmd_floating_scroll; sway_cmd cmd_floating_scroll;
sway_cmd cmd_focus; sway_cmd cmd_focus;
sway_cmd cmd_focus_follows_mouse; sway_cmd cmd_focus_follows_mouse;
sway_cmd cmd_raise_floating;
sway_cmd cmd_focus_on_window_activation; sway_cmd cmd_focus_on_window_activation;
sway_cmd cmd_focus_wrapping; sway_cmd cmd_focus_wrapping;
sway_cmd cmd_font; sway_cmd cmd_font;

View file

@ -379,7 +379,6 @@ struct sway_config {
// Flags // Flags
bool focus_follows_mouse; bool focus_follows_mouse;
bool raise_floating;
enum mouse_warping_mode mouse_warping; enum mouse_warping_mode mouse_warping;
enum focus_wrapping_mode focus_wrapping; enum focus_wrapping_mode focus_wrapping;
bool active; bool active;

View file

@ -110,7 +110,6 @@ static struct cmd_handler handlers[] = {
{ "no_focus", cmd_no_focus }, { "no_focus", cmd_no_focus },
{ "output", cmd_output }, { "output", cmd_output },
{ "popup_during_fullscreen", cmd_popup_during_fullscreen }, { "popup_during_fullscreen", cmd_popup_during_fullscreen },
{ "raise_floating", cmd_raise_floating },
{ "seat", cmd_seat }, { "seat", cmd_seat },
{ "set", cmd_set }, { "set", cmd_set },
{ "show_marks", cmd_show_marks }, { "show_marks", cmd_show_marks },

View file

@ -1,14 +0,0 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "util.h"
struct cmd_results *cmd_raise_floating(int argc, char **argv) {
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "raise_floating", EXPECTED_EQUAL_TO, 1))) {
return error;
}
config->raise_floating =
parse_boolean(argv[0], config->raise_floating);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}

View file

@ -221,7 +221,6 @@ static void config_defaults(struct sway_config *config) {
// Flags // Flags
config->focus_follows_mouse = true; config->focus_follows_mouse = true;
config->raise_floating = true;
config->mouse_warping = WARP_OUTPUT; config->mouse_warping = WARP_OUTPUT;
config->focus_wrapping = WRAP_YES; config->focus_wrapping = WRAP_YES;
config->validating = false; config->validating = false;

View file

@ -756,11 +756,6 @@ void seat_set_focus(struct sway_seat *seat, struct sway_node *node) {
} }
} }
// If we've focused a floating container, bring it to the front.
if (container && config->raise_floating) {
container_raise_floating(container);
}
if (new_output_last_ws) { if (new_output_last_ws) {
workspace_consider_destroy(new_output_last_ws); workspace_consider_destroy(new_output_last_ws);
} }
@ -1010,10 +1005,7 @@ void seat_begin_down(struct sway_seat *seat, struct sway_container *con,
seat->op_ref_con_ly = sy; seat->op_ref_con_ly = sy;
seat->op_moved = false; seat->op_moved = false;
// In case the container was not raised by gaining focus, raise on click container_raise_floating(con);
if (!config->raise_floating) {
container_raise_floating(con);
}
} }
void seat_begin_move_floating(struct sway_seat *seat, void seat_begin_move_floating(struct sway_seat *seat,
@ -1026,10 +1018,7 @@ void seat_begin_move_floating(struct sway_seat *seat,
seat->op_container = con; seat->op_container = con;
seat->op_button = button; seat->op_button = button;
// In case the container was not raised by gaining focus, raise on click container_raise_floating(con);
if (!config->raise_floating) {
container_raise_floating(con);
}
cursor_set_image(seat->cursor, "grab", NULL); cursor_set_image(seat->cursor, "grab", NULL);
} }
@ -1064,11 +1053,8 @@ void seat_begin_resize_floating(struct sway_seat *seat,
seat->op_ref_con_ly = con->y; seat->op_ref_con_ly = con->y;
seat->op_ref_width = con->width; seat->op_ref_width = con->width;
seat->op_ref_height = con->height; seat->op_ref_height = con->height;
//
// In case the container was not raised by gaining focus, raise on click container_raise_floating(con);
if (!config->raise_floating) {
container_raise_floating(con);
}
const char *image = edge == WLR_EDGE_NONE ? const char *image = edge == WLR_EDGE_NONE ?
"se-resize" : wlr_xcursor_get_resize_name(edge); "se-resize" : wlr_xcursor_get_resize_name(edge);

View file

@ -48,7 +48,6 @@ sway_sources = files(
'commands/floating_modifier.c', 'commands/floating_modifier.c',
'commands/focus.c', 'commands/focus.c',
'commands/focus_follows_mouse.c', 'commands/focus_follows_mouse.c',
'commands/raise_floating.c',
'commands/focus_on_window_activation.c', 'commands/focus_on_window_activation.c',
'commands/focus_wrapping.c', 'commands/focus_wrapping.c',
'commands/font.c', 'commands/font.c',

View file

@ -446,11 +446,6 @@ The default colors are:
devices. A list of input device names may be obtained via *swaymsg -t devices. A list of input device names may be obtained via *swaymsg -t
get\_inputs*. get\_inputs*.
*raise\_floating* yes|no
Controls the behaviour of floating windows. A _yes_ (the default) will
raise windows on gaining focus. A _no_ will only raise floating windows
by clicking anywhere in the window.
*seat* <seat> <seat-subcommands...> *seat* <seat> <seat-subcommands...>
For details on seat subcommands, see *sway-input*(5). For details on seat subcommands, see *sway-input*(5).