summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChong Yidong <cyd@gnu.org>2012-08-07 15:02:04 +0800
committerChong Yidong <cyd@gnu.org>2012-08-07 15:02:04 +0800
commitd10a51dcdfab2d9283bd2e3229330c511d5af193 (patch)
treeac283584008d8eba23830ac40efcee76c25ffc66 /src
parent1ff8a4e98cd0c858a142b35a62b452a36449d259 (diff)
downloademacs-d10a51dcdfab2d9283bd2e3229330c511d5af193.tar.gz
Check for live frames explicitly in window.c functions which need it.
* window.c (Fwindow_edges, Fwindow_pixel_edges) (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal) (Fdelete_window_internal): Signal an error if the window is not on a live frame. Fixes: debbugs:12025
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/window.c10
2 files changed, 15 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2dcfd9ccd64..727e3ca9819 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2012-08-07 Chong Yidong <cyd@gnu.org>
+
+ * window.c (Fwindow_edges, Fwindow_pixel_edges)
+ (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
+ (Fdelete_window_internal): Signal an error if the window is not on
+ a live frame (Bug#12025).
+
2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
Drop FGET and revert read access to Lisp_Objects slots of struct frame.
diff --git a/src/window.c b/src/window.c
index 912eb04f489..866f4d34a76 100644
--- a/src/window.c
+++ b/src/window.c
@@ -151,8 +151,6 @@ decode_any_window (register Lisp_Object window)
CHECK_WINDOW (window);
w = XWINDOW (window);
- /* The following test throws up every time a tooltip frame is displayed. */
- /* CHECK_LIVE_FRAME (w->frame); */
return w;
}
@@ -746,6 +744,7 @@ just the text area, use `window-inside-edges'. */)
(Lisp_Object window)
{
register struct window *w = decode_any_window (window);
+ CHECK_LIVE_FRAME (WGET (w, frame));
return Fcons (make_number (WINDOW_LEFT_EDGE_COL (w)),
Fcons (make_number (WINDOW_TOP_EDGE_LINE (w)),
@@ -767,6 +766,7 @@ of just the text area, use `window-inside-pixel-edges'. */)
(Lisp_Object window)
{
register struct window *w = decode_any_window (window);
+ CHECK_LIVE_FRAME (WGET (w, frame));
return Fcons (make_number (WINDOW_LEFT_EDGE_X (w)),
Fcons (make_number (WINDOW_TOP_EDGE_Y (w)),
@@ -812,6 +812,8 @@ of just the text area, use `window-inside-absolute-pixel-edges'. */)
{
register struct window *w = decode_any_window (window);
int add_x, add_y;
+
+ CHECK_LIVE_FRAME (WGET (w, frame));
calc_absolute_offset (w, &add_x, &add_y);
return Fcons (make_number (WINDOW_LEFT_EDGE_X (w) + add_x),
@@ -2580,6 +2582,7 @@ window-start value is reasonable when this function is called. */)
int top IF_LINT (= 0), new_top, resize_failed;
w = decode_any_window (window);
+ CHECK_LIVE_FRAME (WGET (w, frame));
XSETWINDOW (window, w);
f = XFRAME (WGET (w, frame));
@@ -2593,6 +2596,7 @@ window-start value is reasonable when this function is called. */)
/* ROOT must be an ancestor of WINDOW. */
{
r = decode_any_window (root);
+ CHECK_LIVE_FRAME (WGET (r, frame));
pwindow = WGET (XWINDOW (window), parent);
while (!NILP (pwindow))
if (EQ (pwindow, root))
@@ -3837,6 +3841,8 @@ Signal an error when WINDOW is the only window on its frame. */)
int before_sibling = 0;
w = decode_any_window (window);
+ CHECK_LIVE_FRAME (WGET (w, frame));
+
XSETWINDOW (window, w);
if (NILP (WGET (w, buffer))
&& NILP (WGET (w, hchild)) && NILP (WGET (w, vchild)))