Exemple #1
0
void
rxvt_term::recolour_cursor ()
{
  XColor fg, bg;

  (ISSET_PIXCOLOR (Color_pointer_fg)
     ? pix_colors_focused[Color_pointer_fg]
     : pix_colors_focused[Color_fg]).get (fg);

  (ISSET_PIXCOLOR (Color_pointer_bg)
     ? pix_colors_focused[Color_pointer_bg]
     : pix_colors_focused[Color_bg]).get (bg);

  XRecolorCursor (dpy, TermWin_cursor, &fg, &bg);
}
Exemple #2
0
void
rxvt_term::bg_init ()
{
#if BG_IMAGE_FROM_ROOT
  if (option (Opt_transparent))
    {
      if (rs [Rs_blurradius])
        root_effects.set_blur (rs [Rs_blurradius]);

      if (ISSET_PIXCOLOR (Color_tint))
        root_effects.set_tint (pix_colors_focused [Color_tint]);

      if (rs [Rs_shade])
        root_effects.set_shade (rs [Rs_shade]);

      rxvt_img::new_from_root (this)->replace (root_img);
      XSelectInput (dpy, display->root, PropertyChangeMask);
      rootwin_ev.start (display, display->root);
    }
#endif

#if BG_IMAGE_FROM_FILE
  if (rs[Rs_backgroundPixmap])
    {
      fimage.set_file_geometry (this, rs[Rs_backgroundPixmap]);
      if (!bg_window_position_sensitive ())
        update_background ();
    }
#endif
}
Exemple #3
0
rxvt_term::~rxvt_term ()
{
  termlist.erase (find (termlist.begin (), termlist.end(), this));

  emergency_cleanup ();

#if ENABLE_STYLES
  for (int i = RS_styleCount; --i; )
    if (fontset[i] != fontset[0])
      delete fontset[i];
#endif
  delete fontset[0];

#ifdef HAVE_BG_PIXMAP
  bgPixmap.destroy ();
#endif
#ifdef HAVE_AFTERIMAGE
  if (asv)
    destroy_asvisual (asv, 0);
  if (asimman)
    destroy_image_manager (asimman, 0);
#endif

  if (display)
    {
      selection_clear ();

#ifdef USE_XIM
      im_destroy ();
#endif
      scrollBar.destroy ();
      if (gc)   XFreeGC (dpy, gc);

      delete drawable;
      // destroy all windows
      if (parent[0])
        XDestroyWindow (dpy, parent[0]);

      for (int i = 0; i < TOTAL_COLORS; i++)
        if (ISSET_PIXCOLOR (i))
          {
            pix_colors_focused   [i].free (this);
#if OFF_FOCUS_FADING
            pix_colors_unfocused [i].free (this);
#endif
          }

      clear ();

      display->flush (); /* ideally .put should do this */
      displays.put (display);
    }

  scr_release ();

  /* clear all resources */
  for (int i = 0; i < allocated.size (); i++)
    free (allocated [i]);

  free (selection.text);
  // TODO: manage env vars in child only(!)
  free (env_display);
  free (env_term);
  free (locale);
  free (v_buffer);
  free (incr_buf);

  delete envv;
  delete argv;

#ifdef KEYSYM_RESOURCE
  delete keyboard;
#endif
#ifndef NO_RESOURCES
  XrmDestroyDatabase (option_db);
#endif
}