Correctly handle _NET_WM_WINDOW_TYPE == _NET_WM_WINDOW_TYPE_DOCK (for dzen2 -dock)

This commit is contained in:
Michael Stapelberg
2009-02-23 00:18:13 +01:00
parent a19072b714
commit 1a0817eb39
8 changed files with 162 additions and 37 deletions

View File

@ -63,6 +63,9 @@ struct Workspace {
Client *fullscreen_client;
/* Contains all clients with _NET_WM_WINDOW_TYPE == _NET_WM_WINDOW_TYPE_DOCK */
SLIST_HEAD(dock_clients_head, Client) dock_clients;
/* Backpointer to the screen this workspace is on */
i3Screen *screen;
@ -125,6 +128,10 @@ struct Client {
/* x, y, width, height */
Rect rect;
/* Height which was determined by reading the _NET_WM_STRUT_PARTIAL top/bottom of the screen
reservation */
int desired_height;
/* Name */
char *name;
int name_len;
@ -132,6 +139,12 @@ struct Client {
/* fullscreen is pretty obvious */
bool fullscreen;
enum { TITLEBAR_TOP = 0, TITLEBAR_LEFT, TITLEBAR_RIGHT, TITLEBAR_BOTTOM, TITLEBAR_OFF } titlebar_position;
/* If a client is set as a dock, it is placed at the very bottom of the screen and its
requested size is used */
bool dock;
/* After leaving fullscreen mode, a client needs to be reconfigured (configuration =
setting X, Y, width and height). By setting the force_reconfigure flag, render_layout()
will reconfigure the client. */
@ -148,6 +161,7 @@ struct Client {
/* The following entry provides the necessary list pointers to use Client with LIST_* macros */
CIRCLEQ_ENTRY(Client) clients;
SLIST_ENTRY(Client) dock_clients;
};
/*

View File

@ -20,5 +20,6 @@ int handle_windowname_change(void *data, xcb_connection_t *conn, uint8_t state,
xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *prop);
int handle_expose_event(void *data, xcb_connection_t *conn, xcb_expose_event_t *event);
int handle_client_message(void *data, xcb_connection_t *conn, xcb_client_message_event_t *event);
int window_type_handler(void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *property);
#endif

View File

@ -23,6 +23,6 @@ extern TAILQ_HEAD(bindings_head, Binding) bindings;
extern xcb_event_handlers_t evenths;
extern char *pattern;
extern int num_screens;
extern xcb_atom_t atoms[6];
extern xcb_atom_t atoms[9];
#endif

View File

@ -16,11 +16,15 @@
#define _NET_WM_STATE_TOGGLE 2
enum { _NET_SUPPORTED = 0,
_NET_SUPPORTING_WM_CHECK = 1,
_NET_WM_NAME = 2,
_NET_WM_STATE_FULLSCREEN = 3,
_NET_WM_STATE = 4,
UTF8_STRING = 5
_NET_SUPPORTING_WM_CHECK,
_NET_WM_NAME,
_NET_WM_STATE_FULLSCREEN,
_NET_WM_STATE,
_NET_WM_WINDOW_TYPE,
_NET_WM_WINDOW_TYPE_DOCK,
_NET_WM_DESKTOP,
_NET_WM_STRUT_PARTIAL,
UTF8_STRING
};
uint32_t get_colorpixel(xcb_connection_t *conn, xcb_window_t window, char *hex);