summaryrefslogtreecommitdiff
path: root/src/window.h
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>2010-01-09 13:16:32 +0900
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>2010-01-09 13:16:32 +0900
commit4b00d3b1594378e77b3b485d1ed272be5bdab644 (patch)
treeec9fd6e300bf9619c3327345780ba85f1f839f15 /src/window.h
parent69e2f18578cd9b5089a68787a1a6e80ca21e6256 (diff)
downloademacs-4b00d3b1594378e77b3b485d1ed272be5bdab644.tar.gz
Make line<->pixel_y conversion macros aware of native menu/tool bars.
They are placed above the internal border. This supersedes special treatment of native tool bars in the display code. This fixes wrong display position of native menu bars and bogus mouse highlighting of native tool bars, both of which can be found when internal border width is large. Also it fixes wrong flashed part on visible bell with native menu bars. * frame.h (FRAME_TOP_MARGIN_HEIGHT): New macro. (FRAME_LINE_TO_PIXEL_Y, FRAME_PIXEL_Y_TO_LINE): Take account of pseudo windows above internal border. * window.h (WINDOW_MENU_BAR_P, WINDOW_TOOL_BAR_P): New macros. (WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y): Take account of pseudo windows above internal border. * xdisp.c (get_glyph_string_clip_rects, init_glyph_string): Don't treat tool bar windows specially. * xfns.c (x_set_tool_bar_lines): Take account of menu bar height. * xterm.c (x_after_update_window_line): Don't treat tool bar windows specially. (XTflash): Take account of menu bar height. * w32term.c (x_after_update_window_line): Don't treat tool bar windows specially.
Diffstat (limited to 'src/window.h')
-rw-r--r--src/window.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/window.h b/src/window.h
index 8b7d945fd13..bb6a0ff9123 100644
--- a/src/window.h
+++ b/src/window.h
@@ -400,18 +400,32 @@ struct window
(FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W)) \
+ WINDOW_RIGHT_EDGE_COL (W) * WINDOW_FRAME_COLUMN_WIDTH (W))
+/* 1 if W is a menu bar window. */
+
+#define WINDOW_MENU_BAR_P(W) \
+ (WINDOWP (WINDOW_XFRAME (W)->menu_bar_window) \
+ && (W) == XWINDOW (WINDOW_XFRAME (W)->menu_bar_window))
+
+/* 1 if W is a tool bar window. */
+
+#define WINDOW_TOOL_BAR_P(W) \
+ (WINDOWP (WINDOW_XFRAME (W)->tool_bar_window) \
+ && (W) == XWINDOW (WINDOW_XFRAME (W)->tool_bar_window))
+
/* Return the frame y-position at which window W starts.
This includes a header line, if any. */
#define WINDOW_TOP_EDGE_Y(W) \
- (FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W)) \
+ (((WINDOW_MENU_BAR_P (W) || WINDOW_TOOL_BAR_P (W)) \
+ ? 0 : FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W))) \
+ WINDOW_TOP_EDGE_LINE (W) * WINDOW_FRAME_LINE_HEIGHT (W))
/* Return the frame y-position before which window W ends.
This includes a mode line, if any. */
#define WINDOW_BOTTOM_EDGE_Y(W) \
- (FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W)) \
+ (((WINDOW_MENU_BAR_P (W) || WINDOW_TOOL_BAR_P (W)) \
+ ? 0 : FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W))) \
+ WINDOW_BOTTOM_EDGE_LINE (W) * WINDOW_FRAME_LINE_HEIGHT (W))