aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Rumney2002-02-18 00:04:14 +0000
committerJason Rumney2002-02-18 00:04:14 +0000
commitf7b9d4d15e6050bd69f0cde149153531eddd089b (patch)
tree94cacb0cb42ade707742e6f999648de56ffa8357 /src
parent42715db3b3922df51eba05273c3816943cd50e28 (diff)
downloademacs-f7b9d4d15e6050bd69f0cde149153531eddd089b.tar.gz
emacs-f7b9d4d15e6050bd69f0cde149153531eddd089b.zip
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog32
-rw-r--r--src/w32bdf.c7
-rw-r--r--src/w32fns.c128
3 files changed, 149 insertions, 18 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 3ac11d89b6a..94fb586be40 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,35 @@
12002-02-17 Jason Rumney <jasonr@gnu.org>
2
3 * w32term.c (x_autoselect_window_p): New variable.
4 (syms_of_w32term): DEFVAR_BOOL and initialize it.
5 (note_mouse_movement): Use it.
6
7 * w32fns.c (w32_load_system_font): Never set fonts_changed_p to zero.
8
9 * w32bdf.c (w32_load_bdf_font): Maybe set fonts_changed_p.
10
11 * w32fns.c (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth):
12 New variables.
13 (syms_of_w32fns): Intern and staticpro them.
14 (x_frame_parms) <"fullscreen">: New parameter.
15 (x_fullscreen_move, x_set_fullscreen): New functions.
16 (x_set_frame_parameters): Support Qfullscreen.
17 (x_real_positions): Save x/y_pixels_diff frame params.
18 (x_figure_window_size): Support full-screen frames.
19 (Fx_create_frame): Default the fullscreen parameter.
20
21 * w32term.c (x_check_fullscreen, x_check_fullscreen_move)
22 (x_fullscreen_adjust): New functions.
23 (w32_read_socket) <WM_WINDOWPOSCHANGED>: Don't resize to
24 fullscreen. Call x_check_fullscreen_move, and set the
25 want_fullscreen member of output_data.w32
26 <WM_ACTIVATE, WM_ACTIVATEAPP>: Call x_check_fullscreen.
27
28 * w32term.h: New enum for FULLSCREEN_* constants.
29 (struct w32_output): New members want_fullscreen, x_pixels_diff,
30 y_pixels_diff, x_pixels_outer_diff, and y_pixels_outer_diff.
31 (x-fullscreen-adjust): New prototype.
32
12002-02-17 Kim F. Storm <storm@cua.dk> 332002-02-17 Kim F. Storm <storm@cua.dk>
2 34
3 * frame.c: (Vmouse_highlight): New variable. 35 * frame.c: (Vmouse_highlight): New variable.
diff --git a/src/w32bdf.c b/src/w32bdf.c
index 801c914d8d9..5bb5ba72bba 100644
--- a/src/w32bdf.c
+++ b/src/w32bdf.c
@@ -790,6 +790,13 @@ struct font_info *w32_load_bdf_font (struct frame *f, char *fontname,
790 fontp->relative_compose = bdf_font->relative_compose; 790 fontp->relative_compose = bdf_font->relative_compose;
791 fontp->default_ascent = bdf_font->default_ascent; 791 fontp->default_ascent = bdf_font->default_ascent;
792 792
793 /* Set global flag fonts_changed_p to non-zero if the font loaded
794 has a character with a smaller width than any other character
795 before, or if the font loaded has a smaller height than any
796 other font loaded before. If this happens, it will make a
797 glyph matrix reallocation necessary. */
798 fonts_changed_p |= x_compute_min_glyph_bounds (f);
799
793 UNBLOCK_INPUT; 800 UNBLOCK_INPUT;
794 dpyinfo->n_fonts++; 801 dpyinfo->n_fonts++;
795 return fontp; 802 return fontp;
diff --git a/src/w32fns.c b/src/w32fns.c
index d7e0f7bcd0f..1ecc7169065 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -270,6 +270,11 @@ Lisp_Object Qw32_charset_mac;
270Lisp_Object Qw32_charset_unicode; 270Lisp_Object Qw32_charset_unicode;
271#endif 271#endif
272 272
273Lisp_Object Qfullscreen;
274Lisp_Object Qfullwidth;
275Lisp_Object Qfullheight;
276Lisp_Object Qfullboth;
277
273extern Lisp_Object Qtop; 278extern Lisp_Object Qtop;
274extern Lisp_Object Qdisplay; 279extern Lisp_Object Qdisplay;
275extern Lisp_Object Qtool_bar_lines; 280extern Lisp_Object Qtool_bar_lines;
@@ -681,6 +686,7 @@ static void x_change_window_heights P_ ((Lisp_Object, int));
681/* TODO: Native Input Method support; see x_create_im. */ 686/* TODO: Native Input Method support; see x_create_im. */
682void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); 687void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
683static void x_set_line_spacing P_ ((struct frame *, Lisp_Object, Lisp_Object)); 688static void x_set_line_spacing P_ ((struct frame *, Lisp_Object, Lisp_Object));
689static void x_set_fullscreen P_ ((struct frame *, Lisp_Object, Lisp_Object));
684void x_set_background_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); 690void x_set_background_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
685void x_set_mouse_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); 691void x_set_mouse_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
686void x_set_cursor_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); 692void x_set_cursor_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
@@ -734,7 +740,8 @@ static struct x_frame_parm_table x_frame_parms[] =
734 {"screen-gamma", x_set_screen_gamma}, 740 {"screen-gamma", x_set_screen_gamma},
735 {"line-spacing", x_set_line_spacing}, 741 {"line-spacing", x_set_line_spacing},
736 {"left-fringe", x_set_fringe_width}, 742 {"left-fringe", x_set_fringe_width},
737 {"right-fringe", x_set_fringe_width} 743 {"right-fringe", x_set_fringe_width},
744 {"fullscreen", x_set_fullscreen},
738}; 745};
739 746
740/* Attach the `x-frame-parameter' properties to 747/* Attach the `x-frame-parameter' properties to
@@ -750,6 +757,27 @@ init_x_parm_symbols ()
750 make_number (i)); 757 make_number (i));
751} 758}
752 759
760/* Really try to move where we want to be in case of fullscreen. Some WMs
761 moves the window where we tell them. Some (mwm, twm) moves the outer
762 window manager window there instead.
763 Try to compensate for those WM here. */
764static void
765x_fullscreen_move (f, new_top, new_left)
766 struct frame *f;
767 int new_top;
768 int new_left;
769{
770 if (new_top != f->output_data.w32->top_pos
771 || new_left != f->output_data.w32->left_pos)
772 {
773 int move_x = new_left;
774 int move_y = new_top;
775
776 f->output_data.w32->want_fullscreen |= FULLSCREEN_MOVE_WAIT;
777 x_set_offset (f, move_x, move_y, 1);
778 }
779}
780
753/* Change the parameters of frame F as specified by ALIST. 781/* Change the parameters of frame F as specified by ALIST.
754 If a parameter is not specially recognized, do nothing; 782 If a parameter is not specially recognized, do nothing;
755 otherwise call the `x_set_...' function for that parameter. */ 783 otherwise call the `x_set_...' function for that parameter. */
@@ -778,6 +806,7 @@ x_set_frame_parameters (f, alist)
778 int i, p; 806 int i, p;
779 int left_no_change = 0, top_no_change = 0; 807 int left_no_change = 0, top_no_change = 0;
780 int icon_left_no_change = 0, icon_top_no_change = 0; 808 int icon_left_no_change = 0, icon_top_no_change = 0;
809 int fullscreen_is_being_set = 0;
781 810
782 struct gcpro gcpro1, gcpro2; 811 struct gcpro gcpro1, gcpro2;
783 812
@@ -835,11 +864,13 @@ x_set_frame_parameters (f, alist)
835 val = values[p]; 864 val = values[p];
836 if (EQ (prop, Qforeground_color) 865 if (EQ (prop, Qforeground_color)
837 || EQ (prop, Qbackground_color) 866 || EQ (prop, Qbackground_color)
838 || EQ (prop, Qfont)) 867 || EQ (prop, Qfont)
868 || EQ (prop, Qfullscreen))
839 { 869 {
840 register Lisp_Object param_index, old_value; 870 register Lisp_Object param_index, old_value;
841 871
842 old_value = get_frame_param (f, prop); 872 old_value = get_frame_param (f, prop);
873 fullscreen_is_being_set |= EQ (prop, Qfullscreen);
843 874
844 if (NILP (Fequal (val, old_value))) 875 if (NILP (Fequal (val, old_value)))
845 { 876 {
@@ -876,7 +907,8 @@ x_set_frame_parameters (f, alist)
876 icon_left = val; 907 icon_left = val;
877 else if (EQ (prop, Qforeground_color) 908 else if (EQ (prop, Qforeground_color)
878 || EQ (prop, Qbackground_color) 909 || EQ (prop, Qbackground_color)
879 || EQ (prop, Qfont)) 910 || EQ (prop, Qfont)
911 || EQ (prop, Qfullscreen))
880 /* Processed above. */ 912 /* Processed above. */
881 continue; 913 continue;
882 else 914 else
@@ -929,6 +961,21 @@ x_set_frame_parameters (f, alist)
929 XSETINT (icon_top, 0); 961 XSETINT (icon_top, 0);
930 } 962 }
931 963
964 if (FRAME_VISIBLE_P (f) && fullscreen_is_being_set)
965 {
966 /* If the frame is visible already and the fullscreen parameter is
967 being set, it is too late to set WM manager hints to specify
968 size and position.
969 Here we first get the width, height and position that applies to
970 fullscreen. We then move the frame to the appropriate
971 position. Resize of the frame is taken care of in the code after
972 this if-statement. */
973 int new_left, new_top;
974
975 x_fullscreen_adjust (f, &width, &height, &new_top, &new_left);
976 x_fullscreen_move (f, new_top, new_left);
977 }
978
932 /* Don't set these parameters unless they've been explicitly 979 /* Don't set these parameters unless they've been explicitly
933 specified. The window might be mapped or resized while we're in 980 specified. The window might be mapped or resized while we're in
934 this function, and we don't want to override that unless the lisp 981 this function, and we don't want to override that unless the lisp
@@ -1032,19 +1079,20 @@ x_real_positions (f, xptr, yptr)
1032 int *xptr, *yptr; 1079 int *xptr, *yptr;
1033{ 1080{
1034 POINT pt; 1081 POINT pt;
1082 RECT rect;
1035 1083
1036 { 1084 GetClientRect(FRAME_W32_WINDOW(f), &rect);
1037 RECT rect; 1085 AdjustWindowRect(&rect, f->output_data.w32->dwStyle, FRAME_EXTERNAL_MENU_BAR(f));
1038 1086
1039 GetClientRect(FRAME_W32_WINDOW(f), &rect); 1087 pt.x = rect.left;
1040 AdjustWindowRect(&rect, f->output_data.w32->dwStyle, FRAME_EXTERNAL_MENU_BAR(f)); 1088 pt.y = rect.top;
1041
1042 pt.x = rect.left;
1043 pt.y = rect.top;
1044 }
1045 1089
1046 ClientToScreen (FRAME_W32_WINDOW(f), &pt); 1090 ClientToScreen (FRAME_W32_WINDOW(f), &pt);
1047 1091
1092 /* Remember x_pixels_diff and y_pixels_diff. */
1093 f->output_data.w32->x_pixels_diff = pt.x - rect.left;
1094 f->output_data.w32->y_pixels_diff = pt.y - rect.top;
1095
1048 *xptr = pt.x; 1096 *xptr = pt.x;
1049 *yptr = pt.y; 1097 *yptr = pt.y;
1050} 1098}
@@ -1967,6 +2015,25 @@ x_set_line_spacing (f, new_value, old_value)
1967} 2015}
1968 2016
1969 2017
2018/* Change the `fullscreen' frame parameter of frame F. OLD_VALUE is
2019 the previous value of that parameter, NEW_VALUE is the new value. */
2020
2021static void
2022x_set_fullscreen (f, new_value, old_value)
2023 struct frame *f;
2024 Lisp_Object new_value, old_value;
2025{
2026 if (NILP (new_value))
2027 f->output_data.w32->want_fullscreen = FULLSCREEN_NONE;
2028 else if (EQ (new_value, Qfullboth))
2029 f->output_data.w32->want_fullscreen = FULLSCREEN_BOTH;
2030 else if (EQ (new_value, Qfullwidth))
2031 f->output_data.w32->want_fullscreen = FULLSCREEN_WIDTH;
2032 else if (EQ (new_value, Qfullheight))
2033 f->output_data.w32->want_fullscreen = FULLSCREEN_HEIGHT;
2034}
2035
2036
1970/* Change the `screen-gamma' frame parameter of frame F. OLD_VALUE is 2037/* Change the `screen-gamma' frame parameter of frame F. OLD_VALUE is
1971 the previous value of that parameter, NEW_VALUE is the new value. */ 2038 the previous value of that parameter, NEW_VALUE is the new value. */
1972 2039
@@ -3285,7 +3352,9 @@ x_figure_window_size (f, parms)
3285 : FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0 3352 : FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0
3286 ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f) 3353 ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f)
3287 : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.w32->font))); 3354 : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.w32->font)));
3355
3288 x_compute_fringe_widths (f, 0); 3356 x_compute_fringe_widths (f, 0);
3357
3289 f->output_data.w32->pixel_width = CHAR_TO_PIXEL_WIDTH (f, f->width); 3358 f->output_data.w32->pixel_width = CHAR_TO_PIXEL_WIDTH (f, f->width);
3290 f->output_data.w32->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height); 3359 f->output_data.w32->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height);
3291 3360
@@ -3356,6 +3425,22 @@ x_figure_window_size (f, parms)
3356 window_prompting |= PPosition; 3425 window_prompting |= PPosition;
3357 } 3426 }
3358 3427
3428 if (f->output_data.w32->want_fullscreen != FULLSCREEN_NONE)
3429 {
3430 int left, top;
3431 int width, height;
3432
3433 /* It takes both for some WM:s to place it where we want */
3434 window_prompting = USPosition | PPosition;
3435 x_fullscreen_adjust (f, &width, &height, &top, &left);
3436 f->width = width;
3437 f->height = height;
3438 f->output_data.w32->pixel_width = CHAR_TO_PIXEL_WIDTH (f, f->width);
3439 f->output_data.w32->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height);
3440 f->output_data.w32->left_pos = left;
3441 f->output_data.w32->top_pos = top;
3442 }
3443
3359 return window_prompting; 3444 return window_prompting;
3360} 3445}
3361 3446
@@ -5564,6 +5649,8 @@ This function is an internal primitive--use `make-frame' instead. */)
5564 "bufferPredicate", "BufferPredicate", RES_TYPE_SYMBOL); 5649 "bufferPredicate", "BufferPredicate", RES_TYPE_SYMBOL);
5565 x_default_parameter (f, parms, Qtitle, Qnil, 5650 x_default_parameter (f, parms, Qtitle, Qnil,
5566 "title", "Title", RES_TYPE_STRING); 5651 "title", "Title", RES_TYPE_STRING);
5652 x_default_parameter (f, parms, Qfullscreen, Qnil,
5653 "fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
5567 5654
5568 f->output_data.w32->dwStyle = WS_OVERLAPPEDWINDOW; 5655 f->output_data.w32->dwStyle = WS_OVERLAPPEDWINDOW;
5569 f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window; 5656 f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window;
@@ -5959,10 +6046,10 @@ w32_load_system_font (f,fontname,size)
5959 6046
5960 /* Set global flag fonts_changed_p to non-zero if the font loaded 6047 /* Set global flag fonts_changed_p to non-zero if the font loaded
5961 has a character with a smaller width than any other character 6048 has a character with a smaller width than any other character
5962 before, or if the font loaded has a smalle>r height than any 6049 before, or if the font loaded has a smaller height than any
5963 other font loaded before. If this happens, it will make a 6050 other font loaded before. If this happens, it will make a
5964 glyph matrix reallocation necessary. */ 6051 glyph matrix reallocation necessary. */
5965 fonts_changed_p = x_compute_min_glyph_bounds (f); 6052 fonts_changed_p |= x_compute_min_glyph_bounds (f);
5966 UNBLOCK_INPUT; 6053 UNBLOCK_INPUT;
5967 return fontp; 6054 return fontp;
5968 } 6055 }
@@ -14487,9 +14574,6 @@ syms_of_w32fns ()
14487 14574
14488 w32_visible_system_caret_hwnd = NULL; 14575 w32_visible_system_caret_hwnd = NULL;
14489 14576
14490 /* The section below is built by the lisp expression at the top of the file,
14491 just above where these variables are declared. */
14492 /*&&& init symbols here &&&*/
14493 Qauto_raise = intern ("auto-raise"); 14577 Qauto_raise = intern ("auto-raise");
14494 staticpro (&Qauto_raise); 14578 staticpro (&Qauto_raise);
14495 Qauto_lower = intern ("auto-lower"); 14579 Qauto_lower = intern ("auto-lower");
@@ -14556,7 +14640,14 @@ syms_of_w32fns ()
14556 staticpro (&Qcenter); 14640 staticpro (&Qcenter);
14557 Qcancel_timer = intern ("cancel-timer"); 14641 Qcancel_timer = intern ("cancel-timer");
14558 staticpro (&Qcancel_timer); 14642 staticpro (&Qcancel_timer);
14559 /* This is the end of symbol initialization. */ 14643 Qfullscreen = intern ("fullscreen");
14644 staticpro (&Qfullscreen);
14645 Qfullwidth = intern ("fullwidth");
14646 staticpro (&Qfullwidth);
14647 Qfullheight = intern ("fullheight");
14648 staticpro (&Qfullheight);
14649 Qfullboth = intern ("fullboth");
14650 staticpro (&Qfullboth);
14560 14651
14561 Qhyper = intern ("hyper"); 14652 Qhyper = intern ("hyper");
14562 staticpro (&Qhyper); 14653 staticpro (&Qhyper);
@@ -14572,6 +14663,7 @@ syms_of_w32fns ()
14572 staticpro (&Qcontrol); 14663 staticpro (&Qcontrol);
14573 Qshift = intern ("shift"); 14664 Qshift = intern ("shift");
14574 staticpro (&Qshift); 14665 staticpro (&Qshift);
14666 /* This is the end of symbol initialization. */
14575 14667
14576 /* Text property `display' should be nonsticky by default. */ 14668 /* Text property `display' should be nonsticky by default. */
14577 Vtext_property_default_nonsticky 14669 Vtext_property_default_nonsticky