Merge branch 'master' into pid-workspaces

This commit is contained in:
Drew DeVault 2018-07-23 20:27:56 -04:00
commit f4b882475e
156 changed files with 5391 additions and 2147 deletions

View file

@ -11,26 +11,8 @@ void remove_gaps(struct sway_container *c);
void add_gaps(struct sway_container *c);
/**
* Arrange layout for all the children of the given container, and add them to
* the given transaction.
*
* Use this function if you need to arrange multiple sections of the tree in one
* transaction.
*
* You must set the desired state of the container before calling
* arrange_windows, then don't change any state-tracked properties in the
* container until you've called transaction_commit.
* Arrange layout for all the children of the given container.
*/
void arrange_windows(struct sway_container *container,
struct sway_transaction *transaction);
/**
* Arrange layout for the given container and commit the transaction.
*
* This function is a wrapper around arrange_windows, and handles creating and
* committing the transaction for you. Use this function if you're only doing
* one arrange operation.
*/
void arrange_and_commit(struct sway_container *container);
void arrange_windows(struct sway_container *container);
#endif

View file

@ -68,6 +68,9 @@ struct sway_container_state {
struct sway_container *parent;
list_t *children;
struct sway_container *focused_inactive_child;
bool focused;
// View properties
double view_x, view_y;
double view_width, view_height;
@ -132,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;
@ -144,6 +152,10 @@ struct sway_container {
bool destroying;
// If true, indicates that the container has pending state that differs from
// the current.
bool dirty;
struct {
struct wl_signal destroy;
// Raised after the tree updates, but before arrange_windows
@ -297,4 +309,30 @@ bool container_is_floating(struct sway_container *container);
*/
void container_get_box(struct sway_container *container, struct wlr_box *box);
/**
* Move a floating container by the specified amount.
*/
void container_floating_translate(struct sway_container *con,
double x_amount, double y_amount);
/**
* Move a floating container to a new layout-local position.
*/
void container_floating_move_to(struct sway_container *con,
double lx, double ly);
/**
* Mark a container as dirty if it isn't already. Dirty containers will be
* included in the next transaction then unmarked as dirty.
*/
void container_set_dirty(struct sway_container *container);
bool container_has_urgent_child(struct sway_container *container);
/**
* If the container is involved in a drag or resize operation via a mouse, this
* ends the operation.
*/
void container_end_mouse_operation(struct sway_container *container);
#endif

View file

@ -14,10 +14,11 @@ enum movement_direction {
};
enum resize_edge {
RESIZE_EDGE_LEFT,
RESIZE_EDGE_RIGHT,
RESIZE_EDGE_TOP,
RESIZE_EDGE_BOTTOM,
RESIZE_EDGE_NONE = 0,
RESIZE_EDGE_LEFT = 1,
RESIZE_EDGE_RIGHT = 2,
RESIZE_EDGE_TOP = 4,
RESIZE_EDGE_BOTTOM = 8,
};
struct sway_container;
@ -34,6 +35,8 @@ struct sway_root {
struct wl_list outputs; // sway_output::link
list_t *scratchpad; // struct sway_container
struct {
struct wl_signal new_container;
} events;

View file

@ -26,6 +26,8 @@ enum sway_view_prop {
};
struct sway_view_impl {
void (*get_constraints)(struct sway_view *view, double *min_width,
double *max_width, double *min_height, double *max_height);
const char *(*get_string_prop)(struct sway_view *view,
enum sway_view_prop prop);
uint32_t (*get_int_prop)(struct sway_view *view, enum sway_view_prop prop);
@ -35,6 +37,7 @@ struct sway_view_impl {
void (*set_tiled)(struct sway_view *view, bool tiled);
void (*set_fullscreen)(struct sway_view *view, bool fullscreen);
bool (*wants_floating)(struct sway_view *view);
bool (*has_client_side_decorations)(struct sway_view *view);
void (*for_each_surface)(struct sway_view *view,
wlr_surface_iterator_func_t iterator, void *user_data);
void (*close)(struct sway_view *view);
@ -68,6 +71,11 @@ struct sway_view {
bool border_bottom;
bool border_left;
bool border_right;
bool using_csd;
struct timespec urgent;
bool allow_request_urgent;
struct wl_event_source *urgent_timer;
bool destroying;
@ -102,6 +110,8 @@ struct sway_xdg_shell_v6_view {
struct wl_listener request_resize;
struct wl_listener request_maximize;
struct wl_listener request_fullscreen;
struct wl_listener set_title;
struct wl_listener set_app_id;
struct wl_listener new_popup;
struct wl_listener map;
struct wl_listener unmap;
@ -116,6 +126,8 @@ struct sway_xdg_shell_view {
struct wl_listener request_resize;
struct wl_listener request_maximize;
struct wl_listener request_fullscreen;
struct wl_listener set_title;
struct wl_listener set_app_id;
struct wl_listener new_popup;
struct wl_listener map;
struct wl_listener unmap;
@ -134,6 +146,7 @@ struct sway_xwayland_view {
struct wl_listener set_title;
struct wl_listener set_class;
struct wl_listener set_window_type;
struct wl_listener set_hints;
struct wl_listener map;
struct wl_listener unmap;
struct wl_listener destroy;
@ -208,6 +221,9 @@ uint32_t view_get_window_type(struct sway_view *view);
const char *view_get_shell(struct sway_view *view);
void view_get_constraints(struct sway_view *view, double *min_width,
double *max_width, double *min_height, double *max_height);
uint32_t view_configure(struct sway_view *view, double lx, double ly, int width,
int height);
@ -304,4 +320,8 @@ void view_update_marks_textures(struct sway_view *view);
*/
bool view_is_visible(struct sway_view *view);
void view_set_urgent(struct sway_view *view, bool enable);
bool view_is_urgent(struct sway_view *view);
#endif

View file

@ -10,6 +10,7 @@ struct sway_workspace {
struct sway_view *fullscreen;
struct sway_container *floating;
list_t *output_priority;
bool urgent;
};
extern char *prev_workspace_name;
@ -47,4 +48,6 @@ struct sway_container *workspace_for_pid(pid_t pid);
void workspace_record_pid(pid_t pid);
void workspace_detect_urgent(struct sway_container *workspace);
#endif