Sway has ability to apply transparency to arbitrary windows. This script
wires up this functional to one of popular use-cases from
i3+<compositor_name>.
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
The idea here is we don't want users to be blissfully unaware that they
are running unsupported drivers. So we abort on startup, and force the
user to add a specific argument to bypass the check.
The wlr_xdg_popup_get_toplevel_coords function has the following quirks:
* It does not do anything with the coordinates of the passed popup.
Instead, we are required to add them ourselves, which we do by passing
them to the function as the surface local values.
* It adds the geometry (shadows etc) of the toplevel itself, so the
coordinates are surface local rather than content local. For this
reason, we have to negate the toplevel's geometry
(child->view->geometry).
* I may be wrong, but the popup positions appear to be stored in surface
local coordinates rather than content local coordinates. The geometry
(shadows etc) of the popup itself must be negated (surface->geometry).
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.
The positions "left" and "right" are not allowed by the man page, remove them
from the allowed positions. Also print an error to stderr if we default to the
bottom position.
Fixes#2878
The input manager is a singleton object. Passing the sway_input_manager
argument to each of its functions is unnecessary, while removing the
argument makes it obvious to the caller that it's a singleton. This
patch removes the argument and makes the input manager use server.input
instead.
On a similar note:
* sway_input_manager.server is removed in favour of using the server
global.
* seat.input is removed because it can get it from server.input.
Due to a circular dependency, creating seat0 is now done directly in
server_init rather than in input_manager_create. This is because
creating seats must be done after server.input is set.
Lastly, it now stores the default seat name using a constant and removes
a second reference to seat0 (in input_manager_get_default_seat).
When a view unmaps, we call workspace_consider_destroy. This function
assumed the workspace would always have an output, but this is not the
case when hotplugged down to zero. The function now handles this and
allows itself to be destroyed when there is no output.
This means that workspace_begin_destroy must remove the workspace from
the root->saved_workspaces list to avoid an eventual dangling pointer,
so it does that now.
Lastly, when an output is plugged in again and it has to create a new
initial workspace for it, we must emit the workspace::init IPC event
otherwise swaybar shows no workspaces at all. I guess when you start
sway, swaybar is started after the workspace has been created which is
why this hasn't been needed earlier.
If the container being dragged has a parent that needs to be reaped, it
must be reaped after we've reinserted the dragging container into the
tree. During reaping, handle_seat_node_destroy tries to refocus the
dragging container which isn't possible while it's detached.
Fixes a regression introduced in
24a90e5d86.
consider_warp_to_focus has been renamed to seat_consider_warp_to_focus,
moved to seat.c and made public. It is now called when switching
workspaces via `workspace <ws>`.
Because cursor warping was the default behaviour in seat_set_focus,
there may be cases where we may have been warping the cursor
unintentionally. This patch removes cursor warping from seat_set_focus
and only does it in the focus command. This is managed by a static
function in focus.c.
To know whether to warp or not, we need to know which node had focus
previously. To keep track of this easily, seat->prev_focus has been
introduced and is set to the previous in seat_set_focus.
These can be used by toolkits (currently Qt, libxcursor, glfw) to
choose a default cursor theme and size.
This backports this rootston commit:
3a181ab430
PR #2855 basically hardcodes the config file path to /etc, which is a
problem on e.g. FreeBSD, where the expected path for config files of
non-base software is '/usr/local/etc'.
Meson sets sysconfdir to '/etc' explicitly only when prefix is '/usr',
so it is still possible to use '/usr/local' as prefix, and install the
config files under '/usr/local/etc'. This commit allows to do that by
setting sysconfdir based on the value of prefix.
* Make a workspace which only contains floating views
* Switch to another workspace and create a tiled view
* Move the tiled view to the workspace with
`move container to workspace N`
The container would be added as a sibling to the floating view, which
makes the container floating while having the geometry of a tiled
container.
This changes it so it only looks for tiled containers in the workspace
with a fallback to the workspace itself.