mirror of
https://github.com/gwenhael-le-moine/sway-patched-tray-menu.git
synced 2024-12-27 21:58:16 +01:00
Fix scratchpad logic for floating windows
When a tiled window is sent to the scratchpad, we want to use sane defaults, which is to center it and resize it to the default. For floating windows, we want to use their existing geometry.
This commit is contained in:
parent
090e101581
commit
27f51360b7
1 changed files with 8 additions and 3 deletions
|
@ -61,9 +61,14 @@ void root_scratchpad_add_container(struct sway_container *con) {
|
|||
|
||||
struct sway_container *parent = con->parent;
|
||||
struct sway_workspace *workspace = con->workspace;
|
||||
container_set_floating(con, true);
|
||||
container_floating_set_default_size(con);
|
||||
container_floating_move_to_center(con);
|
||||
|
||||
// When a tiled window is sent to scratchpad, center and resize it.
|
||||
if (!container_is_floating(con)) {
|
||||
container_set_floating(con, true);
|
||||
container_floating_set_default_size(con);
|
||||
container_floating_move_to_center(con);
|
||||
}
|
||||
|
||||
container_detach(con);
|
||||
con->scratchpad = true;
|
||||
list_add(root->scratchpad, con);
|
||||
|
|
Loading…
Reference in a new issue