From 7708ced012fc22dc9fed596d157f0f5f24b1bbcd Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Fri, 1 Dec 2000 22:15:12 +0000 Subject: [PATCH] (x_calc_absolute_position): Don't subtract menubar's height for YNegative. (x_calc_absolute_position) [USE_MOTIF]: Use the column widget's height; also see comment there. --- src/ChangeLog | 5 +++++ src/xterm.c | 40 ++++++++++++++++++++++++---------------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 9c98f9d31f6..085d44f8ce7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2000-12-01 Gerd Moellmann + * xterm.c (x_calc_absolute_position): Don't subtract menubar's + height for YNegative. + (x_calc_absolute_position) [USE_MOTIF]: Use the column widget's + height; also see comment there. + * window.c (coordinates_in_window): Handle computations for positions on the vertical bar and fringes differently for window-system frames. Consider some pixels near the vertical bar diff --git a/src/xterm.c b/src/xterm.c index 0caf901a8b1..603a6f6e575 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -11761,25 +11761,33 @@ x_calc_absolute_position (f) - PIXEL_WIDTH (f) + f->output_data.x->left_pos); - if (flags & YNegative) - { - int menubar_height = 0; + { + int height = PIXEL_HEIGHT (f); -#ifdef USE_X_TOOLKIT - if (f->output_data.x->menubar_widget) - menubar_height - = (f->output_data.x->menubar_widget->core.height - + f->output_data.x->menubar_widget->core.border_width); +#if defined USE_X_TOOLKIT && defined USE_MOTIF + /* Something is fishy here. When using Motif, starting Emacs with + `-g -0-0', the frame appears too low by a few pixels. + + This seems to be so because initially, while Emacs is starting, + the column widget's height and the frame's pixel height are + different. The column widget's height is the right one. In + later invocations, when Emacs is up, the frame's pixel height + is right, though. + + It's not obvious where the initial small difference comes from. + 2000-12-01, gerd. */ + + XtVaGetValues (f->output_data.x->column_widget, XtNheight, &height, NULL); #endif - - f->output_data.x->top_pos = (FRAME_X_DISPLAY_INFO (f)->height - - 2 * f->output_data.x->border_width - - win_y - - PIXEL_HEIGHT (f) - - menubar_height - + f->output_data.x->top_pos); - } + if (flags & YNegative) + f->output_data.x->top_pos = (FRAME_X_DISPLAY_INFO (f)->height + - 2 * f->output_data.x->border_width + - win_y + - height + + f->output_data.x->top_pos); + } + /* The left_pos and top_pos are now relative to the top and left screen edges, so the flags should correspond. */ -- 2.39.2