From: Gerd Moellmann Date: Mon, 30 Oct 2000 20:46:02 +0000 (+0000) Subject: (menu_face_change_count): New variable. X-Git-Tag: emacs-pretest-21.0.90~404 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=563f68f11b4d75804e6500f86896bdb34b6d703c;p=emacs.git (menu_face_change_count): New variable. (Finternal_set_lisp_face_attribute): Increment it for changes of the `menu' face. (realize_basic_faces): Reflect changes in the `menu' faces in menu bars. --- diff --git a/src/ChangeLog b/src/ChangeLog index 8a12115d442..93a5ae1ad42 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,11 @@ 2000-10-30 Gerd Moellmann + * xfaces.c (menu_face_change_count): New variable. + (Finternal_set_lisp_face_attribute): Increment it for changes + of the `menu' face. + (realize_basic_faces): Reflect changes in the `menu' faces + in menu bars. + * xdisp.c (try_scrolling) = scroll_margin_pos>: Add 1 to the dy obtained from the iterator's y-position after moving from scroll_margin_pos to PT; see comment there. diff --git a/src/xfaces.c b/src/xfaces.c index 2edbe148cb2..b88f037209e 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -445,6 +445,10 @@ static int clear_font_table_count; int face_change_count; +/* Incremented for every change in the `menu' face. */ + +int menu_face_change_count; + /* Non-zero means don't display bold text if a face's foreground and background colors are the inverse of the default colors of the display. This is a kluge to suppress `bold black' foreground text @@ -4033,6 +4037,8 @@ FRAME 0 means change the face on all frames, and change the default\n\ if (EQ (attr, QCbackground)) param = Qmouse_color; } + else if (EQ (face, Qmenu)) + ++menu_face_change_count; if (!NILP (param)) { @@ -4444,12 +4450,14 @@ x_set_menu_resources_from_menu_face (f, widget) if (f->face_cache->used == 0) recompute_basic_faces (f); + BLOCK_INPUT; #ifdef USE_LUCID xl_set_menu_resources_from_menu_face (f, widget); #endif #ifdef USE_MOTIF xm_set_menu_resources_from_menu_face (f, widget); #endif + UNBLOCK_INPUT; } #endif /* USE_X_TOOLKIT */ @@ -5939,6 +5947,22 @@ realize_basic_faces (f) realize_named_face (f, Qcursor, CURSOR_FACE_ID); realize_named_face (f, Qmouse, MOUSE_FACE_ID); realize_named_face (f, Qmenu, MENU_FACE_ID); + + /* Reflext changes in the `menu' face in menu bars. */ + if (menu_face_change_count) + { + menu_face_change_count = 0; + +#ifdef USE_X_TOOLKIT + if (FRAME_X_P (f)) + { + Widget menu = f->output_data.x->menubar_widget; + if (menu) + x_set_menu_resources_from_menu_face (f, menu); + } +#endif /* USE_X_TOOLKIT */ + } + success_p = 1; }