mirror of
https://github.com/swaywm/sway.git
synced 2025-04-05 11:57:44 +03:00
view: associate launch contexts with views
Views now maintain a reference to a launch context which, as a last resort, is populated at map time with a context associated with its pid. This opens the possibility of populating it before map via another source, e.g. xdga-tokens or configuration.
This commit is contained in:
parent
d75c9f9722
commit
864b3a9a18
4 changed files with 64 additions and 39 deletions
include/sway
|
@ -3,10 +3,26 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
|
||||
struct sway_workspace *workspace_for_pid(pid_t pid);
|
||||
struct launcher_ctx {
|
||||
pid_t pid;
|
||||
char *name;
|
||||
struct wlr_xdg_activation_token_v1 *token;
|
||||
struct wl_listener token_destroy;
|
||||
|
||||
struct sway_node *node;
|
||||
struct wl_listener node_destroy;
|
||||
|
||||
struct wl_list link; // sway_server::pending_launcher_ctxs
|
||||
};
|
||||
|
||||
struct launcher_ctx *launcher_ctx_find_pid(pid_t pid);
|
||||
|
||||
struct sway_workspace *launcher_ctx_get_workspace(struct launcher_ctx *ctx);
|
||||
|
||||
void launcher_ctx_consume(struct launcher_ctx *ctx);
|
||||
|
||||
void launcher_ctx_destroy(struct launcher_ctx *ctx);
|
||||
|
||||
void launcher_ctx_create(pid_t pid);
|
||||
|
||||
void remove_workspace_pid(pid_t pid);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -74,6 +74,7 @@ struct sway_view {
|
|||
struct sway_xdg_decoration *xdg_decoration;
|
||||
|
||||
pid_t pid;
|
||||
struct launcher_ctx *ctx;
|
||||
|
||||
// The size the view would want to be if it weren't tiled.
|
||||
// Used when changing a view from tiled to floating.
|
||||
|
@ -372,4 +373,6 @@ void view_save_buffer(struct sway_view *view);
|
|||
|
||||
bool view_is_transient_for(struct sway_view *child, struct sway_view *ancestor);
|
||||
|
||||
void view_assign_ctx(struct sway_view *view, struct launcher_ctx *ctx);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue