aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2014-09-10 20:55:41 +0000
committerDimitri Sokolyuk <demon@dim13.org>2014-09-10 20:55:41 +0000
commitb610c168ab0b5b964f72554bedd0b8c3a3365a39 (patch)
tree83a157b53e9a5fa693dc04d92937247c176f2920
parent6bb0b331d61f247f56de22c63145dee561df2a21 (diff)
move code to aux
-rw-r--r--aux.c17
-rw-r--r--aux.h1
-rw-r--r--spectrogram.c19
3 files changed, 18 insertions, 19 deletions
diff --git a/aux.c b/aux.c
index f2f2b2c..5012968 100644
--- a/aux.c
+++ b/aux.c
@@ -59,3 +59,20 @@ hide_ptr(Display *d, Window win)
XFreePixmap(d, bm);
XFreeColors(d, cmap, &black.pixel, 1, 0);
}
+
+void
+move(Display *d, Window win, Window container)
+{
+ XWindowAttributes wa, wac;
+ int dx, dy;
+
+ XGetWindowAttributes(d, win, &wa);
+ XGetWindowAttributes(d, container, &wac);
+
+ dx = (wa.width - wac.width) / 2;
+ dy = (wa.height - wac.height) / 2;
+ if (dy < 0)
+ dy = 0;
+
+ XMoveWindow(d, container, dx, dy);
+}
diff --git a/aux.h b/aux.h
index ecd378a..4f731b4 100644
--- a/aux.h
+++ b/aux.h
@@ -21,6 +21,7 @@
__BEGIN_DECLS
void fullscreen(Display *, Window);
void hide_ptr(Display *, Window);
+void move(Display *, Window, Window);
__END_DECLS
#endif
diff --git a/spectrogram.c b/spectrogram.c
index 9886152..96683a1 100644
--- a/spectrogram.c
+++ b/spectrogram.c
@@ -376,25 +376,6 @@ free_panel(Display *d, struct panel *p)
free(p);
}
-int
-move(Display *dsp, Window win, Window container)
-{
- int dx, dy;
- XWindowAttributes wa, wac;
-
- XGetWindowAttributes(dsp, win, &wa);
- XGetWindowAttributes(dsp, container, &wac);
-
- dx = (wa.width - wac.width) / 2;
- dy = (wa.height - wac.height) / 2;
- if (dy < 0)
- dy = 0;
-
- XMoveWindow(dsp, container, dx, dy);
-
- return 0;
-}
-
int
main(int argc, char **argv)
{