aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hcalc.h3
-rw-r--r--input.c2
-rw-r--r--setupx.c8
3 files changed, 10 insertions, 3 deletions
diff --git a/hcalc.h b/hcalc.h
index f04d0a9..44d4cc0 100644
--- a/hcalc.h
+++ b/hcalc.h
@@ -53,9 +53,10 @@ void button(int b, int x, int y);
void complete_paste(unsigned char *s, int n);
void send_current_display(void);
void setup_x(void);
+void shutdown_x(void);
void free_pixmaps(void);
void load_pixmaps(void);
-void process_input();
+void process_input(void);
void load_config(void);
void save_config(void);
void show_value(void);
diff --git a/input.c b/input.c
index ba15f07..561b97e 100644
--- a/input.c
+++ b/input.c
@@ -433,7 +433,7 @@ void key(char c) {
winsize++;
if(winsize == 3) winsize = 0;
free_pixmaps();
- XCloseDisplay(display);
+ shutdown_x();
setup_x();
load_pixmaps();
show_value();
diff --git a/setupx.c b/setupx.c
index 4f4f583..c103f64 100644
--- a/setupx.c
+++ b/setupx.c
@@ -92,7 +92,13 @@ void setup_x(void) {
bit_off = color.pixel;
}
-void process_input() {
+void shutdown_x(void) {
+ XDestroyWindow(display, window);
+ XFreeGC(display, gc);
+ XCloseDisplay(display);
+}
+
+void process_input(void) {
char c;
KeySym keysym;
XTextProperty tprop;