--- rxvt-unicode/src/menubar.C 2004/08/15 04:54:21 1.19 +++ rxvt-unicode/src/menubar.C 2005/11/30 14:23:29 1.25 @@ -957,11 +957,11 @@ if (ActiveMenu->win == None) { ActiveMenu->win = XCreateSimpleWindow (display->display, TermWin.vt, - x, ActiveMenu->y, - ActiveMenu->w, ActiveMenu->h, - 0, - PixColors[Color_fg], - PixColors[Color_scroll]); + x, ActiveMenu->y, + ActiveMenu->w, ActiveMenu->h, + 0, + pix_colors[Color_fg], + pix_colors[Color_scroll]); ActiveMenu->drawable = new rxvt_drawable (display, ActiveMenu->win); XMapWindow (display->display, ActiveMenu->win); } @@ -984,9 +984,9 @@ if (isSeparator (item->name)) { rxvt_Draw_Shadow (display->display, ActiveMenu->win, - topShadowGC, botShadowGC, - SHADOW, y + SHADOW + 1, - ActiveMenu->w - 2 * SHADOW, 0); + topShadowGC, botShadowGC, + SHADOW, y + SHADOW + 1, + ActiveMenu->w - 2 * SHADOW, 0); h = HEIGHT_SEPARATOR; } else @@ -1037,14 +1037,14 @@ name = NULL; if (len && name) - draw_string (*ActiveMenu->drawable, gc, TermWin.fontset, + draw_string (*ActiveMenu->drawable, gc, TermWin.fontset[0], xoff, 2 * SHADOW + y, name, len); len = item->len2; name = item->name2; if (len && name) - draw_string (*ActiveMenu->drawable, gc, TermWin.fontset, + draw_string (*ActiveMenu->drawable, gc, TermWin.fontset[0], ActiveMenu->w - (xoff + Width2Pixel (xright)), 2 * SHADOW + y, name, len); h = HEIGHT_TEXT + 2 * SHADOW; @@ -1565,9 +1565,9 @@ } } } + /* * remove leading/trailing space - * and strip-off leading/trailing quotes * skip blank or comment lines */ rxvt_Str_trim (p); @@ -1946,6 +1946,7 @@ else BuildMenu = menu; } + if (BuildMenu != NULL) { if (name == NULL || name[0] == '\0') @@ -1954,7 +1955,6 @@ { const char *n1; menuitem_t *item; - menu_t *BuildMenu = BuildMenu; n1 = strcmp (name, SEPARATOR_NAME) ? name : ""; item = rxvt_menuitem_find (BuildMenu, n1); @@ -1973,6 +1973,7 @@ } } } + menubar_expose (); } break; @@ -2017,7 +2018,7 @@ if (!name || name == Arrows[i].name) rxvt_Draw_Triangle (display->display, menuBar.win, top, bot, x, y, w, - Arrows[i].name); + Arrows[i].name); } XFlush (display->display); } @@ -2036,8 +2037,8 @@ /* Create the graphics context */ XGCValues gcvalue; - gcvalue.foreground = (display->depth <= 2 ? PixColors[Color_fg] - : PixColors[Color_Black]); + gcvalue.foreground = (display->depth <= 2 ? pix_colors[Color_fg] + : pix_colors[Color_Black]); menubarGC = XCreateGC (display->display, menuBar.win, GCForeground, &gcvalue); @@ -2064,7 +2065,7 @@ len = (TermWin.ncol - (menu->x + HSPACE)); drawbox_menubar (menu->x, len, +1); - draw_string (*menuBar.drawable, menubarGC, TermWin.fontset, + draw_string (*menuBar.drawable, menubarGC, TermWin.fontset[0], (Width2Pixel (menu->x) + Width2Pixel (HSPACE) / 2), SHADOW, menu->name, len); @@ -2127,7 +2128,7 @@ ncol -= (x + len + HSPACE); if (len > 0 && ncol >= 0) - draw_string (*menuBar.drawable, menubarGC, TermWin.fontset, + draw_string (*menuBar.drawable, menubarGC, TermWin.fontset[0], Width2Pixel (x) + Width2Pixel (ncol + HSPACE) / 2, SHADOW, title, len); } @@ -2250,20 +2251,7 @@ case MenuAction: case MenuTerminalAction: drawbox_menuitem (this_y, -1); -#ifdef HAVE_NANOSLEEP - struct timespec rqt; - - rqt.tv_sec = 0; - rqt.tv_nsec = MENU_DELAY_USEC * 1000; - nanosleep (&rqt, NULL); -#else - /* use select for timing */ - struct timeval tv; - - tv.tv_sec = 0; - tv.tv_usec = MENU_DELAY_USEC; - select (0, NULL, NULL, NULL, &tv); -#endif + rxvt_usleep (MENU_DELAY_USEC); /* remove menu before sending keys to the application */ menu_hide_all (); #ifndef DEBUG_MENU @@ -2351,23 +2339,7 @@ + (Width2Pixel (4 * i + i + 4)) / 4)) { draw_Arrows (Arrows[i].name, -1); - { -#ifdef HAVE_NANOSLEEP - struct timespec rqt; - - rqt.tv_sec = 0; - rqt.tv_nsec = MENU_DELAY_USEC * 1000; - nanosleep (&rqt, NULL); -#else - /* use select for timing */ - struct timeval tv; - - tv.tv_sec = 0; - tv.tv_usec = MENU_DELAY_USEC; - select (0, NULL, NULL, NULL, &tv); -#endif - - } + rxvt_usleep (MENU_DELAY_USEC); draw_Arrows (Arrows[i].name, +1); #ifdef DEBUG_MENUARROWS fprintf (stderr, "'%c': ", Arrows[i].name);