repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: b687b19c2dda05e5dd9afaacc5b67230a8d081e0: path_to: revision_to:
commit b687b19c2dda05e5dd9afaacc5b67230a8d081e0 Author: Marc LehmannDate: Fri Feb 20 22:27:27 2004 +0000 *** empty log message *** diff --git a/src/defaultfont.C b/src/defaultfont.C
--- a/src/defaultfont.C
+++ b/src/defaultfont.C
@@ -762,17 +762,17 @@ protected:
void
rxvt_font_xft::clear ()
{
- if (f)
- {
- XftFontClose (DISPLAY, f);
- f = 0;
- }
-
if (d)
{
XftDrawDestroy (d);
d = 0;
}
+
+ if (f)
+ {
+ XftFontClose (DISPLAY, f);
+ f = 0;
+ }
}
rxvt_fontprop
@@ -878,6 +878,10 @@ rxvt_font_xft::load (const rxvt_fontprop &prop)
XftUnlockFace (f);
+ d = XftDrawCreate (DISPLAY, DRAWABLE, r->display->visual, r->display->cmap);
+ if (!d)
+ return false;
+
return true;
}
@@ -892,9 +896,6 @@ rxvt_font_xft::draw (int x, int y,
const text_t *text, int len,
int fg, int bg)
{
- if (!d)
- d = XftDrawCreate (DISPLAY, DRAWABLE, r->display->visual, r->display->cmap);
-
if (bg >= 0 && bg != Color_bg)
XftDrawRect (d, &r->PixColors[bg].c, x, y, r->TermWin.fwidth * len, r->TermWin.fheight);
else
diff --git a/src/main.C b/src/main.C
--- a/src/main.C
+++ b/src/main.C
@@ -108,15 +108,6 @@ rxvt_term::~rxvt_term ()
if (cmd_fd >= 0)
close (cmd_fd);
- scr_release ();
-
- free (env_windowid);
- free (env_display);
- free (env_term);
- free (env_colorfgbg);
- free (locale);
- free (codeset);
-
#ifndef NO_SETOWNER_TTYDEV
privileged_ttydev (RESTORE);
#endif
@@ -124,13 +115,27 @@ rxvt_term::~rxvt_term ()
privileged_utmp (RESTORE);
#endif
+ delete TermWin.fontset;
+
+ if (display)
+ if (TermWin.parent[0])
+ XDestroyWindow (display->display, TermWin.parent[0]);
+
// TODO: free pixcolours, colours should become part of rxvt_display
delete PixColors;
- delete TermWin.fontset;
displays.put (display);
+ scr_release ();
+
+ free (env_windowid);
+ free (env_display);
+ free (env_term);
+ free (env_colorfgbg);
+ free (locale);
+ free (codeset);
+
delete envv;
delete argv;
}
@@ -140,13 +145,9 @@ rxvt_term::destroy ()
{
if (display)
{
- if (TermWin.parent[0])
- XDestroyWindow (display->display, TermWin.parent[0]);
-
rootwin_ev.stop (display);
termwin_ev.stop (display);
vt_ev.stop (display);
-
#ifdef USE_XIM
im_destroy ();
im_ev.stop (display);
@@ -266,11 +267,9 @@ rxvt_term::init (int argc, const char *const *argv)
Gr_reset (); /* reset graphics */
#endif
-#if 0
-#ifdef DEBUG_X
+#if 1
XSynchronize (display->display, True);
#endif
-#endif
#ifdef HAVE_SCROLLBARS
if (Options & Opt_scrollBar)
-----END OF PAGE-----