diff options
author | gotmor <gotmor@f2baff5b-bf2c-0410-a398-912abdc3d8b2> | 2007-07-01 22:11:43 +0000 |
---|---|---|
committer | gotmor <gotmor@f2baff5b-bf2c-0410-a398-912abdc3d8b2> | 2007-07-01 22:11:43 +0000 |
commit | 445d958902177390320e2d5bc384e7fb47afdeaf (patch) | |
tree | 09369fca3c788eef89684b62f53b7d5055fc375a | |
parent | e1c6a8acab10f0c21f42e739598fd4af913d00a7 (diff) | |
download | dzen-445d958902177390320e2d5bc384e7fb47afdeaf.tar.gz dzen-445d958902177390320e2d5bc384e7fb47afdeaf.zip |
added "onnewinput" event
git-svn-id: http://dzen.googlecode.com/svn/trunk@117 f2baff5b-bf2c-0410-a398-912abdc3d8b2
-rw-r--r-- | README | 1 | ||||
-rw-r--r-- | action.c | 9 | ||||
-rw-r--r-- | action.h | 4 | ||||
-rw-r--r-- | main.c | 3 |
4 files changed, 11 insertions, 6 deletions
@@ -159,6 +159,7 @@ Supported events: onstart Perform actions right after startup onexit Perform actions just before exiting + onnewinput Perform actions if there is new input for the slave window button1 Mouse button1 released button2 Mouse button2 released button3 Mouse button3 released @@ -14,6 +14,7 @@ struct event_lookup ev_lookup_table[] = { { "onstart", onstart}, { "onexit", onexit}, + { "onnewinput", onnewinput}, { "button1", button1}, { "button2", button2}, { "button3", button3}, @@ -25,7 +26,7 @@ struct event_lookup ev_lookup_table[] = { { "leaveslave", leaveslave}, { "sigusr1", sigusr1}, { "sigusr2", sigusr2}, - { "keymarker", keymarker}, + { "keymarker", keymarker}, { 0, 0 } }; @@ -47,9 +48,9 @@ struct action_lookup ac_lookup_table[] = { { "raise", a_raise}, { "lower", a_lower}, { "scrollhome", a_scrollhome}, - { "scrollend", a_scrollend}, - { "grabkeys", a_grabkeys}, - { "ungrabkeys", a_ungrabkeys}, + { "scrollend", a_scrollend}, + { "grabkeys", a_grabkeys}, + { "ungrabkeys", a_ungrabkeys}, { 0, 0 } }; @@ -13,8 +13,8 @@ typedef struct _ev_list ev_list; typedef int handlerf(char **); enum ev_id { - /* startup, exit */ - onstart, onexit, + /* startup, exit, input */ + onstart, onexit, onnewinput, /* mouse buttons */ button1, button2, button3, button4, button5, /* entering/leaving windows */ @@ -515,7 +515,10 @@ static void handle_newl(void) { XWindowAttributes wa; + if(dzen.slave_win.max_lines && (dzen.slave_win.tcnt > last_cnt)) { + do_action(onnewinput); + if (XGetWindowAttributes(dzen.dpy, dzen.slave_win.win, &wa), wa.map_state != IsUnmapped /* autoscroll and redraw only if we're |