[hackers] [wmii] Fixed bug where v->sel could be set to a removed frame

From: Kris Maglione <jg_AT_suckless.org>
Date: Fri Feb 09 03:30:30 2007

changeset: 1793:8340453daec9
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Thu Feb 08 21:26:45 2007 -0500
summary: Fixed bug where v->sel could be set to a removed frame

diff -r 4819811e0303 -r 8340453daec9 area.c
--- a/area.c Thu Feb 08 20:56:04 2007 -0500
+++ b/area.c Thu Feb 08 21:26:45 2007 -0500
@@ -267,7 +267,7 @@ detach_from_area(Area *a, Frame *f) {
         c = f->client;
 
         for(pr = a->frame; pr; pr = pr->anext)
- if(pr == f) break;
+ if(pr->next == f) break;
         remove_frame(f);
         if(a->sel == f) {
                 a->sel = pr;
diff -r 4819811e0303 -r 8340453daec9 event.c
--- a/event.c Thu Feb 08 20:56:04 2007 -0500
+++ b/event.c Thu Feb 08 21:26:45 2007 -0500
@@ -6,45 +6,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <X11/keysym.h>
-
-/* local functions */
-static void buttonpress(XEvent *e);
-static void buttonrelease(XEvent *e);
-static void configurerequest(XEvent *e);
-static void destroynotify(XEvent *e);
-static void enternotify(XEvent *e);
-static void leavenotify(XEvent *e);
-static void expose(XEvent *e);
-static void keypress(XEvent *e);
-static void mappingnotify(XEvent *e);
-static void maprequest(XEvent *e);
-static void propertynotify(XEvent *e);
-static void unmapnotify(XEvent *e);
-
-void (*handler[LASTEvent]) (XEvent *) = {
- [ButtonPress] = buttonpress,
- [ButtonRelease] = buttonrelease,
- [ConfigureRequest]= configurerequest,
- [DestroyNotify] = destroynotify,
- [EnterNotify] = enternotify,
- [LeaveNotify] = leavenotify,
- [Expose] = expose,
- [KeyPress] = keypress,
- [MappingNotify] = mappingnotify,
- [MapRequest] = maprequest,
- [PropertyNotify]= propertynotify,
- [UnmapNotify] = unmapnotify
-};
-
-void
-check_x_event(IXPConn *c) {
- XEvent ev;
- while(XPending(blz.dpy)) { /* main event loop */
- XNextEvent(blz.dpy, &ev);
- if(handler[ev.type])
- (handler[ev.type]) (&ev); /* call handler */
- }
-}
 
 unsigned int
 flush_masked_events(long even_mask) {
@@ -298,3 +259,28 @@ unmapnotify(XEvent *e) {
         if((c = client_of_win(ev->window)))
                 destroy_client(c);
 }
+
+void (*handler[LASTEvent]) (XEvent *) = {
+ [ButtonPress] = buttonpress,
+ [ButtonRelease] = buttonrelease,
+ [ConfigureRequest]= configurerequest,
+ [DestroyNotify] = destroynotify,
+ [EnterNotify] = enternotify,
+ [LeaveNotify] = leavenotify,
+ [Expose] = expose,
+ [KeyPress] = keypress,
+ [MappingNotify] = mappingnotify,
+ [MapRequest] = maprequest,
+ [PropertyNotify]= propertynotify,
+ [UnmapNotify] = unmapnotify
+};
+
+void
+check_x_event(IXPConn *c) {
+ XEvent ev;
+ while(XPending(blz.dpy)) { /* main event loop */
+ XNextEvent(blz.dpy, &ev);
+ if(handler[ev.type])
+ (handler[ev.type]) (&ev); /* call handler */
+ }
+}
Received on Fri Feb 09 2007 - 03:30:30 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:02 UTC