dvtm

dynamic virtual terminal manager - with my changes
git clone https://pi.duncano.de/git/dvtm.git
Log | Files | Refs | README | LICENSE

commit 1167b9201e610c8014fba3a247865df8256bd39b
parent a0090ce51da71ac76e1e1a57a49ed7c450f7f0a0
Author: Marc Andre Tanner <mat@brain-dump.org>
Date:   Thu, 26 May 2011 20:20:40 +0200

Remove CONFIG_MOUSE enable it by default

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>

Diffstat:
config.h | 4----
config.mk | 2--
dvtm.c | 17+++--------------
3 files changed, 3 insertions(+), 20 deletions(-)

diff --git a/config.h b/config.h @@ -72,9 +72,7 @@ Key keys[] = { { MOD, 'l', { setmwfact, { "+0.05" } } }, { MOD, '.', { toggleminimize, { NULL } } }, { MOD, 's', { togglebar, { NULL } } }, -#ifdef CONFIG_MOUSE { MOD, 'M', { mouse_toggle, { NULL } } }, -#endif { MOD, '\n', { zoom , { NULL } } }, { MOD, '1', { focusn, { "1" } } }, { MOD, '2', { focusn, { "2" } } }, @@ -132,14 +130,12 @@ static const ColorRule colorrules[] = { * REPORT_MOUSE_POSITION report mouse movement */ -#ifdef CONFIG_MOUSE Button buttons[] = { { BUTTON1_CLICKED, { mouse_focus, { NULL } } }, { BUTTON1_DOUBLE_CLICKED, { mouse_fullscreen, { "[ ]" } } }, { BUTTON2_CLICKED, { mouse_zoom, { NULL } } }, { BUTTON3_CLICKED, { mouse_minimize, { NULL } } }, }; -#endif /* CONFIG_MOUSE */ #ifdef CONFIG_CMDFIFO Cmd commands[] = { diff --git a/config.mk b/config.mk @@ -13,8 +13,6 @@ LIBS = -lc -lutil -lncursesw CFLAGS += -std=c99 -Os ${INCS} -DVERSION=\"${VERSION}\" -DNDEBUG LDFLAGS += -L/usr/lib -L/usr/local/lib ${LIBS} -# Mouse handling -CFLAGS += -DCONFIG_MOUSE #CFLAGS += -DCONFIG_CMDFIFO DEBUG_CFLAGS = ${CFLAGS} -UNDEBUG -O0 -g -ggdb -Wall diff --git a/dvtm.c b/dvtm.c @@ -89,12 +89,10 @@ typedef struct { Action action; } Key; -#ifdef CONFIG_MOUSE typedef struct { mmask_t mask; Action action; } Button; -#endif #ifdef CONFIG_CMDFIFO typedef struct { @@ -139,13 +137,11 @@ static void togglerunall(const char *args[]); enum { ALIGN_LEFT, ALIGN_RIGHT }; static void togglebar(const char *args[]); -#ifdef CONFIG_MOUSE static void mouse_focus(const char *args[]); static void mouse_fullscreen(const char *args[]); static void mouse_minimize(const char *args[]); static void mouse_zoom(const char *args[]); static void mouse_toggle(); -#endif static void clear_workspace(); static void draw(Client *c); @@ -174,15 +170,13 @@ static int width, height, scroll_buf_size = SCROLL_BUF_SIZE; static bool running = true; static bool runinall = false; -#ifdef CONFIG_MOUSE -# include "mouse.c" -#endif +#include "mouse.c" #ifdef CONFIG_CMDFIFO # include "cmdfifo.c" #endif -# include "statusbar.c" +#include "statusbar.c" static void eprint(const char *errstr, ...) { @@ -860,9 +854,7 @@ setup() { start_color(); noecho(); keypad(stdscr, TRUE); -#ifdef CONFIG_MOUSE mouse_setup(); -#endif raw(); madtty_init(); getmaxyx(stdscr, height, width); @@ -1062,12 +1054,9 @@ main(int argc, char *argv[]) { int code = getch(); Key *key; if (code >= 0) { -#ifdef CONFIG_MOUSE if (code == KEY_MOUSE) { handle_mouse(); - } else -#endif /* CONFIG_MOUSE */ - if (is_modifier(code)) { + } else if (is_modifier(code)) { int mod = code; code = getch(); if (code >= 0) {