--- ../dvtm-0.4.orig/dvtm.c 2008-02-16 12:09:13.191369197 +0100 +++ dvtm.c 2008-02-16 12:13:44.352315696 +0100 @@ -71,10 +71,12 @@ Action action; } Key; +#if defined(HANDLE_MOUSE) typedef struct { mmask_t mask; Action action; } Button; +#endif /* HANDLE_MOUSE */ enum { BarTop, BarBot, BarOff }; @@ -106,11 +108,14 @@ void setlayout(const char *args[]); void redraw(const char *args[]); void zoom(const char *args[]); + +#if defined(HANDLE_MOUSE) /* special mouse related commands */ void mouse_focus(const char *args[]); void mouse_fullscreen(const char *args[]); void mouse_minimize(const char *args[]); void mouse_zoom(const char *args[]); +#endif /* HANDLE_MOUSE */ void clear_workspace(); void draw_all(bool border); @@ -669,6 +674,7 @@ return NULL; } +#if defined(HANDLE_MOUSE) void mouse_focus(const char *args[]){ focus(msel); @@ -727,6 +733,7 @@ buttons[i].action.cmd(buttons[i].action.args); msel = NULL; } +#endif /* HANDLE_MOUSE */ Client* get_client_by_pid(pid_t pid){ @@ -802,10 +809,14 @@ start_color(); noecho(); keypad(stdscr, TRUE); + +#if defined(HANDLE_MOUSE) for(i = 0, mask = 0; i < countof(buttons); i++) mask |= buttons[i].mask; if(mask) mousemask(mask, NULL); +#endif /* HANDLE_MOUSE */ + raw(); madtty_init_colors(); madtty_init_vt100_graphics(); @@ -931,9 +942,12 @@ int code = getch(); Key *key; if(code >= 0){ +#if defined(HANDLE_MOUSE) if(code == KEY_MOUSE){ handle_mouse(); - } else if(is_modifier(code)){ + } else +#endif /* HANDLE_MOUSE */ + if(is_modifier(code)){ int mod = code; code = getch(); if(code >= 0){ --- ../dvtm-0.4.orig/config.h 2008-02-16 12:09:13.191369197 +0100 +++ config.h 2008-02-16 12:13:45.072360697 +0100 @@ -116,12 +116,14 @@ * REPORT_MOUSE_POSITION report mouse movement */ +#if defined(HANDLE_MOUSE) Button buttons[] = { { BUTTON1_CLICKED, { mouse_focus, { NULL } } }, { BUTTON1_DOUBLE_CLICKED, { mouse_fullscreen, { "[ ]" } } }, { BUTTON2_CLICKED, { mouse_zoom, { NULL } } }, { BUTTON3_CLICKED, { mouse_minimize, { NULL } } }, }; +#endif /* HANDLE_MOUSE */ /* gets executed when dvtm is started */ Action actions[] = { --- ../dvtm-0.4.orig/config.mk 2008-02-16 12:09:13.191369197 +0100 +++ config.mk 2008-02-16 12:13:52.912850695 +0100 @@ -13,6 +13,12 @@ CFLAGS = -std=c99 -Os ${INCS} -DVERSION=\"${VERSION}\" -DNDEBUG LDFLAGS = -L/usr/lib -L/usr/local/lib ${LIBS} +# Debug informations +#CFLAGS += -DNDEBUG + +# Mouse handling +#CFLAGS += -DHANDLE_MOUSE + DEBUG_CFLAGS = -std=c99 -O0 -g -ggdb ${INCS} -Wall -DVERSION=\"${VERSION}\" CC = cc