This commit is contained in:
Tobias Bengfort 2026-03-16 21:34:43 +00:00 committed by GitHub
commit 985f2c4d70
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 388 additions and 8 deletions

View file

@ -18,6 +18,7 @@ struct action {
*/
uint32_t type; /* enum action_type */
uint32_t permissions; /* enum lab_permission */
struct wl_list args; /* struct action_arg.link */
};

View file

@ -2,8 +2,15 @@
#ifndef LABWC_SPAWN_H
#define LABWC_SPAWN_H
#include <stdbool.h>
#include <sys/types.h>
/**
* set_cloexec - set file descriptor to close on exit
* @fd: file descriptor
*/
bool set_cloexec(int fd);
/**
* spawn_primary_client - execute asynchronously
* @command: command to be executed
@ -14,7 +21,7 @@ pid_t spawn_primary_client(const char *command);
* spawn_async_no_shell - execute asynchronously
* @command: command to be executed
*/
void spawn_async_no_shell(char const *command);
void spawn_async_no_shell(char const *command, int socket_fd);
/**
* spawn_piped - execute asynchronously

View file

@ -76,6 +76,7 @@ struct rcxml {
enum tearing_mode allow_tearing;
bool auto_enable_outputs;
bool reuse_output_mode;
uint32_t default_permissions;
bool xwayland_persistence;
bool primary_selection;
char *prompt_command;
@ -199,6 +200,8 @@ struct rcxml {
struct wl_list window_rules; /* struct window_rule.link */
struct wl_list autostart; /* struct action.link */
/* Menu */
unsigned int menu_ignore_button_release_period;
bool menu_show_icons;

View file

@ -299,6 +299,7 @@ struct server {
struct wlr_tablet_manager_v2 *tablet_manager;
struct wlr_security_context_manager_v1 *security_context_manager_v1;
struct xi_socket_manager_v1 *xi_socket_manager_v1;
/* Set when in cycle (alt-tab) mode */
struct cycle_state cycle;

13
include/permissions.h Normal file
View file

@ -0,0 +1,13 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef LABWC_PERMISSIONS_H
#define LABWC_PERMISSIONS_H
#include <wayland-server-core.h>
#include <stdbool.h>
uint32_t permissions_from_interface_name(const char *s);
int permissions_context_create(struct wl_display *display, uint32_t permissions);
bool permissions_context_clone(struct wl_client *client, int fd);
bool permissions_check(const struct wl_client *client, const struct wl_interface *iface);
#endif

View file

@ -0,0 +1,21 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef LABWC_PROTOCOLS_XI_SOCKET_MANAGER_H
#define LABWC_PROTOCOLS_XI_SOCKET_MANAGER_H
#include <wayland-server-core.h>
struct xi_socket_manager_v1 {
struct wl_global *global;
struct {
struct wl_signal destroy;
struct wl_signal register_socket;
} events;
struct wl_listener display_destroy;
};
struct xi_socket_manager_v1 *xi_socket_manager_v1_create(
struct wl_display *display);
#endif