Permalink
Browse files

TYPOS

  • Loading branch information...
1 parent 7c30cd5 commit 0f330e9e2c404eaa1770465481c196aa2656319e @timfel timfel committed Jun 9, 2008
Showing with 11 additions and 7 deletions.
  1. +9 −6 src/dwm_ruby/x11.c
  2. +2 −1 src/dwm_ruby/x11_wrap.c
View
@@ -118,23 +118,26 @@ void process_event(WM* winman) {
int i,j;
if (XPending(winman->dpy))
- XNextEvent(dpy, &ev);
+ XNextEvent(winman->dpy, &ev);
switch (ev.type) {
- case XMapRequestEvent || XCreateWindowEvent:
+ case (MapRequest):
winman->clients_num += 1;
// remember: if realloc fails, it keeps the origin-block intact,
// so we can just do it directly :)
- winman->clients = realloc(winman->clients, sizeof(clients))
- manage(winman, ev.window, &wa, winman->clients[clients_num-1]);
+ winman->clients = realloc(winman->clients, sizeof(Client)*winman->clients_num);
+ manage(winman, ev.xany.window, &wa, &winman->clients[winman->clients_num-1]);
break;
- case XUnmapEvent || XDestroyWindowEvent:
+ case (UnmapNotify || DestroyNotify):
for(i=0; i<winman->clients_num; i++)
- if (winman->clients[i].win == ev.window) {
+ if (winman->clients[i].win == ev.xany.window) {
winman->clients_num -= 1;
for(j=i+1; j<winman->clients_num; j++)
winman->clients[j-1] = winman->clients[j];
+ winman->clients = realloc(winman->clients, sizeof(Client)*winman->clients_num);
}
break;
+ default:
+ break;
}
}
@@ -2,6 +2,7 @@
#include <x11.h>
VALUE mrubyx11, cClient, cKey, cWM;
+static VALUE client_make(VALUE klass, Client* c); // I need this alot
// Allocate a new WindowManager object
// using the supplied Init_WM
@@ -117,7 +118,7 @@ static VALUE wm_num_clients(VALUE self) {
static VALUE wm_selected(VALUE self) {
WM *newwm;
- Date_Get_Struct(self, WM, newwm);
+ Data_Get_Struct(self, WM, newwm);
return client_make(cClient, newwm->selected);
}

0 comments on commit 0f330e9

Please sign in to comment.