changeset 3236:948edcabee99

Fixed #tags of current view
author unexist
date Mon, 29 Oct 2012 13:46:02 +0100
parents 8a1fe957faf1
children 3b8dbf9dea5c
files src/subtlext/view.c
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/subtlext/view.c	Fri Sep 21 12:21:56 2012 +0200
+++ b/src/subtlext/view.c	Mon Oct 29 13:46:02 2012 +0100
@@ -163,6 +163,7 @@
 {
   int nnames = 0;
   char **names = NULL;
+  long *tags = NULL;
   unsigned long *cur_view = NULL;
   VALUE view = Qnil;
 
@@ -174,17 +175,22 @@
   cur_view = (unsigned long *)subSharedPropertyGet(display,
     DefaultRootWindow(display), XA_CARDINAL,
     XInternAtom(display, "_NET_CURRENT_DESKTOP", False), NULL);
+  tags     = (long *)subSharedPropertyGet(display, ROOT, XA_CARDINAL,
+      XInternAtom(display, "SUBTLE_VIEW_TAGS", False), NULL);
 
   /* Check results */
-  if(names && cur_view)
+  if(names && cur_view && tags)
     {
       /* Create instance */
       view = subextViewInstantiate(names[*cur_view]);
-      rb_iv_set(view, "@id",  INT2FIX(*cur_view));
+
+      rb_iv_set(view, "@id",   INT2FIX(*cur_view));
+      rb_iv_set(view, "@tags", LONG2NUM(tags[*cur_view]));
     }
 
   if(names)    XFreeStringList(names);
   if(cur_view) free(cur_view);
+  if(tags)     free(tags);
 
   return view;
 } /* }}} */