--- rxvt-unicode/src/rxvttoolkit.C 2007/11/14 22:25:42 1.77 +++ rxvt-unicode/src/rxvttoolkit.C 2007/12/14 02:22:24 1.81 @@ -3,7 +3,7 @@ *----------------------------------------------------------------------* * * All portions of code are copyright by their respective author/s. - * Copyright (c) 2003-2006 Marc Lehmann + * Copyright (c) 2003-2007 Marc Lehmann * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -297,15 +297,15 @@ rxvt_display::rxvt_display (const char *id) : refcounted (id) -, x_ev (this, &rxvt_display::x_cb) , selection_owner (0) { + x_ev.set (this); } XrmDatabase rxvt_display::get_resources (bool refresh) { - char *homedir = (char *)getenv ("HOME"); + char *homedir = getenv ("HOME"); char fname[1024]; /* @@ -320,7 +320,7 @@ // 6. System wide per application default file. /* Add in $XAPPLRESDIR/Rxvt only; not bothering with XUSERFILESEARCHPATH */ - if ((xe = (char *)getenv ("XAPPLRESDIR"))) + if ((xe = getenv ("XAPPLRESDIR"))) { snprintf (fname, sizeof (fname), "%s/%s", xe, RESCLASS); @@ -402,7 +402,7 @@ // 3. User's per host defaults file /* Add in XENVIRONMENT file */ - if ((xe = (char *)getenv ("XENVIRONMENT")) + if ((xe = getenv ("XENVIRONMENT")) && (rdb1 = XrmGetFileDatabase (xe))) XrmMergeDatabases (rdb1, &database); else if (homedir) @@ -542,7 +542,7 @@ void rxvt_display::x_cb (ev::io &w, int revents) { - do + while (XEventsQueued (dpy, QueuedAfterReading)) { XEvent xev; XNextEvent (dpy, &xev); @@ -569,17 +569,13 @@ } #endif } - while (XEventsQueued (dpy, QueuedAlready)); XFlush (dpy); } void rxvt_display::flush () { - if (XEventsQueued (dpy, QueuedAlready)) - x_cb (x_ev, ev::READ); - - XFlush (dpy); + x_cb (x_ev, ev::READ); } void rxvt_display::reg (xevent_watcher *w)