comparison src/xterm.c @ 7262:68fc80bf10df

(x_wm_set_size_hint): Don't try to handle negative positions. (x_calc_absolute_position): New arg FLAGS. Use XNegative and YNegative. (x_set_offset): Pass new arg.
author Richard M. Stallman <rms@gnu.org>
date Sun, 01 May 1994 23:29:27 +0000
parents 682ff6213c36
children a701bffa0f9d
comparison
equal deleted inserted replaced
7261:a752899939f7 7262:68fc80bf10df
5104 5104
5105 return 0; 5105 return 0;
5106 } 5106 }
5107 #endif /* ! defined (HAVE_X11) */ 5107 #endif /* ! defined (HAVE_X11) */
5108 5108
5109 x_calc_absolute_position (f) 5109 x_calc_absolute_position (f, flags)
5110 struct frame *f; 5110 struct frame *f;
5111 int flags;
5111 { 5112 {
5112 #ifdef HAVE_X11 5113 #ifdef HAVE_X11
5113 Window win, child; 5114 Window win, child;
5114 int win_x = 0, win_y = 0; 5115 int win_x = 0, win_y = 0;
5115 5116
5132 UNBLOCK_INPUT; 5133 UNBLOCK_INPUT;
5133 } 5134 }
5134 5135
5135 /* Treat negative positions as relative to the leftmost bottommost 5136 /* Treat negative positions as relative to the leftmost bottommost
5136 position that fits on the screen. */ 5137 position that fits on the screen. */
5137 if (f->display.x->left_pos < 0) 5138 if (flags & XNegative)
5138 f->display.x->left_pos = (x_screen_width 5139 f->display.x->left_pos = (x_screen_width
5139 - 2 * f->display.x->border_width - win_x 5140 - 2 * f->display.x->border_width - win_x
5140 - PIXEL_WIDTH (f) 5141 - PIXEL_WIDTH (f)
5141 + f->display.x->left_pos); 5142 + f->display.x->left_pos);
5142 5143
5143 if (f->display.x->top_pos < 0) 5144 if (flags & YNegative)
5144 f->display.x->top_pos = (x_screen_height 5145 f->display.x->top_pos = (x_screen_height
5145 - 2 * f->display.x->border_width - win_y 5146 - 2 * f->display.x->border_width - win_y
5146 - PIXEL_HEIGHT (f) 5147 - PIXEL_HEIGHT (f)
5147 + f->display.x->top_pos); 5148 + f->display.x->top_pos);
5148 5149
5166 register int xoff, yoff; 5167 register int xoff, yoff;
5167 int change_gravity; 5168 int change_gravity;
5168 { 5169 {
5169 f->display.x->top_pos = yoff; 5170 f->display.x->top_pos = yoff;
5170 f->display.x->left_pos = xoff; 5171 f->display.x->left_pos = xoff;
5171 x_calc_absolute_position (f); 5172 x_calc_absolute_position (f, 0);
5172 5173
5173 BLOCK_INPUT; 5174 BLOCK_INPUT;
5174 #ifdef USE_X_TOOLKIT 5175 #ifdef USE_X_TOOLKIT
5175 XMoveWindow (XDISPLAY XtWindow (f->display.x->widget), 5176 XMoveWindow (XDISPLAY XtWindow (f->display.x->widget),
5176 f->display.x->left_pos, f->display.x->top_pos); 5177 f->display.x->left_pos, f->display.x->top_pos);
5750 5751
5751 flexlines = f->height; 5752 flexlines = f->height;
5752 5753
5753 size_hints.x = f->display.x->left_pos; 5754 size_hints.x = f->display.x->left_pos;
5754 size_hints.y = f->display.x->top_pos; 5755 size_hints.y = f->display.x->top_pos;
5755
5756 /* Treat negative positions as relative to the leftmost bottommost
5757 position that fits on the screen. */
5758 if (flags & XNegative)
5759 size_hints.x = (x_screen_width
5760 - 2 * f->display.x->border_width
5761 - PIXEL_WIDTH (f)
5762 + f->display.x->left_pos);
5763 if (flags & YNegative)
5764 size_hints.y = (x_screen_height
5765 - 2 * f->display.x->border_width
5766 - PIXEL_HEIGHT (f)
5767 + f->display.x->top_pos);
5768 5756
5769 #ifdef USE_X_TOOLKIT 5757 #ifdef USE_X_TOOLKIT
5770 XtSetArg (al[ac], XtNwidth, &widget_width); ac++; 5758 XtSetArg (al[ac], XtNwidth, &widget_width); ac++;
5771 XtSetArg (al[ac], XtNheight, &widget_height); ac++; 5759 XtSetArg (al[ac], XtNheight, &widget_height); ac++;
5772 XtGetValues (f->display.x->column_widget, al, ac); 5760 XtGetValues (f->display.x->column_widget, al, ac);