diff options
| author | Martin Rudalics | 2014-03-30 15:31:45 +0200 |
|---|---|---|
| committer | Martin Rudalics | 2014-03-30 15:31:45 +0200 |
| commit | 632e91a6452ee7b56f2153746ad17fa643d512b8 (patch) | |
| tree | d7907f36ba832758b3de5df7495801424d50e240 /src | |
| parent | 045902f0e1695cdbc9fbcd9e072826eb775aa2f6 (diff) | |
| download | emacs-632e91a6452ee7b56f2153746ad17fa643d512b8.tar.gz emacs-632e91a6452ee7b56f2153746ad17fa643d512b8.zip | |
In x_set_window_size postpone calculation of default frame sizes (Bug#17142).
* frame.c (x_set_frame_parameters): Calculate default values of
new frame sizes only after all other frame parameters have been
processed (Bug#17142).
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/frame.c | 41 |
2 files changed, 30 insertions, 17 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index d67b7513e37..4a761249376 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2014-03-30 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * frame.c (x_set_frame_parameters): Calculate default values of | ||
| 4 | new frame sizes only after all other frame parameters have been | ||
| 5 | processed (Bug#17142). | ||
| 6 | |||
| 1 | 2014-03-28 Ken Brown <kbrown@cornell.edu> | 7 | 2014-03-28 Ken Brown <kbrown@cornell.edu> |
| 2 | 8 | ||
| 3 | * conf_post.h (SYSTEM_PURESIZE_EXTRA) [CYGWIN]: Set to 10000. | 9 | * conf_post.h (SYSTEM_PURESIZE_EXTRA) [CYGWIN]: Set to 10000. |
diff --git a/src/frame.c b/src/frame.c index 055ce36ff4f..c5a2f6ab245 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -2795,6 +2795,7 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist) | |||
| 2795 | set them both at once. So we wait until we've looked at the | 2795 | set them both at once. So we wait until we've looked at the |
| 2796 | entire list before we set them. */ | 2796 | entire list before we set them. */ |
| 2797 | int width, height; | 2797 | int width, height; |
| 2798 | bool width_change = 0, height_change = 0; | ||
| 2798 | 2799 | ||
| 2799 | /* Same here. */ | 2800 | /* Same here. */ |
| 2800 | Lisp_Object left, top; | 2801 | Lisp_Object left, top; |
| @@ -2810,7 +2811,6 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist) | |||
| 2810 | #ifdef HAVE_X_WINDOWS | 2811 | #ifdef HAVE_X_WINDOWS |
| 2811 | bool icon_left_no_change = 0, icon_top_no_change = 0; | 2812 | bool icon_left_no_change = 0, icon_top_no_change = 0; |
| 2812 | #endif | 2813 | #endif |
| 2813 | bool size_changed = 0; | ||
| 2814 | struct gcpro gcpro1, gcpro2; | 2814 | struct gcpro gcpro1, gcpro2; |
| 2815 | 2815 | ||
| 2816 | i = 0; | 2816 | i = 0; |
| @@ -2844,18 +2844,6 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist) | |||
| 2844 | top = left = Qunbound; | 2844 | top = left = Qunbound; |
| 2845 | icon_left = icon_top = Qunbound; | 2845 | icon_left = icon_top = Qunbound; |
| 2846 | 2846 | ||
| 2847 | /* Provide default values for HEIGHT and WIDTH. */ | ||
| 2848 | width = (f->new_width | ||
| 2849 | ? (f->new_pixelwise | ||
| 2850 | ? f->new_width | ||
| 2851 | : (f->new_width * FRAME_COLUMN_WIDTH (f))) | ||
| 2852 | : FRAME_TEXT_WIDTH (f)); | ||
| 2853 | height = (f->new_height | ||
| 2854 | ? (f->new_pixelwise | ||
| 2855 | ? f->new_height | ||
| 2856 | : (f->new_height * FRAME_LINE_HEIGHT (f))) | ||
| 2857 | : FRAME_TEXT_HEIGHT (f)); | ||
| 2858 | |||
| 2859 | /* Process foreground_color and background_color before anything else. | 2847 | /* Process foreground_color and background_color before anything else. |
| 2860 | They are independent of other properties, but other properties (e.g., | 2848 | They are independent of other properties, but other properties (e.g., |
| 2861 | cursor_color) are dependent upon them. */ | 2849 | cursor_color) are dependent upon them. */ |
| @@ -2897,12 +2885,12 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist) | |||
| 2897 | 2885 | ||
| 2898 | if (EQ (prop, Qwidth) && RANGED_INTEGERP (0, val, INT_MAX)) | 2886 | if (EQ (prop, Qwidth) && RANGED_INTEGERP (0, val, INT_MAX)) |
| 2899 | { | 2887 | { |
| 2900 | size_changed = 1; | 2888 | width_change = 1; |
| 2901 | width = XFASTINT (val) * FRAME_COLUMN_WIDTH (f) ; | 2889 | width = XFASTINT (val) * FRAME_COLUMN_WIDTH (f) ; |
| 2902 | } | 2890 | } |
| 2903 | else if (EQ (prop, Qheight) && RANGED_INTEGERP (0, val, INT_MAX)) | 2891 | else if (EQ (prop, Qheight) && RANGED_INTEGERP (0, val, INT_MAX)) |
| 2904 | { | 2892 | { |
| 2905 | size_changed = 1; | 2893 | height_change = 1; |
| 2906 | height = XFASTINT (val) * FRAME_LINE_HEIGHT (f); | 2894 | height = XFASTINT (val) * FRAME_LINE_HEIGHT (f); |
| 2907 | } | 2895 | } |
| 2908 | else if (EQ (prop, Qtop)) | 2896 | else if (EQ (prop, Qtop)) |
| @@ -2989,11 +2977,30 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist) | |||
| 2989 | 2977 | ||
| 2990 | XSETFRAME (frame, f); | 2978 | XSETFRAME (frame, f); |
| 2991 | 2979 | ||
| 2992 | if (size_changed | 2980 | if ((width_change || height_change) |
| 2993 | && (width != FRAME_TEXT_WIDTH (f) | 2981 | && (width != FRAME_TEXT_WIDTH (f) |
| 2994 | || height != FRAME_TEXT_HEIGHT (f) | 2982 | || height != FRAME_TEXT_HEIGHT (f) |
| 2995 | || f->new_height || f->new_width)) | 2983 | || f->new_height || f->new_width)) |
| 2996 | Fset_frame_size (frame, make_number (width), make_number (height), Qt); | 2984 | { |
| 2985 | /* If necessary provide default values for HEIGHT and WIDTH. Do | ||
| 2986 | that here since otherwise a size change implied by an | ||
| 2987 | intermittent font change may get lost as in Bug#17142. */ | ||
| 2988 | if (!width_change) | ||
| 2989 | width = (f->new_width | ||
| 2990 | ? (f->new_pixelwise | ||
| 2991 | ? f->new_width | ||
| 2992 | : (f->new_width * FRAME_COLUMN_WIDTH (f))) | ||
| 2993 | : FRAME_TEXT_WIDTH (f)); | ||
| 2994 | |||
| 2995 | if (!height_change) | ||
| 2996 | height = (f->new_height | ||
| 2997 | ? (f->new_pixelwise | ||
| 2998 | ? f->new_height | ||
| 2999 | : (f->new_height * FRAME_LINE_HEIGHT (f))) | ||
| 3000 | : FRAME_TEXT_HEIGHT (f)); | ||
| 3001 | |||
| 3002 | Fset_frame_size (frame, make_number (width), make_number (height), Qt); | ||
| 3003 | } | ||
| 2997 | 3004 | ||
| 2998 | if ((!NILP (left) || !NILP (top)) | 3005 | if ((!NILP (left) || !NILP (top)) |
| 2999 | && ! (left_no_change && top_no_change) | 3006 | && ! (left_no_change && top_no_change) |