From 9a098cf5f3c12fc9837e162b6da1daab156d9136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Stelmach?= Date: Fri, 22 Apr 2016 21:57:57 +0200 Subject: [PATCH] Let's say it's 1.0 --- .gitignore | 5 +++++ Makefile | 2 +- Xystray.c | 14 +++++++------- xystray.c | 4 ++-- 4 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4f9e4ce --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*~ +*.swp +.\#* +\#*\# +xystray diff --git a/Makefile b/Makefile index 6515b0f..d265db0 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -LDFLAGS=-lXt -L/usr/X11/lib +LDFLAGS=-lX11 -lXt -L/usr/X11/lib xystray: Xystray.o xystray.o $(CC) $(LDFLAGS) $^ -o $@ diff --git a/Xystray.c b/Xystray.c index beefb62..e6fa5b7 100644 --- a/Xystray.c +++ b/Xystray.c @@ -1,3 +1,5 @@ +#include +#include #include #include #include @@ -75,10 +77,10 @@ XystrayClassRec xystrayClassRec = { /* num_actions */ 0, /* resources */ resources, /* resource_count */ XtNumber(resources), - /* xrm_class */ NULLQUARK, + /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeCompressMaximal, - /* compress_enterleave */ TRUE, + /* compress_enterleave */ TRUE, /* visible_interest */ FALSE, /* destroy */ XWtDestroy, /* resize */ NULL, @@ -96,7 +98,7 @@ XystrayClassRec xystrayClassRec = { /* extension */ NULL }, { 0 } }; - + WidgetClass xystrayWidgetClass = (WidgetClass) &xystrayClassRec; static void @@ -281,7 +283,6 @@ XWtEventHandler(Widget gw, XPointer xptr, XEvent* xev, Boolean* cont) { } static void XWtRecvMessage(XystrayWidget xys, XClientMessageEvent* xev) { - Atom selection_msg = xys->xystray.selection_atom; /*XXX: potrzebne?*/ Atom opcode_msg = xys->xystray.opcode_atom; Atom data_msg = xys->xystray.data_atom; @@ -319,10 +320,9 @@ static void XWtRecvMessage(XystrayWidget xys, XClientMessageEvent* xev) { if (xev->format != 8) { return; } - printf("Data Message: (%d)%s\n", xev->message_type,b); - + printf("Data Message: (%d)%s\n", (int)xev->message_type,b); } else { - printf("Unknown Message: (%d)%s\n", xev->message_type,b); + printf("Unknown Message: (%d)%s\n", (int)xev->message_type,b); } XFree(b); return; diff --git a/xystray.c b/xystray.c index f4b1391..f9dbd77 100644 --- a/xystray.c +++ b/xystray.c @@ -65,7 +65,7 @@ void sigint(XtPointer topwidget, XtSignalId* sig) { XtDestroyWidget(tw); XtDestroyApplicationContext(XtWidgetToApplicationContext(tw)); exit(0); -} +} static void quit(Widget w, XEvent *event, String *params, Cardinal *num_params) { @@ -115,7 +115,7 @@ main (int argc, char *argv[]) NULL); XtAppAddActions (app_con, xysact, XtNumber(xysact)); - XtOverrideTranslations(topwidget, + XtOverrideTranslations(topwidget, XtParseTranslationTable ("WM_PROTOCOLS: quit()"));