Implement stacking

This commit is contained in:
Michael Stapelberg
2009-02-24 00:30:04 +01:00
parent 6e81d1c5e4
commit 0e3a378c39
12 changed files with 215 additions and 51 deletions

View File

@ -164,6 +164,21 @@ struct Client {
SLIST_ENTRY(Client) dock_clients;
};
/*
* Contains data for the windows needed to draw the titlebars on in stacking mode
*
*/
struct Stack_Window {
xcb_window_t window;
xcb_gcontext_t gc;
uint32_t width, height;
/* Backpointer to the container this stack window is in */
Container *container;
SLIST_ENTRY(Stack_Window) stack_windows;
};
/*
* A container is either in default or stacking mode. It sits inside the table.
*
@ -186,6 +201,9 @@ struct Container {
float width_factor;
float height_factor;
/* When in stacking mode, we draw the titlebars of each client onto a separate window */
struct Stack_Window stack_win;
/* Backpointer to the workspace this container is in */
Workspace *workspace;

View File

@ -20,6 +20,7 @@
extern Display *xkbdpy;
extern TAILQ_HEAD(bindings_head, Binding) bindings;
extern SLIST_HEAD(stack_wins_head, Stack_Window) stack_wins;
extern xcb_event_handlers_t evenths;
extern char *pattern;
extern int num_screens;

View File

@ -14,7 +14,8 @@
#define _LAYOUT_H
Rect get_unoccupied_space(Workspace *workspace);
void decorate_window(xcb_connection_t *conn, Client *client);
void decorate_window(xcb_connection_t *conn, Client *client, xcb_drawable_t drawable, xcb_gcontext_t gc, int offset);
void render_container(xcb_connection_t *connection, Container *container);
void render_layout(xcb_connection_t *conn);
#endif

View File

@ -30,6 +30,7 @@ char *sstrdup(const char *str);
void start_application(const char *command);
void check_error(xcb_connection_t *connection, xcb_void_cookie_t cookie, char *err_message);
void set_focus(xcb_connection_t *conn, Client *client);
void switch_layout_mode(xcb_connection_t *conn, Container *container, int mode);
void warp_pointer_into(xcb_connection_t *connection, Client *client);
void toggle_fullscreen(xcb_connection_t *conn, Client *client);

View File

@ -29,5 +29,8 @@ enum { _NET_SUPPORTED = 0,
uint32_t get_colorpixel(xcb_connection_t *conn, xcb_window_t window, char *hex);
xcb_window_t create_window(xcb_connection_t *conn, Rect r, uint16_t window_class, uint32_t mask, uint32_t *values);
void xcb_change_gc_single(xcb_connection_t *conn, xcb_gcontext_t gc, uint32_t mask, uint32_t value);
void xcb_draw_line(xcb_connection_t *conn, xcb_drawable_t drawable, xcb_gcontext_t gc,
uint32_t colorpixel, uint32_t x, uint32_t y, uint32_t to_x, uint32_t to_y);
#endif