comparison src/frame.c @ 101019:f883a64629e1

(x_set_frame_parameters): Remember requested value for fullscreen before it's reset by the parameter handler.
author Martin Rudalics <rudalics@gmx.at>
date Fri, 09 Jan 2009 07:44:00 +0000
parents 772f216c2808
children a94440e70b7c
comparison
equal deleted inserted replaced
101018:646ca842dc74 101019:f883a64629e1
2925 int left_no_change = 0, top_no_change = 0; 2925 int left_no_change = 0, top_no_change = 0;
2926 int icon_left_no_change = 0, icon_top_no_change = 0; 2926 int icon_left_no_change = 0, icon_top_no_change = 0;
2927 int fullscreen_is_being_set = 0; 2927 int fullscreen_is_being_set = 0;
2928 int height_for_full_width = 0; 2928 int height_for_full_width = 0;
2929 int width_for_full_height = 0; 2929 int width_for_full_height = 0;
2930 enum fullscreen_type fullscreen_wanted = FULLSCREEN_NONE;
2930 2931
2931 struct gcpro gcpro1, gcpro2; 2932 struct gcpro gcpro1, gcpro2;
2932 2933
2933 i = 0; 2934 i = 0;
2934 for (tail = alist; CONSP (tail); tail = Fcdr (tail)) 2935 for (tail = alist; CONSP (tail); tail = Fcdr (tail))
2967 2968
2968 /* Process foreground_color and background_color before anything else. 2969 /* Process foreground_color and background_color before anything else.
2969 They are independent of other properties, but other properties (e.g., 2970 They are independent of other properties, but other properties (e.g.,
2970 cursor_color) are dependent upon them. */ 2971 cursor_color) are dependent upon them. */
2971 /* Process default font as well, since fringe widths depends on it. */ 2972 /* Process default font as well, since fringe widths depends on it. */
2972 /* Also, process fullscreen, width and height depend upon that */ 2973 /* Also, process fullscreen, width and height depend upon that. */
2973 for (p = 0; p < i; p++) 2974 for (p = 0; p < i; p++)
2974 { 2975 {
2975 Lisp_Object prop, val; 2976 Lisp_Object prop, val;
2976 2977
2977 prop = parms[p]; 2978 prop = parms[p];
2980 || EQ (prop, Qbackground_color) 2981 || EQ (prop, Qbackground_color)
2981 || EQ (prop, Qfont) 2982 || EQ (prop, Qfont)
2982 || EQ (prop, Qfullscreen)) 2983 || EQ (prop, Qfullscreen))
2983 { 2984 {
2984 register Lisp_Object param_index, old_value; 2985 register Lisp_Object param_index, old_value;
2986
2987 if (EQ (prop, Qfullscreen))
2988 {
2989 /* The parameter handler can reset f->want_fullscreen to
2990 FULLSCREEN_NONE. But we need the requested value later
2991 to decide whether a height or width parameter shall be
2992 applied. Therefore, we remember the requested value in
2993 fullscreen_wanted for the following two cases. */
2994 if (EQ (val, Qfullheight))
2995 fullscreen_wanted = FULLSCREEN_HEIGHT;
2996 else if (EQ (val, Qfullwidth))
2997 fullscreen_wanted = FULLSCREEN_WIDTH;
2998 }
2985 2999
2986 old_value = get_frame_param (f, prop); 3000 old_value = get_frame_param (f, prop);
2987 fullscreen_is_being_set |= EQ (prop, Qfullscreen); 3001 fullscreen_is_being_set |= EQ (prop, Qfullscreen);
2988 if (NILP (Fequal (val, old_value))) 3002 if (NILP (Fequal (val, old_value)))
2989 { 3003 {
3089 3103
3090 x_fullscreen_adjust (f, &width, &height, &new_top, &new_left); 3104 x_fullscreen_adjust (f, &width, &height, &new_top, &new_left);
3091 if (new_top != f->top_pos || new_left != f->left_pos) 3105 if (new_top != f->top_pos || new_left != f->left_pos)
3092 x_set_offset (f, new_left, new_top, 1); 3106 x_set_offset (f, new_left, new_top, 1);
3093 3107
3094 /* When height was set and we want fullwidth make sure 3108 /* When both height and fullwidth were requested, make sure the
3095 height gets applied. */ 3109 requested value for height gets applied. */
3096 if (height_for_full_width && (f->want_fullscreen & FULLSCREEN_WIDTH)) 3110 if (height_for_full_width && fullscreen_wanted == FULLSCREEN_WIDTH)
3097 height = height_for_full_width; 3111 height = height_for_full_width;
3098 /* When width was set and we want fullheight make sure 3112 /* When both width and fullheight were requested, make sure the
3099 width gets applied. */ 3113 requested value for width gets applied. */
3100 if (width_for_full_height && (f->want_fullscreen & FULLSCREEN_HEIGHT)) 3114 if (width_for_full_height && fullscreen_wanted == FULLSCREEN_HEIGHT)
3101 width = width_for_full_height; 3115 width = width_for_full_height;
3102 } 3116 }
3103 3117
3104 /* Don't set these parameters unless they've been explicitly 3118 /* Don't set these parameters unless they've been explicitly
3105 specified. The window might be mapped or resized while we're in 3119 specified. The window might be mapped or resized while we're in