mirror of
https://github.com/dylanaraps/sowm.git
synced 2025-05-19 01:20:23 -07:00
add globals for connection/screen
This commit is contained in:
parent
d1535393aa
commit
136c30403b
2
Makefile
2
Makefile
@ -9,7 +9,7 @@ ALL_LDFLAGS = $(LDFLAGS) $(LIBS) -lxcb
|
||||
CC = cc
|
||||
|
||||
OBJ = src/event.o src/sowm.o
|
||||
HDR = src/event.h
|
||||
HDR = src/event.h src/globals.h
|
||||
|
||||
.c.o:
|
||||
$(CC) $(ALL_CFLAGS) -c -o $@ $<
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "globals.h"
|
||||
#include "event.h"
|
||||
|
||||
void (*events[XCB_NO_OPERATION])(xcb_generic_event_t *) = {
|
||||
@ -11,9 +12,13 @@ void (*events[XCB_NO_OPERATION])(xcb_generic_event_t *) = {
|
||||
[XCB_MOTION_NOTIFY] = event_notify_motion
|
||||
};
|
||||
|
||||
/* todo */
|
||||
void event_button_press(xcb_generic_event_t *ev) { }
|
||||
void event_button_release(xcb_generic_event_t *ev) { }
|
||||
|
||||
void event_button_release(xcb_generic_event_t *ev) {
|
||||
xcb_ungrab_pointer(dpy, XCB_CURRENT_TIME);
|
||||
xcb_flush(dpy);
|
||||
}
|
||||
|
||||
void event_configure_request(xcb_generic_event_t *ev) { }
|
||||
void event_key_press(xcb_generic_event_t *ev) { }
|
||||
void event_notify_create(xcb_generic_event_t *ev) { }
|
||||
|
@ -1,6 +1,3 @@
|
||||
#ifndef SOWM_EVENT_H_INCLUDED
|
||||
#define SOWM_EVENT_H_INCLUDED
|
||||
|
||||
#include <xcb/xcb.h>
|
||||
|
||||
void event_button_press(xcb_generic_event_t *ev);
|
||||
@ -13,5 +10,3 @@ void event_notify_enter(xcb_generic_event_t *ev);
|
||||
void event_notify_motion(xcb_generic_event_t *ev);
|
||||
|
||||
extern void (*events[XCB_NO_OPERATION])(xcb_generic_event_t *);
|
||||
|
||||
#endif
|
||||
|
4
src/globals.h
Normal file
4
src/globals.h
Normal file
@ -0,0 +1,4 @@
|
||||
#include <xcb/xcb.h>
|
||||
|
||||
extern xcb_connection_t *dpy;
|
||||
extern xcb_screen_t *scr;
|
@ -5,13 +5,14 @@
|
||||
#include <xcb/xcb.h>
|
||||
|
||||
#include "event.h"
|
||||
|
||||
static xcb_connection_t *dpy;
|
||||
static xcb_screen_t *scr;
|
||||
#include "globals.h"
|
||||
|
||||
static void init_wm(void);
|
||||
static void init_input(void);
|
||||
|
||||
xcb_connection_t *dpy;
|
||||
xcb_screen_t *scr;
|
||||
|
||||
static void init_wm(void) {
|
||||
uint32_t values[2];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user