aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
authorGerd Moellmann2001-01-23 12:55:15 +0000
committerGerd Moellmann2001-01-23 12:55:15 +0000
commit499b1844b5a13583d3ccfaabffcbf8f7b04983c2 (patch)
tree5a8ff61a92a36d1d068d338f29fa860ea3364774 /src/xterm.c
parent6f3b74c61fbd52250eabb1003ace13db5f574e6c (diff)
downloademacs-499b1844b5a13583d3ccfaabffcbf8f7b04983c2.tar.gz
emacs-499b1844b5a13583d3ccfaabffcbf8f7b04983c2.zip
(x_set_window_size_1): New function extracted from
x_set_window_size. (x_set_window_size): Use it. (x_set_window_size) [USE_X_TOOLKIT]: Handle case that window doesn't have a widget, like tooltips.
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c69
1 files changed, 44 insertions, 25 deletions
diff --git a/src/xterm.c b/src/xterm.c
index c3ae8791d7f..5adab80245c 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -396,6 +396,7 @@ enum draw_glyphs_face
396 DRAW_IMAGE_SUNKEN 396 DRAW_IMAGE_SUNKEN
397}; 397};
398 398
399static void x_set_window_size_1 P_ ((struct frame *, int, int, int));
399static const XColor *x_color_cells P_ ((struct frame *, int *)); 400static const XColor *x_color_cells P_ ((struct frame *, int *));
400static void x_update_window_end P_ ((struct window *, int, int)); 401static void x_update_window_end P_ ((struct window *, int, int));
401static void frame_to_window_pixel_xy P_ ((struct window *, int *, int *)); 402static void frame_to_window_pixel_xy P_ ((struct window *, int *, int *));
@@ -11866,37 +11867,19 @@ x_set_offset (f, xoff, yoff, change_gravity)
11866 UNBLOCK_INPUT; 11867 UNBLOCK_INPUT;
11867} 11868}
11868 11869
11869/* Call this to change the size of frame F's x-window.
11870 If CHANGE_GRAVITY is 1, we change to top-left-corner window gravity
11871 for this size change and subsequent size changes.
11872 Otherwise we leave the window gravity unchanged. */
11873 11870
11874void 11871/* Change the size of frame F's X window to COLS/ROWS in the case F
11875x_set_window_size (f, change_gravity, cols, rows) 11872 doesn't have a widget. If CHANGE_GRAVITY is 1, we change to
11873 top-left-corner window gravity for this size change and subsequent
11874 size changes. Otherwise we leave the window gravity unchanged. */
11875
11876static void
11877x_set_window_size_1 (f, change_gravity, cols, rows)
11876 struct frame *f; 11878 struct frame *f;
11877 int change_gravity; 11879 int change_gravity;
11878 int cols, rows; 11880 int cols, rows;
11879{ 11881{
11880#ifndef USE_X_TOOLKIT
11881 int pixelwidth, pixelheight; 11882 int pixelwidth, pixelheight;
11882#endif
11883
11884 BLOCK_INPUT;
11885
11886#ifdef USE_X_TOOLKIT
11887 {
11888 /* The x and y position of the widget is clobbered by the
11889 call to XtSetValues within EmacsFrameSetCharSize.
11890 This is a real kludge, but I don't understand Xt so I can't
11891 figure out a correct fix. Can anyone else tell me? -- rms. */
11892 int xpos = f->output_data.x->widget->core.x;
11893 int ypos = f->output_data.x->widget->core.y;
11894 EmacsFrameSetCharSize (f->output_data.x->edit_widget, cols, rows);
11895 f->output_data.x->widget->core.x = xpos;
11896 f->output_data.x->widget->core.y = ypos;
11897 }
11898
11899#else /* not USE_X_TOOLKIT */
11900 11883
11901 check_frame_size (f, &rows, &cols); 11884 check_frame_size (f, &rows, &cols);
11902 f->output_data.x->vertical_scroll_bar_extra 11885 f->output_data.x->vertical_scroll_bar_extra
@@ -11941,7 +11924,43 @@ x_set_window_size (f, change_gravity, cols, rows)
11941 SET_FRAME_GARBAGED (f); 11924 SET_FRAME_GARBAGED (f);
11942 11925
11943 XFlush (FRAME_X_DISPLAY (f)); 11926 XFlush (FRAME_X_DISPLAY (f));
11927}
11928
11929
11930/* Call this to change the size of frame F's x-window.
11931 If CHANGE_GRAVITY is 1, we change to top-left-corner window gravity
11932 for this size change and subsequent size changes.
11933 Otherwise we leave the window gravity unchanged. */
11944 11934
11935void
11936x_set_window_size (f, change_gravity, cols, rows)
11937 struct frame *f;
11938 int change_gravity;
11939 int cols, rows;
11940{
11941 BLOCK_INPUT;
11942
11943#ifdef USE_X_TOOLKIT
11944
11945 if (f->output_data.x->widget != None)
11946 {
11947 /* The x and y position of the widget is clobbered by the
11948 call to XtSetValues within EmacsFrameSetCharSize.
11949 This is a real kludge, but I don't understand Xt so I can't
11950 figure out a correct fix. Can anyone else tell me? -- rms. */
11951 int xpos = f->output_data.x->widget->core.x;
11952 int ypos = f->output_data.x->widget->core.y;
11953 EmacsFrameSetCharSize (f->output_data.x->edit_widget, cols, rows);
11954 f->output_data.x->widget->core.x = xpos;
11955 f->output_data.x->widget->core.y = ypos;
11956 }
11957 else
11958 x_set_window_size_1 (f, change_gravity, cols, rows);
11959
11960#else /* not USE_X_TOOLKIT */
11961
11962 x_set_window_size_1 (f, change_gravity, cols, rows);
11963
11945#endif /* not USE_X_TOOLKIT */ 11964#endif /* not USE_X_TOOLKIT */
11946 11965
11947 /* If cursor was outside the new size, mark it as off. */ 11966 /* If cursor was outside the new size, mark it as off. */