aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2000-02-21 16:19:41 +0000
committerGerd Moellmann2000-02-21 16:19:41 +0000
commit17cbbf9537b72f65b61fc6090912bad97f14eb56 (patch)
treeffa759c8a23cc5c7cda43bb37582ecc651a73302 /src
parentcb2255b32540d8d039e7762325577a49f7c3765b (diff)
downloademacs-17cbbf9537b72f65b61fc6090912bad97f14eb56.tar.gz
emacs-17cbbf9537b72f65b61fc6090912bad97f14eb56.zip
(x_window_to_frame, x_any_window_to_frame)
(x_non_menubar_window_to_frame): Check the busy-cursor window.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/xfns.c48
2 files changed, 36 insertions, 19 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4a2c8d946b2..c3049efe987 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12000-02-21 Gerd Moellmann <gerd@gnu.org>
2
3 * frame.c (Fmouse_position): GCPRO retval instead of x and y.
4
5 * xfns.c (x_window_to_frame, x_any_window_to_frame)
6 (x_non_menubar_window_to_frame): Check the busy-cursor window.
7
12000-02-21 Dave Love <fx@gnu.org> 82000-02-21 Dave Love <fx@gnu.org>
2 9
3 * frame.c (Vmouse_position_function): New variable. 10 * frame.c (Vmouse_position_function): New variable.
diff --git a/src/xfns.c b/src/xfns.c
index 7d0459e924e..147a6d1b59c 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -347,6 +347,8 @@ x_window_to_frame (dpyinfo, wdesc)
347 f = XFRAME (frame); 347 f = XFRAME (frame);
348 if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo) 348 if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo)
349 continue; 349 continue;
350 if (f->output_data.x->busy_window == wdesc)
351 return f;
350#ifdef USE_X_TOOLKIT 352#ifdef USE_X_TOOLKIT
351 if ((f->output_data.x->edit_widget 353 if ((f->output_data.x->edit_widget
352 && XtWindow (f->output_data.x->edit_widget) == wdesc) 354 && XtWindow (f->output_data.x->edit_widget) == wdesc)
@@ -374,34 +376,40 @@ x_any_window_to_frame (dpyinfo, wdesc)
374 int wdesc; 376 int wdesc;
375{ 377{
376 Lisp_Object tail, frame; 378 Lisp_Object tail, frame;
377 struct frame *f; 379 struct frame *f, *found;
378 struct x_output *x; 380 struct x_output *x;
379 381
380 for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail)) 382 found = NULL;
383 for (tail = Vframe_list; GC_CONSP (tail) && !found; tail = XCDR (tail))
381 { 384 {
382 frame = XCAR (tail); 385 frame = XCAR (tail);
383 if (!GC_FRAMEP (frame)) 386 if (!GC_FRAMEP (frame))
384 continue; 387 continue;
388
385 f = XFRAME (frame); 389 f = XFRAME (frame);
386 if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo) 390 if (FRAME_X_P (f) && FRAME_X_DISPLAY_INFO (f) == dpyinfo)
387 continue;
388 x = f->output_data.x;
389 /* This frame matches if the window is any of its widgets. */
390 if (x->widget)
391 { 391 {
392 if (wdesc == XtWindow (x->widget) 392 /* This frame matches if the window is any of its widgets. */
393 || wdesc == XtWindow (x->column_widget) 393 x = f->output_data.x;
394 || wdesc == XtWindow (x->edit_widget)) 394 if (x->busy_window == wdesc)
395 return f; 395 found = f;
396 /* Match if the window is this frame's menubar. */ 396 else if (x->widget)
397 if (lw_window_is_in_menubar (wdesc, x->menubar_widget)) 397 {
398 return f; 398 if (wdesc == XtWindow (x->widget)
399 || wdesc == XtWindow (x->column_widget)
400 || wdesc == XtWindow (x->edit_widget))
401 found = f;
402 /* Match if the window is this frame's menubar. */
403 else if (lw_window_is_in_menubar (wdesc, x->menubar_widget))
404 found = f;
405 }
406 else if (FRAME_X_WINDOW (f) == wdesc)
407 /* A tooltip frame. */
408 found = f;
399 } 409 }
400 else if (FRAME_X_WINDOW (f) == wdesc)
401 /* A tooltip frame. */
402 return f;
403 } 410 }
404 return 0; 411
412 return found;
405} 413}
406 414
407/* Likewise, but exclude the menu bar widget. */ 415/* Likewise, but exclude the menu bar widget. */
@@ -425,7 +433,9 @@ x_non_menubar_window_to_frame (dpyinfo, wdesc)
425 continue; 433 continue;
426 x = f->output_data.x; 434 x = f->output_data.x;
427 /* This frame matches if the window is any of its widgets. */ 435 /* This frame matches if the window is any of its widgets. */
428 if (x->widget) 436 if (x->busy_window == wdesc)
437 return f;
438 else if (x->widget)
429 { 439 {
430 if (wdesc == XtWindow (x->widget) 440 if (wdesc == XtWindow (x->widget)
431 || wdesc == XtWindow (x->column_widget) 441 || wdesc == XtWindow (x->column_widget)