diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/input/cursor.h | 3 | ||||
-rw-r--r-- | include/sway/input/seat.h | 6 | ||||
-rw-r--r-- | include/sway/tree/container.h | 15 | ||||
-rw-r--r-- | include/sway/tree/view.h | 6 | ||||
-rw-r--r-- | include/swaylock/swaylock.h | 26 |
5 files changed, 47 insertions, 9 deletions
diff --git a/include/sway/input/cursor.h b/include/sway/input/cursor.h index 20c1c903..42c894a4 100644 --- a/include/sway/input/cursor.h +++ b/include/sway/input/cursor.h @@ -29,7 +29,8 @@ struct sway_cursor { void sway_cursor_destroy(struct sway_cursor *cursor); struct sway_cursor *sway_cursor_create(struct sway_seat *seat); -void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec); +void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec, + bool allow_refocusing); void dispatch_cursor_button(struct sway_cursor *cursor, uint32_t time_msec, uint32_t button, enum wlr_button_state state); diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index ff76841e..2e4da438 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h @@ -95,6 +95,12 @@ struct sway_container *seat_get_focus_inactive_view(struct sway_seat *seat, struct sway_container *container); /** + * Return the immediate child of container which was most recently focused. + */ +struct sway_container *seat_get_active_child(struct sway_seat *seat, + struct sway_container *container); + +/** * Iterate over the focus-inactive children of the container calling the * function on each. */ diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index ec9e2385..493c70e2 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h @@ -11,6 +11,12 @@ extern struct sway_container root_container; struct sway_view; struct sway_seat; +#define TITLEBAR_BORDER_THICKNESS 1 + +// Padding includes titlebar border +#define TITLEBAR_H_PADDING 3 +#define TITLEBAR_V_PADDING 4 + /** * Different kinds of containers. * @@ -98,6 +104,8 @@ struct sway_container { // Passed the previous parent struct wl_signal reparent; } events; + + struct wl_listener reparent; }; struct sway_container *container_create(enum sway_container_type type); @@ -160,7 +168,7 @@ struct sway_container *container_parent(struct sway_container *container, * is a view and the view contains a surface at those coordinates. */ struct sway_container *container_at(struct sway_container *container, - double lx, double ly, struct wlr_surface **surface, + double ox, double oy, struct wlr_surface **surface, double *sx, double *sy); /** @@ -210,4 +218,9 @@ void container_calculate_title_height(struct sway_container *container); void container_notify_child_title_changed(struct sway_container *container); +/** + * Return the height of a regular title bar. + */ +size_t container_titlebar_height(void); + #endif diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 951912d0..0fb8f1b3 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h @@ -274,4 +274,10 @@ bool view_has_mark(struct sway_view *view, char *mark); void view_update_marks_textures(struct sway_view *view); +/** + * Returns true if there's a possibility the view may be rendered on screen. + * Intended for damage tracking. + */ +bool view_is_visible(struct sway_view *view); + #endif diff --git a/include/swaylock/swaylock.h b/include/swaylock/swaylock.h index 56ec0afb..27db67cd 100644 --- a/include/swaylock/swaylock.h +++ b/include/swaylock/swaylock.h @@ -10,13 +10,13 @@ #include "wlr-layer-shell-unstable-v1-client-protocol.h" enum auth_state { - AUTH_STATE_IDLE, - AUTH_STATE_CLEAR, - AUTH_STATE_INPUT, - AUTH_STATE_INPUT_NOP, - AUTH_STATE_BACKSPACE, - AUTH_STATE_VALIDATING, - AUTH_STATE_INVALID, + AUTH_STATE_IDLE, + AUTH_STATE_CLEAR, + AUTH_STATE_INPUT, + AUTH_STATE_INPUT_NOP, + AUTH_STATE_BACKSPACE, + AUTH_STATE_VALIDATING, + AUTH_STATE_INVALID, }; struct swaylock_args { @@ -37,12 +37,14 @@ struct swaylock_state { struct zwlr_input_inhibit_manager_v1 *input_inhibit_manager; struct wl_shm *shm; struct wl_list surfaces; + struct wl_list images; struct swaylock_args args; cairo_surface_t *background_image; struct swaylock_password password; struct swaylock_xkb xkb; enum auth_state auth_state; bool run_display; + struct zxdg_output_manager_v1 *zxdg_output_manager; }; struct swaylock_surface { @@ -50,12 +52,22 @@ struct swaylock_surface { struct swaylock_state *state; struct wl_output *output; uint32_t output_global_name; + struct zxdg_output_v1 *xdg_output; struct wl_surface *surface; struct zwlr_layer_surface_v1 *layer_surface; struct pool_buffer buffers[2]; struct pool_buffer *current_buffer; uint32_t width, height; int32_t scale; + char *output_name; + struct wl_list link; +}; + +// There is exactly one swaylock_image for each -i argument +struct swaylock_image { + char *path; + char *output_name; + cairo_surface_t *cairo_surface; struct wl_list link; }; |