comparison src/xterm.c @ 35487:e92d3f50f8b8

(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.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 23 Jan 2001 12:55:15 +0000
parents 2470cdee5ed8
children 5ad77d538e08
comparison
equal deleted inserted replaced
35486:9be4b357b53a 35487:e92d3f50f8b8
394 DRAW_MOUSE_FACE, 394 DRAW_MOUSE_FACE,
395 DRAW_IMAGE_RAISED, 395 DRAW_IMAGE_RAISED,
396 DRAW_IMAGE_SUNKEN 396 DRAW_IMAGE_SUNKEN
397 }; 397 };
398 398
399 static void x_set_window_size_1 P_ ((struct frame *, int, int, int));
399 static const XColor *x_color_cells P_ ((struct frame *, int *)); 400 static const XColor *x_color_cells P_ ((struct frame *, int *));
400 static void x_update_window_end P_ ((struct window *, int, int)); 401 static void x_update_window_end P_ ((struct window *, int, int));
401 static void frame_to_window_pixel_xy P_ ((struct window *, int *, int *)); 402 static void frame_to_window_pixel_xy P_ ((struct window *, int *, int *));
402 void x_delete_display P_ ((struct x_display_info *)); 403 void x_delete_display P_ ((struct x_display_info *));
403 static unsigned int x_x_to_emacs_modifiers P_ ((struct x_display_info *, 404 static unsigned int x_x_to_emacs_modifiers P_ ((struct x_display_info *,
11864 modified_left, modified_top); 11865 modified_left, modified_top);
11865 #endif /* not USE_X_TOOLKIT */ 11866 #endif /* not USE_X_TOOLKIT */
11866 UNBLOCK_INPUT; 11867 UNBLOCK_INPUT;
11867 } 11868 }
11868 11869
11869 /* Call this to change the size of frame F's x-window. 11870
11870 If CHANGE_GRAVITY is 1, we change to top-left-corner window gravity 11871 /* Change the size of frame F's X window to COLS/ROWS in the case F
11871 for this size change and subsequent size changes. 11872 doesn't have a widget. If CHANGE_GRAVITY is 1, we change to
11872 Otherwise we leave the window gravity unchanged. */ 11873 top-left-corner window gravity for this size change and subsequent
11873 11874 size changes. Otherwise we leave the window gravity unchanged. */
11874 void 11875
11875 x_set_window_size (f, change_gravity, cols, rows) 11876 static void
11877 x_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
11903 = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f) 11886 = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f)
11904 ? 0 11887 ? 0
11939 for, then the event won't cause the screen to become garbaged, so 11922 for, then the event won't cause the screen to become garbaged, so
11940 we have to make sure to do it here. */ 11923 we have to make sure to do it here. */
11941 SET_FRAME_GARBAGED (f); 11924 SET_FRAME_GARBAGED (f);
11942 11925
11943 XFlush (FRAME_X_DISPLAY (f)); 11926 XFlush (FRAME_X_DISPLAY (f));
11944 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. */
11934
11935 void
11936 x_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. */
11948 mark_window_cursors_off (XWINDOW (f->root_window)); 11967 mark_window_cursors_off (XWINDOW (f->root_window));
11949 11968