--- rxvt-unicode/src/command.C 2007/08/10 23:52:12 1.344 +++ rxvt-unicode/src/command.C 2007/09/18 22:01:36 1.357 @@ -97,7 +97,6 @@ XK_Shift_Lock, 0x21eb, XK_ISO_Lock, 0x21eb, - XK_ISO_Lock, 0x21eb, XK_Caps_Lock, 0x21ec, XK_Num_Lock, 0x21ed, XK_ISO_Level3_Shift, 0x21ee, @@ -550,6 +549,7 @@ if (keysym >= 0xFF00 && keysym <= 0xFFFF) { { + bool kp = priv_modes & PrivMode_aplKP ? !shft : shft; newlen = 1; switch (keysym) { @@ -562,14 +562,14 @@ kbuf[1] = '\0'; } else - strcpy (kbuf, key_backspace); + strcpy (kbuf, rs[Rs_backspace_key]); break; #endif #ifndef NO_DELETE_KEY -# ifdef XK_KP_Prior +# ifdef XK_KP_Delete case XK_KP_Delete: /* allow shift to override */ - if ((priv_modes & PrivMode_aplKP) ? !shft : shft) + if (kp) { strcpy (kbuf, "\033On"); break; @@ -577,7 +577,7 @@ /* FALLTHROUGH */ # endif case XK_Delete: - strcpy (kbuf, key_delete); + strcpy (kbuf, rs[Rs_delete_key]); break; #endif case XK_Tab: @@ -602,7 +602,7 @@ case XK_KP_Down: /* \033Or or standard */ case XK_KP_Right: /* \033Ov or standard */ case XK_KP_Left: /* \033Ot or standard */ - if ((priv_modes & PrivMode_aplKP) ? !shft : shft) + if (kp) { strcpy (kbuf, "\033OZ"); kbuf[2] = "txvr"[keysym - XK_KP_Left]; @@ -635,7 +635,7 @@ # ifdef XK_KP_Prior case XK_KP_Prior: /* allow shift to override */ - if ((priv_modes & PrivMode_aplKP) ? !shft : shft) + if (kp) { strcpy (kbuf, "\033Oy"); break; @@ -648,7 +648,7 @@ # ifdef XK_KP_Next case XK_KP_Next: /* allow shift to override */ - if ((priv_modes & PrivMode_aplKP) ? !shft : shft) + if (kp) { strcpy (kbuf, "\033Os"); break; @@ -661,7 +661,7 @@ #endif case XK_KP_Enter: /* allow shift to override */ - if ((priv_modes & PrivMode_aplKP) ? !shft : shft) + if (kp) { strcpy (kbuf, "\033OM"); break; @@ -714,7 +714,7 @@ case XK_KP_8: /* "\033Ox" : "8" */ case XK_KP_9: /* "\033Oy" : "9" */ /* allow shift to override */ - if ((priv_modes & PrivMode_aplKP) ? !shft : shft) + if (kp) { strcpy (kbuf, "\033Oj"); kbuf[2] += (keysym - XK_KP_Multiply); @@ -733,7 +733,7 @@ #ifdef XK_KP_Insert case XK_KP_Insert: /* allow shift to override */ - if ((priv_modes & PrivMode_aplKP) ? !shft : shft) + if (kp) { strcpy (kbuf, "\033Op"); break; @@ -756,7 +756,7 @@ #ifdef XK_KP_End case XK_KP_End: /* allow shift to override */ - if ((priv_modes & PrivMode_aplKP) ? !shft : shft) + if (kp) { strcpy (kbuf, "\033Oq"); break; @@ -769,7 +769,7 @@ #ifdef XK_KP_Home case XK_KP_Home: /* allow shift to override */ - if ((priv_modes & PrivMode_aplKP) ? !shft : shft) + if (kp) { strcpy (kbuf, "\033Ow"); break; @@ -1036,12 +1036,11 @@ rxvt_term::flush () { flush_ev.stop (); - -#ifdef ENABLE_TRANSPARENCY - if (want_full_refresh) + +#ifdef HAVE_BG_PIXMAP + if (bgPixmap.check_clearChanged ()) { - want_full_refresh = 0; - scr_clear (); + scr_clear (true); scr_touch (false); } #endif @@ -1477,6 +1476,9 @@ break; case ConfigureNotify: + /* fprintf (stderr, "ConfigureNotify for %X, parent is %X, geom is %dx%d%+d%+d, old geom was %dx%d\n", + ev.xconfigure.window, parent[0], ev.xconfigure.width, ev.xconfigure.height, ev.xconfigure.x, ev.xconfigure.y, + szHint.width, szHint.height); */ if (ev.xconfigure.window == parent[0]) { while (XCheckTypedWindowEvent (dpy, ev.xconfigure.window, ConfigureNotify, &ev)) @@ -1486,22 +1488,15 @@ { seen_resize = 1; resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); -#ifdef XPM_BACKGROUND - /* TODO: replace with update_pixmap() that should unify transparency and bg image handling ! */ - if (!option (Opt_transparent) && bgPixmap.window_size_sensitive ()) - { - bgPixmap.render_background (); - scr_touch (true); - } + } + else + { +#ifdef HAVE_BG_PIXMAP + if (bgPixmap.window_position_sensitive ()) + update_background (); #endif } - HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); - -#ifdef ENABLE_TRANSPARENCY - if (option (Opt_transparent)) - bgPixmap.render_background (); -#endif } break; @@ -1542,27 +1537,24 @@ HOOK_INVOKE ((this, HOOK_UNMAP_NOTIFY, DT_XEVENT, &ev, DT_END)); break; -#ifdef ENABLE_TRANSPARENCY - case ReparentNotify: - rootwin_cb (ev); - break; -#endif /* ENABLE_TRANSPARENCY */ - case GraphicsExpose: case Expose: if (ev.xany.window == vt) { do - scr_expose (ev.xexpose.x, ev.xexpose.y, - ev.xexpose.width, ev.xexpose.height, False); + { + scr_expose (ev.xexpose.x, ev.xexpose.y, + ev.xexpose.width, ev.xexpose.height, False); + } while (XCheckTypedWindowEvent (dpy, vt, ev.xany.type, &ev)); ev.xany.type = ev.xany.type == Expose ? GraphicsExpose : Expose; while (XCheckTypedWindowEvent (dpy, vt, ev.xany.type, &ev)) - scr_expose (ev.xexpose.x, ev.xexpose.y, - ev.xexpose.width, ev.xexpose.height, False); - + { + scr_expose (ev.xexpose.x, ev.xexpose.y, + ev.xexpose.width, ev.xexpose.height, False); + } want_refresh = 1; } else @@ -1579,11 +1571,6 @@ scrollBar.setIdle (); scrollbar_show (0); } - -#ifdef ENABLE_TRANSPARENCY - if (am_transparent && ev.xany.window == parent[0]) - XClearWindow (dpy, ev.xany.window); -#endif } break; @@ -1755,13 +1742,10 @@ #if ENABLE_FRILLS if (option (Opt_urgentOnBell)) { - XWMHints *h; - - h = XGetWMHints(dpy, parent[0]); - if (h != NULL) + if (XWMHints *h = XGetWMHints(dpy, parent[0])) { h->flags &= ~XUrgencyHint; - XSetWMHints(dpy, parent[0], h); + XSetWMHints (dpy, parent[0], h); } } #endif @@ -1841,7 +1825,7 @@ || ev.xproperty.atom == xa[XA_ESETROOT_PMAP_ID]) { bgPixmap.set_root_pixmap (); - bgPixmap.render_background (); + update_background (); } break; } @@ -2807,9 +2791,8 @@ unicode_t ch, priv, i; unsigned int nargs, p; int n, ndef; - int arg[ESC_ARGS]; + int arg[ESC_ARGS] = { }; - memset (arg, 0, sizeof (arg)); nargs = 0; priv = 0; @@ -3442,17 +3425,13 @@ else changed = bgPixmap.unset_tint (); if (changed) - { - bgPixmap.render_background (); - if (am_transparent) - want_full_refresh = want_refresh = 1; - } + update_background (); } break; #endif -#if XPM_BACKGROUND +#if BG_IMAGE_FROM_FILE case Rxvt_Pixmap: if (!strcmp (str, "?")) { @@ -3485,10 +3464,7 @@ str = strchr (str, ';'); } if (changed) - { - bgPixmap.render_background (); - scr_touch (true); - } + update_background (); } break; #endif @@ -4028,7 +4004,6 @@ { free (v_buffer); v_buffer = 0; - v_buflen = 0; pty_ev.set (EVENT_READ); return;