aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorEli Zaretskii2013-09-26 10:37:16 +0300
committerEli Zaretskii2013-09-26 10:37:16 +0300
commitb87c4ff2817e71ca71b028792200b1e069a95e04 (patch)
treebfe00c0655fa02078a9ab2c633ea06d90c4a2064 /src/window.c
parentbbc108377873aa6ed7cf21c731770103096eea39 (diff)
parentba355de014b75ed104da4777f909db70d62f2357 (diff)
downloademacs-b87c4ff2817e71ca71b028792200b1e069a95e04.tar.gz
emacs-b87c4ff2817e71ca71b028792200b1e069a95e04.zip
Merge from trunk.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c47
1 files changed, 20 insertions, 27 deletions
diff --git a/src/window.c b/src/window.c
index 6828f5d0792..670369cd322 100644
--- a/src/window.c
+++ b/src/window.c
@@ -20,8 +20,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20 20
21#include <config.h> 21#include <config.h>
22 22
23#define WINDOW_INLINE EXTERN_INLINE
24
25#include <stdio.h> 23#include <stdio.h>
26 24
27#include "lisp.h" 25#include "lisp.h"
@@ -39,19 +37,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
39#include "blockinput.h" 37#include "blockinput.h"
40#include "intervals.h" 38#include "intervals.h"
41#include "termhooks.h" /* For FRAME_TERMINAL. */ 39#include "termhooks.h" /* For FRAME_TERMINAL. */
42 40#ifdef HAVE_WINDOW_SYSTEM
43#ifdef HAVE_X_WINDOWS 41#include TERM_HEADER
44#include "xterm.h" 42#endif /* HAVE_WINDOW_SYSTEM */
45#endif /* HAVE_X_WINDOWS */
46#ifdef HAVE_NTGUI
47#include "w32term.h"
48#endif
49#ifdef MSDOS 43#ifdef MSDOS
50#include "msdos.h" 44#include "msdos.h"
51#endif 45#endif
52#ifdef HAVE_NS
53#include "nsterm.h"
54#endif
55 46
56Lisp_Object Qwindowp, Qwindow_live_p; 47Lisp_Object Qwindowp, Qwindow_live_p;
57static Lisp_Object Qwindow_valid_p; 48static Lisp_Object Qwindow_valid_p;
@@ -1386,6 +1377,7 @@ window_from_coordinates (struct frame *f, int x, int y,
1386 cw.window = &window, cw.x = x, cw.y = y; cw.part = part; 1377 cw.window = &window, cw.x = x, cw.y = y; cw.part = part;
1387 foreach_window (f, check_window_containing, &cw); 1378 foreach_window (f, check_window_containing, &cw);
1388 1379
1380#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
1389 /* If not found above, see if it's in the tool bar window, if a tool 1381 /* If not found above, see if it's in the tool bar window, if a tool
1390 bar exists. */ 1382 bar exists. */
1391 if (NILP (window) 1383 if (NILP (window)
@@ -1398,6 +1390,7 @@ window_from_coordinates (struct frame *f, int x, int y,
1398 *part = ON_TEXT; 1390 *part = ON_TEXT;
1399 window = f->tool_bar_window; 1391 window = f->tool_bar_window;
1400 } 1392 }
1393#endif
1401 1394
1402 return window; 1395 return window;
1403} 1396}
@@ -2952,7 +2945,7 @@ window-start value is reasonable when this function is called. */)
2952 } 2945 }
2953 } 2946 }
2954 2947
2955 adjust_glyphs (f); 2948 adjust_frame_glyphs (f);
2956 unblock_input (); 2949 unblock_input ();
2957 2950
2958 run_window_configuration_change_hook (f); 2951 run_window_configuration_change_hook (f);
@@ -3426,6 +3419,7 @@ make_window (void)
3426 non-Lisp data, so do it only for slots which should not be zero. */ 3419 non-Lisp data, so do it only for slots which should not be zero. */
3427 w->nrows_scale_factor = w->ncols_scale_factor = 1; 3420 w->nrows_scale_factor = w->ncols_scale_factor = 1;
3428 w->left_fringe_width = w->right_fringe_width = -1; 3421 w->left_fringe_width = w->right_fringe_width = -1;
3422 w->mode_line_height = w->header_line_height = -1;
3429 w->phys_cursor_type = -1; 3423 w->phys_cursor_type = -1;
3430 w->phys_cursor_width = -1; 3424 w->phys_cursor_width = -1;
3431 w->scroll_bar_width = -1; 3425 w->scroll_bar_width = -1;
@@ -3651,7 +3645,7 @@ be applied on the Elisp level. */)
3651 windows_or_buffers_changed++; 3645 windows_or_buffers_changed++;
3652 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 3646 FRAME_WINDOW_SIZES_CHANGED (f) = 1;
3653 3647
3654 adjust_glyphs (f); 3648 adjust_frame_glyphs (f);
3655 unblock_input (); 3649 unblock_input ();
3656 3650
3657 run_window_configuration_change_hook (f); 3651 run_window_configuration_change_hook (f);
@@ -3921,7 +3915,7 @@ set correctly. See the code of `split-window' for how this is done. */)
3921 3915
3922 block_input (); 3916 block_input ();
3923 window_resize_apply (p, horflag); 3917 window_resize_apply (p, horflag);
3924 adjust_glyphs (f); 3918 adjust_frame_glyphs (f);
3925 /* Set buffer of NEW to buffer of reference window. Don't run 3919 /* Set buffer of NEW to buffer of reference window. Don't run
3926 any hooks. */ 3920 any hooks. */
3927 set_window_buffer (new, r->contents, 0, 1); 3921 set_window_buffer (new, r->contents, 0, 1);
@@ -4050,7 +4044,7 @@ Signal an error when WINDOW is the only window on its frame. */)
4050 recombine_windows (sibling); 4044 recombine_windows (sibling);
4051 } 4045 }
4052 4046
4053 adjust_glyphs (f); 4047 adjust_frame_glyphs (f);
4054 4048
4055 if (!WINDOW_LIVE_P (FRAME_SELECTED_WINDOW (f))) 4049 if (!WINDOW_LIVE_P (FRAME_SELECTED_WINDOW (f)))
4056 /* We deleted the frame's selected window. */ 4050 /* We deleted the frame's selected window. */
@@ -4137,7 +4131,7 @@ grow_mini_window (struct window *w, int delta)
4137 w->total_lines -= XINT (value); 4131 w->total_lines -= XINT (value);
4138 /* Enforce full redisplay. FIXME: make it more selective. */ 4132 /* Enforce full redisplay. FIXME: make it more selective. */
4139 windows_or_buffers_changed++; 4133 windows_or_buffers_changed++;
4140 adjust_glyphs (f); 4134 adjust_frame_glyphs (f);
4141 unblock_input (); 4135 unblock_input ();
4142 } 4136 }
4143} 4137}
@@ -4171,7 +4165,7 @@ shrink_mini_window (struct window *w)
4171 w->total_lines = 1; 4165 w->total_lines = 1;
4172 /* Enforce full redisplay. FIXME: make it more selective. */ 4166 /* Enforce full redisplay. FIXME: make it more selective. */
4173 windows_or_buffers_changed++; 4167 windows_or_buffers_changed++;
4174 adjust_glyphs (f); 4168 adjust_frame_glyphs (f);
4175 unblock_input (); 4169 unblock_input ();
4176 } 4170 }
4177 /* If the above failed for whatever strange reason we must make a 4171 /* If the above failed for whatever strange reason we must make a
@@ -4212,7 +4206,7 @@ DEFUN ("resize-mini-window-internal", Fresize_mini_window_internal, Sresize_mini
4212 4206
4213 windows_or_buffers_changed++; 4207 windows_or_buffers_changed++;
4214 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 4208 FRAME_WINDOW_SIZES_CHANGED (f) = 1;
4215 adjust_glyphs (f); 4209 adjust_frame_glyphs (f);
4216 unblock_input (); 4210 unblock_input ();
4217 4211
4218 run_window_configuration_change_hook (f); 4212 run_window_configuration_change_hook (f);
@@ -4483,7 +4477,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
4483 visible. */ 4477 visible. */
4484 w->vscroll = (it.last_visible_y 4478 w->vscroll = (it.last_visible_y
4485 - it.current_y + it.max_ascent + it.max_descent); 4479 - it.current_y + it.max_ascent + it.max_descent);
4486 adjust_glyphs (it.f); 4480 adjust_frame_glyphs (it.f);
4487 } 4481 }
4488 else 4482 else
4489 { 4483 {
@@ -5118,9 +5112,9 @@ and redisplay normally--don't erase and redraw the frame. */)
5118 /* Invalidate pixel data calculated for all compositions. */ 5112 /* Invalidate pixel data calculated for all compositions. */
5119 for (i = 0; i < n_compositions; i++) 5113 for (i = 0; i < n_compositions; i++)
5120 composition_table[i]->font = NULL; 5114 composition_table[i]->font = NULL;
5121 5115#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
5122 WINDOW_XFRAME (w)->minimize_tool_bar_window_p = 1; 5116 WINDOW_XFRAME (w)->minimize_tool_bar_window_p = 1;
5123 5117#endif
5124 Fredraw_frame (WINDOW_FRAME (w)); 5118 Fredraw_frame (WINDOW_FRAME (w));
5125 SET_FRAME_GARBAGED (WINDOW_XFRAME (w)); 5119 SET_FRAME_GARBAGED (WINDOW_XFRAME (w));
5126 } 5120 }
@@ -5407,7 +5401,7 @@ struct saved_window
5407}; 5401};
5408 5402
5409#define SAVED_WINDOW_N(swv,n) \ 5403#define SAVED_WINDOW_N(swv,n) \
5410 ((struct saved_window *) (XVECTOR ((swv)->contents[(n)]))) 5404 ((struct saved_window *) (XVECTOR ((swv)->u.contents[(n)])))
5411 5405
5412DEFUN ("window-configuration-p", Fwindow_configuration_p, Swindow_configuration_p, 1, 1, 0, 5406DEFUN ("window-configuration-p", Fwindow_configuration_p, Swindow_configuration_p, 1, 1, 0,
5413 doc: /* Return t if OBJECT is a window-configuration object. */) 5407 doc: /* Return t if OBJECT is a window-configuration object. */)
@@ -5773,7 +5767,7 @@ the return value is nil. Otherwise the value is t. */)
5773 ++n; 5767 ++n;
5774 } 5768 }
5775 5769
5776 adjust_glyphs (f); 5770 adjust_frame_glyphs (f);
5777 unblock_input (); 5771 unblock_input ();
5778 5772
5779 /* Scan dead buffer windows. */ 5773 /* Scan dead buffer windows. */
@@ -6102,7 +6096,7 @@ apply_window_adjustment (struct window *w)
6102 clear_glyph_matrix (w->current_matrix); 6096 clear_glyph_matrix (w->current_matrix);
6103 w->window_end_valid = 0; 6097 w->window_end_valid = 0;
6104 windows_or_buffers_changed++; 6098 windows_or_buffers_changed++;
6105 adjust_glyphs (XFRAME (WINDOW_FRAME (w))); 6099 adjust_frame_glyphs (XFRAME (WINDOW_FRAME (w)));
6106} 6100}
6107 6101
6108 6102
@@ -6368,7 +6362,7 @@ If PIXELS-P is non-nil, the return value is VSCROLL. */)
6368 /* Adjust glyph matrix of the frame if the virtual display 6362 /* Adjust glyph matrix of the frame if the virtual display
6369 area becomes larger than before. */ 6363 area becomes larger than before. */
6370 if (w->vscroll < 0 && w->vscroll < old_dy) 6364 if (w->vscroll < 0 && w->vscroll < old_dy)
6371 adjust_glyphs (f); 6365 adjust_frame_glyphs (f);
6372 6366
6373 /* Prevent redisplay shortcuts. */ 6367 /* Prevent redisplay shortcuts. */
6374 XBUFFER (w->contents)->prevent_redisplay_optimizations_p = 1; 6368 XBUFFER (w->contents)->prevent_redisplay_optimizations_p = 1;
@@ -6524,7 +6518,6 @@ init_window_once (void)
6524 Vterminal_frame = selected_frame; 6518 Vterminal_frame = selected_frame;
6525 minibuf_window = f->minibuffer_window; 6519 minibuf_window = f->minibuffer_window;
6526 selected_window = f->selected_window; 6520 selected_window = f->selected_window;
6527 last_nonminibuf_frame = f;
6528 6521
6529 window_initialized = 1; 6522 window_initialized = 1;
6530} 6523}