X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/77229aad98d5c81a559fb1ba5161ed2a7f13aec4..dce59e79ab8a6ecc869ceda44d579b8b1e8e10d5:/src/xterm.c diff --git a/src/xterm.c b/src/xterm.c index c8c5d6e95c..2ffe766851 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -358,7 +358,7 @@ static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *)); static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int, enum text_cursor_kinds)); -static void x_clip_to_row P_ ((struct window *, struct glyph_row *, GC)); +static void x_clip_to_row P_ ((struct window *, struct glyph_row *, int, GC)); static void x_flush P_ ((struct frame *f)); static void x_update_begin P_ ((struct frame *)); static void x_update_window_begin P_ ((struct window *)); @@ -710,12 +710,12 @@ x_draw_fringe_bitmap (w, row, p) int oldVH = row->visible_height; row->visible_height = p->h; row->y -= rowY - p->y; - x_clip_to_row (w, row, gc); + x_clip_to_row (w, row, -1, gc); row->y = oldY; row->visible_height = oldVH; } else - x_clip_to_row (w, row, gc); + x_clip_to_row (w, row, -1, gc); if (p->bx >= 0 && !p->overlay_p) { @@ -7142,18 +7142,19 @@ XTread_socket (sd, expected, hold_quit) mode lines must be clipped to the whole window. */ static void -x_clip_to_row (w, row, gc) +x_clip_to_row (w, row, area, gc) struct window *w; struct glyph_row *row; + int area; GC gc; { struct frame *f = XFRAME (WINDOW_FRAME (w)); XRectangle clip_rect; - int window_y, window_width; + int window_x, window_y, window_width; - window_box (w, -1, 0, &window_y, &window_width, 0); + window_box (w, area, &window_x, &window_y, &window_width, 0); - clip_rect.x = WINDOW_TO_FRAME_PIXEL_X (w, 0); + clip_rect.x = window_x; clip_rect.y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); clip_rect.y = max (clip_rect.y, window_y); clip_rect.width = window_width; @@ -7219,7 +7220,7 @@ x_draw_hollow_cursor (w, row) gc = dpyinfo->scratch_cursor_gc; /* Set clipping, draw the rectangle, and reset clipping again. */ - x_clip_to_row (w, row, gc); + x_clip_to_row (w, row, TEXT_AREA, gc); XDrawRectangle (dpy, FRAME_X_WINDOW (f), gc, x, y, wd, h); XSetClipMask (dpy, gc, None); } @@ -7291,7 +7292,7 @@ x_draw_bar_cursor (w, row, width, kind) width = min (cursor_glyph->pixel_width, width); w->phys_cursor_width = width; - x_clip_to_row (w, row, gc); + x_clip_to_row (w, row, TEXT_AREA, gc); if (kind == BAR_CURSOR) XFillRectangle (dpy, window, gc, @@ -8170,20 +8171,11 @@ x_calc_absolute_position (f) if (! ((flags & XNegative) || (flags & YNegative))) return; - /* Find the offsets of the outside upper-left corner of - the inner window, with respect to the outer window. - But do this only if we will need the results. */ - if (f->output_data.x->parent_desc != FRAME_X_DISPLAY_INFO (f)->root_window) - /* This is to get *_pixels_outer_diff. */ - x_real_positions (f, &win_x, &win_y); - /* Treat negative positions as relative to the leftmost bottommost position that fits on the screen. */ if (flags & XNegative) f->left_pos = (FRAME_X_DISPLAY_INFO (f)->width - - 2 * FRAME_X_OUTPUT (f)->x_pixels_outer_diff - - FRAME_PIXEL_WIDTH (f) - + f->left_pos); + - FRAME_PIXEL_WIDTH (f) + f->left_pos); { int height = FRAME_PIXEL_HEIGHT (f); @@ -8205,15 +8197,7 @@ x_calc_absolute_position (f) #endif if (flags & YNegative) - f->top_pos = (FRAME_X_DISPLAY_INFO (f)->height - - FRAME_X_OUTPUT (f)->y_pixels_outer_diff - - /* Assume the window manager decorations are the same size on - three sides, i.e. left, right and bottom. This is to - compensate for the bottom part. */ - - FRAME_X_OUTPUT (f)->x_pixels_outer_diff - - height - + f->top_pos); + f->top_pos = (FRAME_X_DISPLAY_INFO (f)->height - height + f->top_pos); } /* The left_pos and top_pos @@ -8329,7 +8313,9 @@ x_check_expected_move (f) FRAME_X_OUTPUT (f)->move_offset_left = expect_left - f->left_pos; FRAME_X_OUTPUT (f)->move_offset_top = expect_top - f->top_pos; - x_set_offset (f, expect_left, expect_top, 1); + f->left_pos = expect_left; + f->top_pos = expect_top; + x_set_offset (f, expect_left, expect_top, 0); } else if (FRAME_X_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN) FRAME_X_DISPLAY_INFO (f)->wm_type = X_WMTYPE_B;