changeset: 2653:85ce73328c49
user: Kris Maglione <kris_AT_suckless.org>
date: Thu May 27 17:37:09 2010 -0400
files: cmd/tray/tray.c
description:
[witray] Resize tray window after desktop change.
diff -r 074ee20e0679 -r 85ce73328c49 cmd/tray/tray.c
--- a/cmd/tray/tray.c Thu May 27 14:14:37 2010 -0400
+++ b/cmd/tray/tray.c Thu May 27 17:37:09 2010 -0400
@@ -6,6 +6,7 @@
#include "fns.h"
static Handlers handlers;
+static Handlers root_handlers;
void
restrut(Window *w, int orientation) {
@@ -83,7 +84,10 @@
| CWEventMask);
XFreeColormap(display, wa.colormap);
}
+
sethandler(tray.win, &handlers);
+ pushhandler(&scr.root, &root_handlers, nil);
+ selectinput(&scr.root, scr.root.eventmask | PropertyChangeMask);
changeprop_string(tray.win, "_WMII_TAGS", tray.tags);
@@ -150,9 +154,9 @@
freeimage(oldimage);
}
+ tray.r = r;
reshapewin(tray.win, r);
restrut(tray.win, tray.orientation);
-
}
void
@@ -255,3 +259,15 @@
.expose = expose_event,
};
+static void
+property_event(Window *w, void *aux, XPropertyEvent *ev) {
+ if(ev->atom == NET("CURRENT_DESKTOP"))
+ tray_resize(tray.r);
+ Debug if(ev->atom == NET("CURRENT_DESKTOP"))
+ print("property_event(_NET_CURRENT_DESKTOP)\n");
+}
+
+static Handlers root_handlers = {
+ .property = property_event,
+};
+
Received on Thu May 27 2010 - 21:38:32 UTC
This archive was generated by hypermail 2.2.0 : Thu May 27 2010 - 21:48:03 UTC