comparison src/xterm.c @ 106768:21fd634f447a

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.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Sat, 09 Jan 2010 13:16:32 +0900
parents fa4743217572
children 142b86c0d21d
comparison
equal deleted inserted replaced
106767:a66a1275eccd 106768:21fd634f447a
750 width != 0) 750 width != 0)
751 && (height = desired_row->visible_height, 751 && (height = desired_row->visible_height,
752 height > 0)) 752 height > 0))
753 { 753 {
754 int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y)); 754 int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y));
755
756 /* Internal border is drawn below the tool bar. */
757 if (WINDOWP (f->tool_bar_window)
758 && w == XWINDOW (f->tool_bar_window))
759 y -= width;
760 755
761 BLOCK_INPUT; 756 BLOCK_INPUT;
762 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 757 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
763 0, y, width, height, False); 758 0, y, width, height, False);
764 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 759 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
3060 if (height > 3 * FRAME_LINE_HEIGHT (f)) 3055 if (height > 3 * FRAME_LINE_HEIGHT (f))
3061 { 3056 {
3062 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, 3057 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,
3063 flash_left, 3058 flash_left,
3064 (FRAME_INTERNAL_BORDER_WIDTH (f) 3059 (FRAME_INTERNAL_BORDER_WIDTH (f)
3065 + FRAME_TOOL_BAR_LINES (f) * FRAME_LINE_HEIGHT (f)), 3060 + FRAME_TOP_MARGIN_HEIGHT (f)),
3066 width, flash_height); 3061 width, flash_height);
3067 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, 3062 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,
3068 flash_left, 3063 flash_left,
3069 (height - flash_height 3064 (height - flash_height
3070 - FRAME_INTERNAL_BORDER_WIDTH (f)), 3065 - FRAME_INTERNAL_BORDER_WIDTH (f)),
3114 if (height > 3 * FRAME_LINE_HEIGHT (f)) 3109 if (height > 3 * FRAME_LINE_HEIGHT (f))
3115 { 3110 {
3116 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, 3111 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,
3117 flash_left, 3112 flash_left,
3118 (FRAME_INTERNAL_BORDER_WIDTH (f) 3113 (FRAME_INTERNAL_BORDER_WIDTH (f)
3119 + FRAME_TOOL_BAR_LINES (f) * FRAME_LINE_HEIGHT (f)), 3114 + FRAME_TOP_MARGIN_HEIGHT (f)),
3120 width, flash_height); 3115 width, flash_height);
3121 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, 3116 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,
3122 flash_left, 3117 flash_left,
3123 (height - flash_height 3118 (height - flash_height
3124 - FRAME_INTERNAL_BORDER_WIDTH (f)), 3119 - FRAME_INTERNAL_BORDER_WIDTH (f)),