aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--action.c36
-rw-r--r--action.h12
-rw-r--r--draw.c8
-rw-r--r--dzen.h7
-rw-r--r--main.c29
-rw-r--r--util.c10
6 files changed, 38 insertions, 64 deletions
diff --git a/action.c b/action.c
index b6cf852..24a9753 100644
--- a/action.c
+++ b/action.c
@@ -1,7 +1,8 @@
/*
-* (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com>
-* See LICENSE file for license details.
-*/
+ * (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com>
+ * See LICENSE file for license details.
+ *
+ */
#include "dzen.h"
#include "action.h"
@@ -11,8 +12,6 @@
struct event_lookup ev_lookup_table[] = {
- { "exposet", exposetitle},
- { "exposes", exposeslave},
{ "onstart", onstart},
{ "onexit", onexit},
{ "button1", button1},
@@ -30,8 +29,6 @@ struct event_lookup ev_lookup_table[] = {
};
struct action_lookup ac_lookup_table[] = {
- { "exposetitle", a_exposetitle},
- { "exposeslave", a_exposeslave},
{ "print", a_print },
{ "exec", a_exec},
{ "exit", a_exit},
@@ -158,31 +155,14 @@ fill_ev_table(char *input)
/* actions */
-
-/* used internally */
-int
-a_exposetitle(char * opt[]) {
- XCopyArea(dzen.dpy, dzen.title_win.drawable, dzen.title_win.win,
- dzen.gc, 0, 0, dzen.title_win.width, dzen.line_height, 0, 0);
- return 0;
-}
-
-/* used internally */
int
-a_exposeslave(char * opt[]) {
- x_draw_body();
+a_exit(char * opt[]) {
+ if(opt[0])
+ dzen.ret_val = atoi(opt[0]);
+ dzen.running = False;
return 0;
}
-/* user selectable actions */
-int
- a_exit(char * opt[]) {
- if(opt[0])
- dzen.ret_val = atoi(opt[0]);
- dzen.running = False;
- return 0;
- }
-
int
a_collapse(char * opt[]){
int i;
diff --git a/action.h b/action.h
index f12fc34..0d7135c 100644
--- a/action.h
+++ b/action.h
@@ -1,8 +1,8 @@
/*
-* (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com>
-* See LICENSE file for license details.
-*
-*/
+ * (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com>
+ * See LICENSE file for license details.
+ *
+ */
#define MAXEVENTS 32
#define MAXACTIONS 64
@@ -13,8 +13,6 @@ typedef struct AS As;
typedef struct EV Ev;
enum ev_id {
- /* internal events, should not be used by the user */
- exposetitle, exposeslave,
/* startup, exit */
onstart, onexit,
/* mouse buttons */
@@ -55,8 +53,6 @@ void fill_ev_table(char *);
void free_ev_table(void);
/* action handlers */
-int a_exposetitle(char **);
-int a_exposeslave(char **);
int a_print(char **);
int a_exit(char **);
int a_exec(char **);
diff --git a/draw.c b/draw.c
index 0af693b..79d2dd2 100644
--- a/draw.c
+++ b/draw.c
@@ -1,7 +1,9 @@
/*
-* (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com>
-* See LICENSE file for license details.
-*/
+ * (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com>
+ * See LICENSE file for license details.
+ *
+ */
+
#include "dzen.h"
#include <stdio.h>
#include <string.h>
diff --git a/dzen.h b/dzen.h
index 8a51481..ad98e70 100644
--- a/dzen.h
+++ b/dzen.h
@@ -1,7 +1,8 @@
/*
-* (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com>
-* See LICENSE file for license details.
-*/
+ * (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com>
+ * See LICENSE file for license details.
+ *
+ */
#include <X11/Xlib.h>
#include <X11/Xutil.h>
diff --git a/main.c b/main.c
index af5128b..b393373 100644
--- a/main.c
+++ b/main.c
@@ -1,8 +1,9 @@
/*
-* (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com>
-* See LICENSE file for license details.
-*
-*/
+ * (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com>
+ * See LICENSE file for license details.
+ *
+ */
+
#include "dzen.h"
#include "action.h"
@@ -401,12 +402,11 @@ handle_xev(void) {
&& ev.xexpose.window == dzen.title_win.win)
drawheader(NULL);
if(ev.xexpose.window == dzen.slave_win.win)
- do_action(exposeslave);
+ x_draw_body();;
for(i=0; i < dzen.slave_win.max_lines; i++)
if(ev.xcrossing.window == dzen.slave_win.line[i])
- do_action(exposeslave);
+ x_draw_body();
}
- XSync(dzen.dpy, False);
break;
case EnterNotify:
if(dzen.slave_win.ismenu) {
@@ -419,7 +419,6 @@ handle_xev(void) {
do_action(entertitle);
if(ev.xcrossing.window == dzen.slave_win.win)
do_action(enterslave);
- XSync(dzen.dpy, False);
break;
case LeaveNotify:
if(dzen.slave_win.ismenu) {
@@ -433,7 +432,6 @@ handle_xev(void) {
if(ev.xcrossing.window == dzen.slave_win.win) {
do_action(leaveslave);
}
- XSync(dzen.dpy, False);
break;
case ButtonRelease:
if(dzen.slave_win.ismenu) {
@@ -458,10 +456,8 @@ handle_xev(void) {
do_action(button5);
break;
}
- XSync(dzen.dpy, False);
break;
}
- XFlush(dzen.dpy);
}
static void
@@ -480,7 +476,7 @@ handle_newl(void) {
x_draw_body();
}
/* forget state if window was unmapped */
- else if(wa.map_state == IsUnmapped || !dzen.slave_win.last_line_vis) {
+ if(wa.map_state == IsUnmapped || !dzen.slave_win.last_line_vis) {
dzen.slave_win.first_line_vis = 0;
dzen.slave_win.last_line_vis = 0;
}
@@ -669,13 +665,10 @@ main(int argc, char *argv[]) {
if(!setlocale(LC_ALL, "") || !XSupportsLocale())
puts("dzen: locale not available, expect problems with fonts.\n");
- if(action_string) {
- char edef[] = "exposet=exposetitle;exposes=exposeslave";
- fill_ev_table(edef);
+ if(action_string)
fill_ev_table(action_string);
- } else {
- char edef[] = "exposet=exposetitle;exposes=exposeslave;"
- "entertitle=uncollapse;leaveslave=collapse;"
+ else {
+ char edef[] = "entertitle=uncollapse;leaveslave=collapse;"
"button1=menuexec;button2=togglestick;button3=exit:13;"
"button4=scrollup;button5=scrolldown";
fill_ev_table(edef);
diff --git a/util.c b/util.c
index 2039bc2..dc86b1c 100644
--- a/util.c
+++ b/util.c
@@ -1,7 +1,9 @@
-/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
-* (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com>
-* See LICENSE file for license details.
-*/
+/*
+ * (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
+ * (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com>
+ * See LICENSE file for license details.
+ *
+ */
#include "dzen.h"
#include <stdarg.h>