From: Eli Zaretskii Date: Thu, 19 Sep 2013 11:28:37 +0000 (+0300) Subject: Fixed screen restoration after popping down a menu. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1328^2~40 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fa93733d3481c928112d13e31c30d7d36cfa6589;p=emacs.git Fixed screen restoration after popping down a menu. --- diff --git a/src/dispnew.c b/src/dispnew.c index fba38f13783..f1df96d75a6 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -1930,6 +1930,8 @@ save_current_matrix (struct frame *f) to->glyphs[TEXT_AREA] = xmalloc (nbytes); memcpy (to->glyphs[TEXT_AREA], from->glyphs[TEXT_AREA], nbytes); to->used[TEXT_AREA] = from->used[TEXT_AREA]; + to->enabled_p = from->enabled_p; + to->hash = from->hash; if (from->used[LEFT_MARGIN_AREA]) { nbytes = from->used[LEFT_MARGIN_AREA] * sizeof (struct glyph); diff --git a/src/term.c b/src/term.c index e1175fac247..451d608842d 100644 --- a/src/term.c +++ b/src/term.c @@ -2791,11 +2791,12 @@ DEFUN ("gpm-mouse-stop", Fgpm_mouse_stop, Sgpm_mouse_stop, /* TTY menu implementation and main ideas are borrowed from msdos.c. However, unlike on MSDOS, where the menu text is drawn directly to - the screen, on a TTY we use display_string (see xdisp.c) to put the - glyphs produced from the menu items into the desired_matrix glyph - matrix, and then call update_frame to deliver the results to the - glass. The previous contents of the screen, in the form of the - current_matrix, is stashed away, and used to restore screen + the display video memory, on a TTY we use display_string (see + display_tty_menu_item in xdisp.c) to put the glyphs produced from + the menu items directly into the frame's 'desired_matrix' glyph + matrix, and then call update_frame_with_menu to deliver the results + to the glass. The previous contents of the screen, in the form of + the current_matrix, is stashed away, and used to restore screen contents when the menu selection changes or when the final selection is made and the menu should be popped down. @@ -3086,6 +3087,8 @@ restore_desired_matrix (struct frame *f, struct glyph_matrix *saved) eassert (to->glyphs[TEXT_AREA] != from->glyphs[TEXT_AREA]); memcpy (to->glyphs[TEXT_AREA], from->glyphs[TEXT_AREA], nbytes); to->used[TEXT_AREA] = from->used[TEXT_AREA]; + to->enabled_p = from->enabled_p; + to->hash = from->hash; xfree (from->glyphs[TEXT_AREA]); nbytes = from->used[LEFT_MARGIN_AREA] * sizeof (struct glyph); if (nbytes)