ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/screen.C
(Generate patch)

Comparing rxvt-unicode/src/screen.C (file contents):
Revision 1.273 by ayin, Mon Aug 13 07:18:58 2007 UTC vs.
Revision 1.279 by sasha, Tue Sep 18 22:01:36 2007 UTC

30 30
31#include <inttypes.h> 31#include <inttypes.h>
32 32
33#include "salloc.C" // HACK, should be a seperate compile! 33#include "salloc.C" // HACK, should be a seperate compile!
34 34
35inline void fill_text (text_t *start, text_t value, int len) 35static inline void fill_text (text_t *start, text_t value, int len)
36{ 36{
37 while (len--) 37 while (len--)
38 *start++ = value; 38 *start++ = value;
39} 39}
40 40
405 CLEAR_ALL_SELECTION (); 405 CLEAR_ALL_SELECTION ();
406 406
407 prev_nrow = nrow; 407 prev_nrow = nrow;
408 prev_ncol = ncol; 408 prev_ncol = ncol;
409 409
410 tabs = (char *)rxvt_malloc (ncol * sizeof (char)); 410 tabs = (char *)rxvt_malloc (ncol);
411 411
412 for (int col = ncol; --col; ) 412 for (int col = ncol; --col; )
413 tabs [col] = col % TABSIZE == 0; 413 tabs [col] = col % TABSIZE == 0;
414 414
415 if (current_screen != PRIMARY) 415 if (current_screen != PRIMARY)
1621 */ 1621 */
1622void 1622void
1623rxvt_term::scr_set_tab (int mode) NOTHROW 1623rxvt_term::scr_set_tab (int mode) NOTHROW
1624{ 1624{
1625 if (mode < 0) 1625 if (mode < 0)
1626 memset (tabs, 0, ncol * sizeof (char)); 1626 memset (tabs, 0, ncol);
1627 else if (screen.cur.col < ncol) 1627 else if (screen.cur.col < ncol)
1628 tabs [screen.cur.col] = !!mode; 1628 tabs [screen.cur.col] = !!mode;
1629} 1629}
1630 1630
1631/* ------------------------------------------------------------------------- */ 1631/* ------------------------------------------------------------------------- */
1648 rvideo_state = on; 1648 rvideo_state = on;
1649 1649
1650 ::swap (pix_colors[Color_fg], pix_colors[Color_bg]); 1650 ::swap (pix_colors[Color_fg], pix_colors[Color_bg]);
1651#ifdef HAVE_BG_PIXMAP 1651#ifdef HAVE_BG_PIXMAP
1652 if (bgPixmap.pixmap == None) 1652 if (bgPixmap.pixmap == None)
1653#endif
1654#if ENABLE_TRANSPARENCY
1655 if (!option (Opt_transparent) || am_transparent == 0)
1656#endif 1653#endif
1657 XSetWindowBackground (dpy, vt, pix_colors[Color_bg]); 1654 XSetWindowBackground (dpy, vt, pix_colors[Color_bg]);
1658 1655
1659 XGCValues gcvalue; 1656 XGCValues gcvalue;
1660 gcvalue.foreground = pix_colors[Color_fg]; 1657 gcvalue.foreground = pix_colors[Color_fg];
1804 for (i = PART_BEG; i < RC_COUNT; i++) 1801 for (i = PART_BEG; i < RC_COUNT; i++)
1805 { 1802 {
1806 min_it (rc[i].col, ncol - 1); 1803 min_it (rc[i].col, ncol - 1);
1807 min_it (rc[i].row, nrow - 1); 1804 min_it (rc[i].row, nrow - 1);
1808 } 1805 }
1809 1806// TODO: this line somehow causes segfault if scr_expose() is called just after resize
1810 for (i = rc[PART_BEG].row; i <= rc[PART_END].row; i++) 1807 for (i = rc[PART_BEG].row; i <= rc[PART_END].row; i++)
1811 fill_text (&drawn_buf[i].t[rc[PART_BEG].col], 0, rc[PART_END].col - rc[PART_BEG].col + 1); 1808 fill_text (&drawn_buf[i].t[rc[PART_BEG].col], 0, rc[PART_END].col - rc[PART_BEG].col + 1);
1812 1809
1813 num_scr_allow = 0; 1810 num_scr_allow = 0;
1814 1811
1888# ifdef MAPALERT_OPTION 1885# ifdef MAPALERT_OPTION
1889 if (option (Opt_mapAlert)) 1886 if (option (Opt_mapAlert))
1890# endif 1887# endif
1891 XMapWindow (dpy, parent[0]); 1888 XMapWindow (dpy, parent[0]);
1892# endif 1889# endif
1890
1893# if ENABLE_FRILLS 1891# if ENABLE_FRILLS
1894 if (option (Opt_urgentOnBell)) 1892 if (option (Opt_urgentOnBell))
1895 { 1893 {
1896 XWMHints *h;
1897
1898 h = XGetWMHints(dpy, parent[0]); 1894 if (XWMHints *h = XGetWMHints(dpy, parent[0]))
1899 if (h != NULL)
1900 { 1895 {
1901 h->flags |= XUrgencyHint; 1896 h->flags |= XUrgencyHint;
1902 XSetWMHints(dpy, parent[0], h); 1897 XSetWMHints (dpy, parent[0], h);
1903 } 1898 }
1904 } 1899 }
1905# endif 1900# endif
1906 1901
1907 if (option (Opt_visualBell)) 1902 if (option (Opt_visualBell))
2004 have_bg = 0; 1999 have_bg = 0;
2005 refresh_count = 0; 2000 refresh_count = 0;
2006 2001
2007#ifdef HAVE_BG_PIXMAP 2002#ifdef HAVE_BG_PIXMAP
2008 have_bg |= bgPixmap.pixmap != None; 2003 have_bg |= bgPixmap.pixmap != None;
2009#endif
2010#if ENABLE_TRANSPARENCY
2011 have_bg |= option (Opt_transparent) && am_transparent;
2012#endif 2004#endif
2013 ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ 2005 ocrow = oldcursor.row; /* is there an old outline cursor on screen? */
2014 2006
2015 /* 2007 /*
2016 * B: reverse any characters which are selected 2008 * B: reverse any characters which are selected
2478} 2470}
2479 2471
2480void 2472void
2481rxvt_term::scr_recolour () NOTHROW 2473rxvt_term::scr_recolour () NOTHROW
2482{ 2474{
2483 if (1
2484#if ENABLE_TRANSPARENCY
2485 && !am_transparent
2486#endif
2487#ifdef HAVE_BG_PIXMAP 2475#ifdef HAVE_BG_PIXMAP
2488 && !bgPixmap.pixmap 2476 bgPixmap.apply ();
2489#endif 2477#else
2490 )
2491 {
2492 XSetWindowBackground (dpy, parent[0], pix_colors[Color_border]); 2478 XSetWindowBackground (dpy, parent[0], pix_colors[Color_border]);
2493 XClearWindow (dpy, parent[0]); 2479 XClearWindow (dpy, parent[0]);
2494 XSetWindowBackground (dpy, vt, pix_colors[Color_bg]); 2480 XSetWindowBackground (dpy, vt, pix_colors[Color_bg]);
2495#if HAVE_SCROLLBARS 2481# if HAVE_SCROLLBARS
2496 if (scrollBar.win) 2482 if (scrollBar.win)
2497 { 2483 {
2498 XSetWindowBackground (dpy, scrollBar.win, pix_colors[Color_border]); 2484 XSetWindowBackground (dpy, scrollBar.win, pix_colors[Color_border]);
2499 scrollBar.setIdle (); 2485 scrollBar.setIdle ();
2500 scrollbar_show (0); 2486 scrollbar_show (0);
2501 } 2487 }
2502#endif 2488# endif
2503 }
2504
2505 scr_clear (); 2489 scr_clear ();
2506 scr_touch (true); 2490 scr_touch (true);
2507 want_refresh = 1; 2491 want_refresh = 1;
2492#endif
2493
2508} 2494}
2509 2495
2510/* ------------------------------------------------------------------------- */ 2496/* ------------------------------------------------------------------------- */
2511void 2497void
2512rxvt_term::scr_clear (bool really) NOTHROW 2498rxvt_term::scr_clear (bool really) NOTHROW

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines