Skip to content

Commit

Permalink
mouse support. not ready for day-to-day usage yet (no config options)
Browse files Browse the repository at this point in the history
  • Loading branch information
tudurom committed Aug 9, 2017
1 parent 6cc1f91 commit 7056d49
Show file tree
Hide file tree
Showing 5 changed files with 389 additions and 4 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,17 @@ If you want to use window rules, a feature that windowchef lacks, you can use
Dependencies
------------

* `xcb`
* `xcb-randr`
* `xcb-util-wm`
* `xcb-keysyms`
* `libX11` (headers only)

Windowchef depends on `xcb` to communicate with the X11 server, `xcb-randr` to
gather information about connected displays and `xcb-util-wm` for ewmh and icccm helper functions.

`xcb-keysyms` and the headers of `libX11` are required for mouse support.

I couldn't find compiled documentation for `xcb-util-wm` so I compiled it and
put it on my website [here](https://tudorr.xyz/res/).

Expand Down
11 changes: 11 additions & 0 deletions config.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,15 @@
/* if true, apply settings on windows when they are set (like border color, border width) */
#define APPLY_SETTINGS true

/* default pointer actions */
#define DEFAULT_LEFT_BUTTON_ACTION POINTER_ACTION_MOVE
#define DEFAULT_MIDDLE_BUTTON_ACTION POINTER_ACTION_RESIZE_SIDE
#define DEFAULT_RIGHT_BUTTON_ACTION POINTER_ACTION_RESIZE_CORNER

/* default pointer modifier (super key) */
#define POINTER_MODIFIER XCB_MOD_MASK_4

/* default mouse button for click to focus. -1 for none */
#define CLICK_TO_FOCUS_BUTTON 0

#endif
2 changes: 1 addition & 1 deletion config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ MANDIR = $(MANPREFIX)/man1
DOCPREFIX = $(PREFIX)/share/doc

CFLAGS += -std=c99 -Wall -Wextra -O2
LDFLAGS += -lm -lxcb -lxcb-ewmh -lxcb-icccm -lxcb-randr
LDFLAGS += -lm -lxcb -lxcb-ewmh -lxcb-icccm -lxcb-randr -lxcb-keysyms
23 changes: 23 additions & 0 deletions types.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,26 @@ enum mouse_mode {
MOUSE_RESIZE,
};

enum pointer_action {
POINTER_ACTION_NOTHING,
POINTER_ACTION_FOCUS,
POINTER_ACTION_MOVE,
POINTER_ACTION_RESIZE_CORNER,
POINTER_ACTION_RESIZE_SIDE,
};

enum resize_handle {
HANDLE_LEFT,
HANDLE_BOTTOM,
HANDLE_TOP,
HANDLE_RIGHT,

HANDLE_TOP_LEFT,
HANDLE_TOP_RIGHT,
HANDLE_BOTTOM_LEFT,
HANDLE_BOTTOM_RIGHT,
};

struct win_position {
int16_t x, y;
};
Expand Down Expand Up @@ -78,6 +98,9 @@ struct conf {
bool borders;
bool last_window_focusing;
bool apply_settings;
enum pointer_action pointer_actions[3];
uint16_t pointer_modifier;
int8_t click_to_focus;
};

#endif
Loading

0 comments on commit 7056d49

Please sign in to comment.