Don’t rely on libxcb-wm any longer, as it got removed in libxcb 0.3.4

See http://cgit.freedesktop.org/xcb/util/commit/?id=4c9a707f472e49bc3005354db265a0214071d46b
This commit is contained in:
Michael Stapelberg
2009-04-19 20:44:34 +02:00
parent 22e0ea5141
commit 982e453251
7 changed files with 114 additions and 25 deletions

View File

@ -11,6 +11,7 @@
*
*/
#include <xcb/xcb.h>
#include <xcb/xcb_atom.h>
#include <stdbool.h>
#ifndef _DATA_H
@ -116,6 +117,25 @@ struct Ignore_Event {
SLIST_ENTRY(Ignore_Event) ignore_events;
};
/*
* Emulates the behaviour of tables of libxcb-wm, which in libxcb 0.3.4 suddenly vanished.
*
*/
struct keyvalue_element {
uint32_t key;
void *value;
TAILQ_ENTRY(keyvalue_element) elements;
};
typedef struct {
enum xcb_atom_fast_tag_t tag;
union {
xcb_get_window_attributes_cookie_t cookie;
uint8_t override_redirect;
} u;
} window_attributes_t;
/******************************************************************************
* Major types
*****************************************************************************/

View File

@ -9,11 +9,13 @@
*
*/
#include <xcb/xcb.h>
#include <xcb/xcb_property.h>
#include <xcb/xcb_event.h>
#include <X11/XKBlib.h>
#include "queue.h"
#include "data.h"
#ifndef _I3_H
#define _I3_H
@ -28,4 +30,9 @@ extern xcb_event_handlers_t evenths;
extern int num_screens;
extern xcb_atom_t atoms[NUM_ATOMS];
void manage_window(xcb_property_handlers_t *prophs, xcb_connection_t *conn, xcb_window_t window, window_attributes_t wa);
void reparent_window(xcb_connection_t *conn, xcb_window_t child,
xcb_visualid_t visual, xcb_window_t root, uint8_t depth,
int16_t x, int16_t y, uint16_t width, uint16_t height);
#endif

View File

@ -36,6 +36,9 @@ while (0)
delete the preceding comma */
#define LOG(fmt, ...) slog("%s:%s:%d - " fmt, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__)
TAILQ_HEAD(keyvalue_table_head, keyvalue_element);
extern struct keyvalue_table_head by_parent;
extern struct keyvalue_table_head by_child;
int min(int a, int b);
int max(int a, int b);
@ -74,6 +77,24 @@ void *scalloc(size_t size);
*/
char *sstrdup(const char *str);
/**
* Inserts an element into the given keyvalue-table using the given key.
*
*/
bool table_put(struct keyvalue_table_head *head, uint32_t key, void *value);
/**
* Removes the element from the given keyvalue-table with the given key and returns its value;
*
*/
void *table_remove(struct keyvalue_table_head *head, uint32_t key);
/**
* Returns the value of the element of the given keyvalue-table with the given key.
*
*/
void *table_get(struct keyvalue_table_head *head, uint32_t key);
/**
* Starts the given application by passing it through a shell. We use double fork
* to avoid zombie processes. As the started applications parent exits (immediately),