mirror of
https://github.com/swaywm/sway.git
synced 2025-11-02 09:01:40 -05:00
Implement scratchpad
Implements the following commands: * move scratchpad * scratchpad show * [criteria] scratchpad show Also fixes these: * Fix memory leak when executing command with criteria (use `list_free(views)` instead of `free(views)`) * Fix crash when running `move to` with no further arguments
This commit is contained in:
parent
89dc047ca9
commit
81e8f31cc6
13 changed files with 290 additions and 5 deletions
26
include/sway/scratchpad.h
Normal file
26
include/sway/scratchpad.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#ifndef _SWAY_SCRATCHPAD_H
|
||||
#define _SWAY_SCRATCHPAD_H
|
||||
|
||||
#include "tree/container.h"
|
||||
|
||||
/**
|
||||
* Move a container to the scratchpad.
|
||||
*/
|
||||
void scratchpad_add_container(struct sway_container *con);
|
||||
|
||||
/**
|
||||
* Remove a container from the scratchpad.
|
||||
*/
|
||||
void scratchpad_remove_container(struct sway_container *con);
|
||||
|
||||
/**
|
||||
* Show or hide the next container on the scratchpad.
|
||||
*/
|
||||
void scratchpad_toggle_auto(void);
|
||||
|
||||
/**
|
||||
* Show or hide a specific container on the scratchpad.
|
||||
*/
|
||||
void scratchpad_toggle_container(struct sway_container *con);
|
||||
|
||||
#endif
|
||||
|
|
@ -48,6 +48,8 @@ struct sway_server {
|
|||
|
||||
list_t *transactions;
|
||||
list_t *dirty_containers;
|
||||
|
||||
list_t *scratchpad; // struct sway_container
|
||||
};
|
||||
|
||||
struct sway_server server;
|
||||
|
|
|
|||
|
|
@ -135,6 +135,11 @@ struct sway_container {
|
|||
|
||||
struct sway_container *parent;
|
||||
|
||||
// Indicates that the container is a scratchpad container.
|
||||
// Both hidden and visible scratchpad containers have scratchpad=true.
|
||||
// Hidden scratchpad containers have a NULL parent.
|
||||
bool scratchpad;
|
||||
|
||||
float alpha;
|
||||
|
||||
struct wlr_texture *title_focused;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue