aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway
diff options
context:
space:
mode:
Diffstat (limited to 'include/sway')
-rw-r--r--include/sway/commands.h22
-rw-r--r--include/sway/config.h39
-rw-r--r--include/sway/input/cursor.h37
-rw-r--r--include/sway/input/input-manager.h10
-rw-r--r--include/sway/input/seat.h88
-rw-r--r--include/sway/output.h12
-rw-r--r--include/sway/tree/container.h8
-rw-r--r--include/sway/tree/view.h7
8 files changed, 173 insertions, 50 deletions
diff --git a/include/sway/commands.h b/include/sway/commands.h
index 32925369..5d45d78b 100644
--- a/include/sway/commands.h
+++ b/include/sway/commands.h
@@ -56,7 +56,7 @@ struct cmd_handler *find_handler(char *line, struct cmd_handler *cmd_handlers,
56 * all matching containers. Otherwise, it'll run on the `con` container. If 56 * all matching containers. Otherwise, it'll run on the `con` container. If
57 * `con` is NULL then it'll run on the currently focused container. 57 * `con` is NULL then it'll run on the currently focused container.
58 */ 58 */
59struct cmd_results *execute_command(char *command, struct sway_seat *seat, 59list_t *execute_command(char *command, struct sway_seat *seat,
60 struct sway_container *con); 60 struct sway_container *con);
61/** 61/**
62 * Parse and handles a command during config file loading. 62 * Parse and handles a command during config file loading.
@@ -82,11 +82,11 @@ struct cmd_results *cmd_results_new(enum cmd_status status, const char* input, c
82 */ 82 */
83void free_cmd_results(struct cmd_results *results); 83void free_cmd_results(struct cmd_results *results);
84/** 84/**
85 * Serializes cmd_results to a JSON string. 85 * Serializes a list of cmd_results to a JSON string.
86 * 86 *
87 * Free the JSON string later on. 87 * Free the JSON string later on.
88 */ 88 */
89char *cmd_results_to_json(struct cmd_results *results); 89char *cmd_results_to_json(list_t *res_list);
90 90
91struct cmd_results *add_color(const char *name, 91struct cmd_results *add_color(const char *name,
92 char *buffer, const char *color); 92 char *buffer, const char *color);
@@ -172,7 +172,11 @@ sway_cmd cmd_swaybg_command;
172sway_cmd cmd_swaynag_command; 172sway_cmd cmd_swaynag_command;
173sway_cmd cmd_swap; 173sway_cmd cmd_swap;
174sway_cmd cmd_tiling_drag; 174sway_cmd cmd_tiling_drag;
175sway_cmd cmd_tiling_drag_threshold;
176sway_cmd cmd_title_align;
175sway_cmd cmd_title_format; 177sway_cmd cmd_title_format;
178sway_cmd cmd_titlebar_border_thickness;
179sway_cmd cmd_titlebar_padding;
176sway_cmd cmd_unmark; 180sway_cmd cmd_unmark;
177sway_cmd cmd_urgent; 181sway_cmd cmd_urgent;
178sway_cmd cmd_workspace; 182sway_cmd cmd_workspace;
@@ -180,12 +184,12 @@ sway_cmd cmd_workspace_layout;
180sway_cmd cmd_ws_auto_back_and_forth; 184sway_cmd cmd_ws_auto_back_and_forth;
181sway_cmd cmd_xwayland; 185sway_cmd cmd_xwayland;
182 186
183sway_cmd bar_cmd_activate_button; 187sway_cmd bar_cmd_bindcode;
184sway_cmd bar_cmd_binding_mode_indicator; 188sway_cmd bar_cmd_binding_mode_indicator;
185sway_cmd bar_cmd_bindsym; 189sway_cmd bar_cmd_bindsym;
186sway_cmd bar_cmd_colors; 190sway_cmd bar_cmd_colors;
187sway_cmd bar_cmd_context_button;
188sway_cmd bar_cmd_font; 191sway_cmd bar_cmd_font;
192sway_cmd bar_cmd_gaps;
189sway_cmd bar_cmd_mode; 193sway_cmd bar_cmd_mode;
190sway_cmd bar_cmd_modifier; 194sway_cmd bar_cmd_modifier;
191sway_cmd bar_cmd_output; 195sway_cmd bar_cmd_output;
@@ -194,12 +198,15 @@ sway_cmd bar_cmd_hidden_state;
194sway_cmd bar_cmd_icon_theme; 198sway_cmd bar_cmd_icon_theme;
195sway_cmd bar_cmd_id; 199sway_cmd bar_cmd_id;
196sway_cmd bar_cmd_position; 200sway_cmd bar_cmd_position;
197sway_cmd bar_cmd_secondary_button;
198sway_cmd bar_cmd_separator_symbol; 201sway_cmd bar_cmd_separator_symbol;
199sway_cmd bar_cmd_status_command; 202sway_cmd bar_cmd_status_command;
203sway_cmd bar_cmd_status_edge_padding;
204sway_cmd bar_cmd_status_padding;
200sway_cmd bar_cmd_pango_markup; 205sway_cmd bar_cmd_pango_markup;
201sway_cmd bar_cmd_strip_workspace_numbers; 206sway_cmd bar_cmd_strip_workspace_numbers;
207sway_cmd bar_cmd_strip_workspace_name;
202sway_cmd bar_cmd_swaybar_command; 208sway_cmd bar_cmd_swaybar_command;
209sway_cmd bar_cmd_tray_bindsym;
203sway_cmd bar_cmd_tray_output; 210sway_cmd bar_cmd_tray_output;
204sway_cmd bar_cmd_tray_padding; 211sway_cmd bar_cmd_tray_padding;
205sway_cmd bar_cmd_wrap_scroll; 212sway_cmd bar_cmd_wrap_scroll;
@@ -255,8 +262,9 @@ sway_cmd output_cmd_scale;
255sway_cmd output_cmd_transform; 262sway_cmd output_cmd_transform;
256 263
257sway_cmd seat_cmd_attach; 264sway_cmd seat_cmd_attach;
258sway_cmd seat_cmd_fallback;
259sway_cmd seat_cmd_cursor; 265sway_cmd seat_cmd_cursor;
266sway_cmd seat_cmd_fallback;
267sway_cmd seat_cmd_hide_cursor;
260 268
261sway_cmd cmd_ipc_cmd; 269sway_cmd cmd_ipc_cmd;
262sway_cmd cmd_ipc_events; 270sway_cmd cmd_ipc_events;
diff --git a/include/sway/config.h b/include/sway/config.h
index c44533ee..96fe899b 100644
--- a/include/sway/config.h
+++ b/include/sway/config.h
@@ -6,6 +6,7 @@
6#include <time.h> 6#include <time.h>
7#include <wlr/types/wlr_box.h> 7#include <wlr/types/wlr_box.h>
8#include <xkbcommon/xkbcommon.h> 8#include <xkbcommon/xkbcommon.h>
9#include "../include/config.h"
9#include "list.h" 10#include "list.h"
10#include "swaynag.h" 11#include "swaynag.h"
11#include "tree/container.h" 12#include "tree/container.h"
@@ -26,7 +27,8 @@ struct sway_variable {
26enum binding_input_type { 27enum binding_input_type {
27 BINDING_KEYCODE, 28 BINDING_KEYCODE,
28 BINDING_KEYSYM, 29 BINDING_KEYSYM,
29 BINDING_MOUSE, 30 BINDING_MOUSECODE,
31 BINDING_MOUSESYM,
30}; 32};
31 33
32enum binding_flags { 34enum binding_flags {
@@ -140,6 +142,7 @@ struct seat_config {
140 char *name; 142 char *name;
141 int fallback; // -1 means not set 143 int fallback; // -1 means not set
142 list_t *attachments; // list of seat_attachment configs 144 list_t *attachments; // list of seat_attachment configs
145 int hide_cursor_timeout;
143}; 146};
144 147
145enum config_dpms { 148enum config_dpms {
@@ -224,9 +227,13 @@ struct bar_config {
224 bool wrap_scroll; 227 bool wrap_scroll;
225 char *separator_symbol; 228 char *separator_symbol;
226 bool strip_workspace_numbers; 229 bool strip_workspace_numbers;
230 bool strip_workspace_name;
227 bool binding_mode_indicator; 231 bool binding_mode_indicator;
228 bool verbose; 232 bool verbose;
233 struct side_gaps gaps;
229 pid_t pid; 234 pid_t pid;
235 int status_padding;
236 int status_edge_padding;
230 struct { 237 struct {
231 char *background; 238 char *background;
232 char *statusline; 239 char *statusline;
@@ -250,6 +257,13 @@ struct bar_config {
250 char *binding_mode_bg; 257 char *binding_mode_bg;
251 char *binding_mode_text; 258 char *binding_mode_text;
252 } colors; 259 } colors;
260
261#if HAVE_TRAY
262 char *icon_theme;
263 const char *tray_bindings[10]; // mouse buttons 0-9
264 list_t *tray_outputs; // char *
265 int tray_padding;
266#endif
253}; 267};
254 268
255struct bar_binding { 269struct bar_binding {
@@ -356,6 +370,12 @@ enum mouse_warping_mode {
356 WARP_CONTAINER 370 WARP_CONTAINER
357}; 371};
358 372
373enum alignment {
374 ALIGN_LEFT,
375 ALIGN_CENTER,
376 ALIGN_RIGHT
377};
378
359/** 379/**
360 * The configuration struct. The result of loading a config file. 380 * The configuration struct. The result of loading a config file.
361 */ 381 */
@@ -390,6 +410,9 @@ struct sway_config {
390 size_t font_height; 410 size_t font_height;
391 size_t font_baseline; 411 size_t font_baseline;
392 bool pango_markup; 412 bool pango_markup;
413 int titlebar_border_thickness;
414 int titlebar_h_padding;
415 int titlebar_v_padding;
393 size_t urgent_timeout; 416 size_t urgent_timeout;
394 enum sway_fowa focus_on_window_activation; 417 enum sway_fowa focus_on_window_activation;
395 enum sway_popup_during_fullscreen popup_during_fullscreen; 418 enum sway_popup_during_fullscreen popup_during_fullscreen;
@@ -406,7 +429,10 @@ struct sway_config {
406 bool validating; 429 bool validating;
407 bool auto_back_and_forth; 430 bool auto_back_and_forth;
408 bool show_marks; 431 bool show_marks;
432 enum alignment title_align;
433
409 bool tiling_drag; 434 bool tiling_drag;
435 int tiling_drag_threshold;
410 436
411 bool smart_gaps; 437 bool smart_gaps;
412 int gaps_inner; 438 int gaps_inner;
@@ -415,6 +441,8 @@ struct sway_config {
415 list_t *config_chain; 441 list_t *config_chain;
416 const char *current_config_path; 442 const char *current_config_path;
417 const char *current_config; 443 const char *current_config;
444 int current_config_line_number;
445 char *current_config_line;
418 446
419 enum sway_container_border border; 447 enum sway_container_border border;
420 enum sway_container_border floating_border; 448 enum sway_container_border floating_border;
@@ -480,6 +508,11 @@ bool read_config(FILE *file, struct sway_config *config,
480 struct swaynag_instance *swaynag); 508 struct swaynag_instance *swaynag);
481 509
482/** 510/**
511 * Adds a warning entry to the swaynag instance used for errors.
512 */
513void config_add_swaynag_warning(char *fmt, ...);
514
515/**
483 * Free config struct 516 * Free config struct
484 */ 517 */
485void free_config(struct sway_config *config); 518void free_config(struct sway_config *config);
@@ -516,7 +549,7 @@ struct seat_attachment_config *seat_attachment_config_new(void);
516struct seat_attachment_config *seat_config_get_attachment( 549struct seat_attachment_config *seat_config_get_attachment(
517 struct seat_config *seat_config, char *identifier); 550 struct seat_config *seat_config, char *identifier);
518 551
519void apply_seat_config(struct seat_config *seat); 552struct seat_config *store_seat_config(struct seat_config *seat);
520 553
521int output_name_cmp(const void *item, const void *data); 554int output_name_cmp(const void *item, const void *data);
522 555
@@ -535,8 +568,6 @@ void apply_output_config_to_outputs(struct output_config *oc);
535 568
536void free_output_config(struct output_config *oc); 569void free_output_config(struct output_config *oc);
537 570
538void create_default_output_configs(void);
539
540int workspace_output_cmp_workspace(const void *a, const void *b); 571int workspace_output_cmp_workspace(const void *a, const void *b);
541 572
542int sway_binding_cmp(const void *a, const void *b); 573int sway_binding_cmp(const void *a, const void *b);
diff --git a/include/sway/input/cursor.h b/include/sway/input/cursor.h
index 50ac453b..77aa0ea1 100644
--- a/include/sway/input/cursor.h
+++ b/include/sway/input/cursor.h
@@ -1,10 +1,17 @@
1#ifndef _SWAY_INPUT_CURSOR_H 1#ifndef _SWAY_INPUT_CURSOR_H
2#define _SWAY_INPUT_CURSOR_H 2#define _SWAY_INPUT_CURSOR_H
3#include <stdbool.h>
3#include <stdint.h> 4#include <stdint.h>
5#include <wlr/types/wlr_surface.h>
4#include "sway/input/seat.h" 6#include "sway/input/seat.h"
5 7
6#define SWAY_CURSOR_PRESSED_BUTTONS_CAP 32 8#define SWAY_CURSOR_PRESSED_BUTTONS_CAP 32
7 9
10#define SWAY_SCROLL_UP KEY_MAX + 1
11#define SWAY_SCROLL_DOWN KEY_MAX + 2
12#define SWAY_SCROLL_LEFT KEY_MAX + 3
13#define SWAY_SCROLL_RIGHT KEY_MAX + 4
14
8struct sway_cursor { 15struct sway_cursor {
9 struct sway_seat *seat; 16 struct sway_seat *seat;
10 struct wlr_cursor *cursor; 17 struct wlr_cursor *cursor;
@@ -16,6 +23,8 @@ struct sway_cursor {
16 23
17 const char *image; 24 const char *image;
18 struct wl_client *image_client; 25 struct wl_client *image_client;
26 struct wlr_surface *image_surface;
27 int hotspot_x, hotspot_y;
19 28
20 struct wl_listener motion; 29 struct wl_listener motion;
21 struct wl_listener motion_absolute; 30 struct wl_listener motion_absolute;
@@ -33,11 +42,20 @@ struct sway_cursor {
33 42
34 struct wl_listener request_set_cursor; 43 struct wl_listener request_set_cursor;
35 44
45 struct wl_event_source *hide_source;
46 bool hidden;
47
36 // Mouse binding state 48 // Mouse binding state
37 uint32_t pressed_buttons[SWAY_CURSOR_PRESSED_BUTTONS_CAP]; 49 uint32_t pressed_buttons[SWAY_CURSOR_PRESSED_BUTTONS_CAP];
38 size_t pressed_button_count; 50 size_t pressed_button_count;
39}; 51};
40 52
53struct sway_node;
54
55struct sway_node *node_at_coords(
56 struct sway_seat *seat, double lx, double ly,
57 struct wlr_surface **surface, double *sx, double *sy);
58
41void sway_cursor_destroy(struct sway_cursor *cursor); 59void sway_cursor_destroy(struct sway_cursor *cursor);
42struct sway_cursor *sway_cursor_create(struct sway_seat *seat); 60struct sway_cursor *sway_cursor_create(struct sway_seat *seat);
43 61
@@ -48,6 +66,10 @@ struct sway_cursor *sway_cursor_create(struct sway_seat *seat);
48 */ 66 */
49void cursor_rebase(struct sway_cursor *cursor); 67void cursor_rebase(struct sway_cursor *cursor);
50 68
69void cursor_handle_activity(struct sway_cursor *cursor);
70void cursor_unhide(struct sway_cursor *cursor);
71int cursor_get_timeout(struct sway_cursor *cursor);
72
51/** 73/**
52 * Like cursor_rebase, but also allows focus to change when the cursor enters a 74 * Like cursor_rebase, but also allows focus to change when the cursor enters a
53 * new container. 75 * new container.
@@ -58,12 +80,27 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
58 struct wlr_input_device *device, uint32_t time_msec, uint32_t button, 80 struct wlr_input_device *device, uint32_t time_msec, uint32_t button,
59 enum wlr_button_state state); 81 enum wlr_button_state state);
60 82
83void dispatch_cursor_axis(struct sway_cursor *cursor,
84 struct wlr_event_pointer_axis *event);
85
61void cursor_set_image(struct sway_cursor *cursor, const char *image, 86void cursor_set_image(struct sway_cursor *cursor, const char *image,
62 struct wl_client *client); 87 struct wl_client *client);
63 88
89void cursor_set_image_surface(struct sway_cursor *cursor,
90 struct wlr_surface *surface, int32_t hotspot_x, int32_t hotspot_y,
91 struct wl_client *client);
92
64void cursor_warp_to_container(struct sway_cursor *cursor, 93void cursor_warp_to_container(struct sway_cursor *cursor,
65 struct sway_container *container); 94 struct sway_container *container);
66 95
67void cursor_warp_to_workspace(struct sway_cursor *cursor, 96void cursor_warp_to_workspace(struct sway_cursor *cursor,
68 struct sway_workspace *workspace); 97 struct sway_workspace *workspace);
98
99uint32_t get_mouse_bindsym(const char *name, char **error);
100
101uint32_t get_mouse_bindcode(const char *name, char **error);
102
103// Considers both bindsym and bindcode
104uint32_t get_mouse_button(const char *name, char **error);
105
69#endif 106#endif
diff --git a/include/sway/input/input-manager.h b/include/sway/input/input-manager.h
index 219aa9ba..8e8bf1f2 100644
--- a/include/sway/input/input-manager.h
+++ b/include/sway/input/input-manager.h
@@ -37,6 +37,10 @@ void input_manager_configure_xcursor(void);
37 37
38void input_manager_apply_input_config(struct input_config *input_config); 38void input_manager_apply_input_config(struct input_config *input_config);
39 39
40void input_manager_reset_input(struct sway_input_device *input_device);
41
42void input_manager_reset_all_inputs();
43
40void input_manager_apply_seat_config(struct seat_config *seat_config); 44void input_manager_apply_seat_config(struct seat_config *seat_config);
41 45
42struct sway_seat *input_manager_get_default_seat(void); 46struct sway_seat *input_manager_get_default_seat(void);
@@ -44,6 +48,12 @@ struct sway_seat *input_manager_get_default_seat(void);
44struct sway_seat *input_manager_get_seat(const char *seat_name); 48struct sway_seat *input_manager_get_seat(const char *seat_name);
45 49
46/** 50/**
51 * If none of the seat configs have a fallback setting (either true or false),
52 * create the default seat (if needed) and set it as the fallback
53 */
54void input_manager_verify_fallback_seat(void);
55
56/**
47 * Gets the last seat the user interacted with 57 * Gets the last seat the user interacted with
48 */ 58 */
49struct sway_seat *input_manager_current_seat(void); 59struct sway_seat *input_manager_current_seat(void);
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h
index bef2af77..d2f14895 100644
--- a/include/sway/input/seat.h
+++ b/include/sway/input/seat.h
@@ -6,6 +6,17 @@
6#include <wlr/util/edges.h> 6#include <wlr/util/edges.h>
7#include "sway/input/input-manager.h" 7#include "sway/input/input-manager.h"
8 8
9struct sway_seat;
10
11struct sway_seatop_impl {
12 void (*motion)(struct sway_seat *seat, uint32_t time_msec);
13 void (*finish)(struct sway_seat *seat);
14 void (*abort)(struct sway_seat *seat);
15 void (*unref)(struct sway_seat *seat, struct sway_container *con);
16 void (*render)(struct sway_seat *seat, struct sway_output *output,
17 pixman_region32_t *damage);
18};
19
9struct sway_seat_device { 20struct sway_seat_device {
10 struct sway_seat *sway_seat; 21 struct sway_seat *sway_seat;
11 struct sway_input_device *input_device; 22 struct sway_input_device *input_device;
@@ -35,15 +46,6 @@ struct sway_drag_icon {
35 struct wl_listener destroy; 46 struct wl_listener destroy;
36}; 47};
37 48
38enum sway_seat_operation {
39 OP_NONE,
40 OP_DOWN,
41 OP_MOVE_FLOATING,
42 OP_MOVE_TILING,
43 OP_RESIZE_FLOATING,
44 OP_RESIZE_TILING,
45};
46
47struct sway_seat { 49struct sway_seat {
48 struct wlr_seat *wlr_seat; 50 struct wlr_seat *wlr_seat;
49 struct sway_cursor *cursor; 51 struct sway_cursor *cursor;
@@ -63,19 +65,10 @@ struct sway_seat {
63 int32_t touch_id; 65 int32_t touch_id;
64 double touch_x, touch_y; 66 double touch_x, touch_y;
65 67
66 // Operations (drag and resize) 68 // Seat operations (drag and resize)
67 enum sway_seat_operation operation; 69 const struct sway_seatop_impl *seatop_impl;
68 struct sway_container *op_container; 70 void *seatop_data;
69 struct sway_node *op_target_node; // target for tiling move 71 uint32_t seatop_button;
70 enum wlr_edges op_target_edge;
71 struct wlr_box op_drop_box;
72 enum wlr_edges op_resize_edge;
73 uint32_t op_button;
74 bool op_resize_preserve_ratio;
75 double op_ref_lx, op_ref_ly; // cursor's x/y at start of op
76 double op_ref_width, op_ref_height; // container's size at start of op
77 double op_ref_con_lx, op_ref_con_ly; // container's x/y at start of op
78 bool op_moved; // if the mouse moved during a down op
79 72
80 uint32_t last_button; 73 uint32_t last_button;
81 uint32_t last_button_serial; 74 uint32_t last_button_serial;
@@ -99,6 +92,9 @@ void seat_add_device(struct sway_seat *seat,
99void seat_configure_device(struct sway_seat *seat, 92void seat_configure_device(struct sway_seat *seat,
100 struct sway_input_device *device); 93 struct sway_input_device *device);
101 94
95void seat_reset_device(struct sway_seat *seat,
96 struct sway_input_device *input_device);
97
102void seat_remove_device(struct sway_seat *seat, 98void seat_remove_device(struct sway_seat *seat,
103 struct sway_input_device *device); 99 struct sway_input_device *device);
104 100
@@ -174,33 +170,65 @@ void seat_apply_config(struct sway_seat *seat, struct seat_config *seat_config);
174 170
175struct seat_config *seat_get_config(struct sway_seat *seat); 171struct seat_config *seat_get_config(struct sway_seat *seat);
176 172
173struct seat_config *seat_get_config_by_name(const char *name);
174
177bool seat_is_input_allowed(struct sway_seat *seat, struct wlr_surface *surface); 175bool seat_is_input_allowed(struct sway_seat *seat, struct wlr_surface *surface);
178 176
179void drag_icon_update_position(struct sway_drag_icon *icon); 177void drag_icon_update_position(struct sway_drag_icon *icon);
180 178
181void seat_begin_down(struct sway_seat *seat, struct sway_container *con, 179void seatop_begin_down(struct sway_seat *seat,
182 uint32_t button, double sx, double sy); 180 struct sway_container *con, uint32_t button, int sx, int sy);
183 181
184void seat_begin_move_floating(struct sway_seat *seat, 182void seatop_begin_move_floating(struct sway_seat *seat,
185 struct sway_container *con, uint32_t button); 183 struct sway_container *con, uint32_t button);
186 184
187void seat_begin_move_tiling(struct sway_seat *seat, 185void seatop_begin_move_tiling_threshold(struct sway_seat *seat,
188 struct sway_container *con, uint32_t button); 186 struct sway_container *con, uint32_t button);
189 187
190void seat_begin_resize_floating(struct sway_seat *seat, 188void seatop_begin_move_tiling(struct sway_seat *seat,
189 struct sway_container *con, uint32_t button);
190
191void seatop_begin_resize_floating(struct sway_seat *seat,
191 struct sway_container *con, uint32_t button, enum wlr_edges edge); 192 struct sway_container *con, uint32_t button, enum wlr_edges edge);
192 193
193void seat_begin_resize_tiling(struct sway_seat *seat, 194void seatop_begin_resize_tiling(struct sway_seat *seat,
194 struct sway_container *con, uint32_t button, enum wlr_edges edge); 195 struct sway_container *con, uint32_t button, enum wlr_edges edge);
195 196
196struct sway_container *seat_get_focus_inactive_floating(struct sway_seat *seat, 197struct sway_container *seat_get_focus_inactive_floating(struct sway_seat *seat,
197 struct sway_workspace *workspace); 198 struct sway_workspace *workspace);
198 199
199void seat_end_mouse_operation(struct sway_seat *seat);
200
201void seat_pointer_notify_button(struct sway_seat *seat, uint32_t time_msec, 200void seat_pointer_notify_button(struct sway_seat *seat, uint32_t time_msec,
202 uint32_t button, enum wlr_button_state state); 201 uint32_t button, enum wlr_button_state state);
203 202
204void seat_consider_warp_to_focus(struct sway_seat *seat); 203void seat_consider_warp_to_focus(struct sway_seat *seat);
205 204
205bool seat_doing_seatop(struct sway_seat *seat);
206
207void seatop_motion(struct sway_seat *seat, uint32_t time_msec);
208
209/**
210 * End a seatop and apply the affects.
211 */
212void seatop_finish(struct sway_seat *seat);
213
214/**
215 * End a seatop without applying the affects.
216 */
217void seatop_abort(struct sway_seat *seat);
218
219/**
220 * Instructs the seatop implementation to drop any references to the given
221 * container (eg. because the container is destroying).
222 * The seatop may choose to abort itself in response to this.
223 */
224void seatop_unref(struct sway_seat *seat, struct sway_container *con);
225
226/**
227 * Instructs a seatop to render anything that it needs to render
228 * (eg. dropzone for move-tiling)
229 */
230void seatop_render(struct sway_seat *seat, struct sway_output *output,
231 pixman_region32_t *damage);
232
233
206#endif 234#endif
diff --git a/include/sway/output.h b/include/sway/output.h
index 43c1ab96..bdf9614d 100644
--- a/include/sway/output.h
+++ b/include/sway/output.h
@@ -84,9 +84,7 @@ void output_damage_box(struct sway_output *output, struct wlr_box *box);
84void output_damage_whole_container(struct sway_output *output, 84void output_damage_whole_container(struct sway_output *output,
85 struct sway_container *con); 85 struct sway_container *con);
86 86
87struct sway_output *output_by_name(const char *name); 87struct sway_output *output_by_name_or_id(const char *name_or_id);
88
89struct sway_output *output_by_identifier(const char *identifier);
90 88
91void output_sort_workspaces(struct sway_output *output); 89void output_sort_workspaces(struct sway_output *output);
92 90
@@ -148,4 +146,12 @@ enum sway_container_layout output_get_default_layout(
148 146
149void output_add_listeners(struct sway_output *output); 147void output_add_listeners(struct sway_output *output);
150 148
149void render_rect(struct wlr_output *wlr_output,
150 pixman_region32_t *output_damage, const struct wlr_box *_box,
151 float color[static 4]);
152
153void premultiply_alpha(float color[4], float opacity);
154
155void scale_box(struct wlr_box *box, float scale);
156
151#endif 157#endif
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h
index f907aad2..9a432cb2 100644
--- a/include/sway/tree/container.h
+++ b/include/sway/tree/container.h
@@ -10,12 +10,6 @@
10struct sway_view; 10struct sway_view;
11struct sway_seat; 11struct sway_seat;
12 12
13#define TITLEBAR_BORDER_THICKNESS 1
14
15// Padding includes titlebar border
16#define TITLEBAR_H_PADDING 3
17#define TITLEBAR_V_PADDING 4
18
19enum sway_container_layout { 13enum sway_container_layout {
20 L_NONE, 14 L_NONE,
21 L_HORIZ, 15 L_HORIZ,
@@ -339,4 +333,6 @@ void container_add_mark(struct sway_container *container, char *mark);
339 333
340void container_update_marks_textures(struct sway_container *container); 334void container_update_marks_textures(struct sway_container *container);
341 335
336void container_raise_floating(struct sway_container *con);
337
342#endif 338#endif
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h
index 4716c688..5cc9777b 100644
--- a/include/sway/tree/view.h
+++ b/include/sway/tree/view.h
@@ -195,6 +195,7 @@ struct sway_view_child {
195 195
196 struct sway_view *view; 196 struct sway_view *view;
197 struct wlr_surface *surface; 197 struct wlr_surface *surface;
198 bool mapped;
198 199
199 struct wl_listener surface_commit; 200 struct wl_listener surface_commit;
200 struct wl_listener surface_new_subsurface; 201 struct wl_listener surface_new_subsurface;
@@ -203,6 +204,12 @@ struct sway_view_child {
203 struct wl_listener surface_destroy; 204 struct wl_listener surface_destroy;
204}; 205};
205 206
207struct sway_subsurface {
208 struct sway_view_child child;
209
210 struct wl_listener destroy;
211};
212
206struct sway_xdg_popup_v6 { 213struct sway_xdg_popup_v6 {
207 struct sway_view_child child; 214 struct sway_view_child child;
208 215