emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r99294: * xfns.c (x_set_menu_bar_line


From: YAMAMOTO Mitsuharu
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r99294: * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
Date: Mon, 11 Jan 2010 14:19:47 +0900
User-agent: Bazaar (2.0.2)

------------------------------------------------------------
revno: 99294
committer: YAMAMOTO Mitsuharu <address@hidden>
branch nick: trunk
timestamp: Mon 2010-01-11 14:19:47 +0900
message:
  * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
  Clear areas that will not be updated after change of menu bar lines.
  Clear the menu bar window's current matrix when the window gets empty.
modified:
  src/ChangeLog
  src/xfns.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-01-09 22:32:47 +0000
+++ b/src/ChangeLog     2010-01-11 05:19:47 +0000
@@ -1,3 +1,9 @@
+2010-01-11  YAMAMOTO Mitsuharu  <address@hidden>
+
+       * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
+       Clear areas that will not be updated after change of menu bar lines.
+       Clear the menu bar window's current matrix when the window gets empty.
+
 2010-01-09  Chong Yidong  <address@hidden>
 
        * intervals.h, textprop.c (extend_property_ranges): Return value

=== modified file 'src/xfns.c'
--- a/src/xfns.c        2010-01-09 13:26:23 +0000
+++ b/src/xfns.c        2010-01-11 05:19:47 +0000
@@ -1317,7 +1317,43 @@
 #else /* not USE_X_TOOLKIT && not USE_GTK */
   FRAME_MENU_BAR_LINES (f) = nlines;
   change_window_heights (f->root_window, nlines - olines);
-#endif /* not USE_X_TOOLKIT */
+
+  /* If the menu bar height gets changed, the internal border below
+     the top margin has to be cleared.  Also, if the menu bar gets
+     larger, the area for the added lines has to be cleared except for
+     the first menu bar line that is to be drawn later.  */
+  if (nlines != olines)
+    {
+      int height = FRAME_INTERNAL_BORDER_WIDTH (f);
+      int width = FRAME_PIXEL_WIDTH (f);
+      int y;
+
+      /* height can be zero here. */
+      if (height > 0 && width > 0)
+       {
+         y = FRAME_TOP_MARGIN_HEIGHT (f);
+
+         BLOCK_INPUT;
+         x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+                       0, y, width, height, False);
+         UNBLOCK_INPUT;
+       }
+
+      if (nlines > 1 && nlines > olines)
+       {
+         y = (olines == 0 ? 1 : olines) * FRAME_LINE_HEIGHT (f);
+         height = nlines * FRAME_LINE_HEIGHT (f) - y;
+
+         BLOCK_INPUT;
+         x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+                       0, y, width, height, False);
+         UNBLOCK_INPUT;
+       }
+
+      if (nlines == 0 && WINDOWP (f->menu_bar_window))
+       clear_glyph_matrix (XWINDOW (f->menu_bar_window)->current_matrix);
+    }
+#endif /* not USE_X_TOOLKIT && not USE_GTK */
   adjust_glyphs (f);
 }
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]