feat: add composable window snapping
This commit is contained in:
@@ -62,6 +62,26 @@ typedef enum {
|
||||
CLIENT_MAXIMIZED = (1 << 5)
|
||||
} ClientFlags;
|
||||
|
||||
typedef enum {
|
||||
SNAP_H_NONE = 0,
|
||||
SNAP_H_LEFT,
|
||||
SNAP_H_RIGHT,
|
||||
SNAP_H_FULL
|
||||
} SnapHorizontal;
|
||||
|
||||
typedef enum {
|
||||
SNAP_V_NONE = 0,
|
||||
SNAP_V_TOP,
|
||||
SNAP_V_BOTTOM,
|
||||
SNAP_V_FULL
|
||||
} SnapVertical;
|
||||
|
||||
typedef struct {
|
||||
SnapHorizontal horizontal;
|
||||
SnapVertical vertical;
|
||||
long timestamp;
|
||||
} SnapConstraint;
|
||||
|
||||
typedef struct Client Client;
|
||||
typedef struct Workspace Workspace;
|
||||
typedef struct Monitor Monitor;
|
||||
@@ -80,6 +100,7 @@ struct Client {
|
||||
unsigned int workspace;
|
||||
char title[256];
|
||||
char class[64];
|
||||
SnapConstraint snap;
|
||||
Client *next;
|
||||
Client *prev;
|
||||
Client *mru_next;
|
||||
|
||||
@@ -83,6 +83,8 @@ void key_show_shortcuts(void);
|
||||
void key_start_tutorial(void);
|
||||
void key_snap_left(void);
|
||||
void key_snap_right(void);
|
||||
void key_snap_up(void);
|
||||
void key_snap_down(void);
|
||||
void key_start_demo(void);
|
||||
|
||||
void tutorial_start(void);
|
||||
|
||||
@@ -17,6 +17,9 @@ void layout_arrange_monocle(int workspace);
|
||||
int layout_get_usable_area(int *x, int *y, int *width, int *height);
|
||||
int layout_count_tiled_clients(int workspace);
|
||||
|
||||
void layout_apply_snap_constraint(Client *c, int area_x, int area_y,
|
||||
int area_w, int area_h, int gap);
|
||||
|
||||
const char *layout_get_name(LayoutType layout);
|
||||
const char *layout_get_symbol(LayoutType layout);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user