Commit 17cbbf95 authored by Gerd Moellmann's avatar Gerd Moellmann

(x_window_to_frame, x_any_window_to_frame)

(x_non_menubar_window_to_frame): Check the busy-cursor window.
parent cb2255b3
No preview for this file type
...@@ -347,6 +347,8 @@ x_window_to_frame (dpyinfo, wdesc) ...@@ -347,6 +347,8 @@ x_window_to_frame (dpyinfo, wdesc)
f = XFRAME (frame); f = XFRAME (frame);
if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo) if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo)
continue; continue;
if (f->output_data.x->busy_window == wdesc)
return f;
#ifdef USE_X_TOOLKIT #ifdef USE_X_TOOLKIT
if ((f->output_data.x->edit_widget if ((f->output_data.x->edit_widget
&& XtWindow (f->output_data.x->edit_widget) == wdesc) && XtWindow (f->output_data.x->edit_widget) == wdesc)
...@@ -374,34 +376,40 @@ x_any_window_to_frame (dpyinfo, wdesc) ...@@ -374,34 +376,40 @@ x_any_window_to_frame (dpyinfo, wdesc)
int wdesc; int wdesc;
{ {
Lisp_Object tail, frame; Lisp_Object tail, frame;
struct frame *f; struct frame *f, *found;
struct x_output *x; struct x_output *x;
for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail)) found = NULL;
for (tail = Vframe_list; GC_CONSP (tail) && !found; tail = XCDR (tail))
{ {
frame = XCAR (tail); frame = XCAR (tail);
if (!GC_FRAMEP (frame)) if (!GC_FRAMEP (frame))
continue; continue;
f = XFRAME (frame); f = XFRAME (frame);
if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo) if (FRAME_X_P (f) && FRAME_X_DISPLAY_INFO (f) == dpyinfo)
continue;
x = f->output_data.x;
/* This frame matches if the window is any of its widgets. */
if (x->widget)
{ {
if (wdesc == XtWindow (x->widget) /* This frame matches if the window is any of its widgets. */
|| wdesc == XtWindow (x->column_widget) x = f->output_data.x;
|| wdesc == XtWindow (x->edit_widget)) if (x->busy_window == wdesc)
return f; found = f;
/* Match if the window is this frame's menubar. */ else if (x->widget)
if (lw_window_is_in_menubar (wdesc, x->menubar_widget)) {
return f; if (wdesc == XtWindow (x->widget)
|| wdesc == XtWindow (x->column_widget)
|| wdesc == XtWindow (x->edit_widget))
found = f;
/* Match if the window is this frame's menubar. */
else if (lw_window_is_in_menubar (wdesc, x->menubar_widget))
found = f;
}
else if (FRAME_X_WINDOW (f) == wdesc)
/* A tooltip frame. */
found = f;
} }
else if (FRAME_X_WINDOW (f) == wdesc)
/* A tooltip frame. */
return f;
} }
return 0;
return found;
} }
/* Likewise, but exclude the menu bar widget. */ /* Likewise, but exclude the menu bar widget. */
...@@ -425,7 +433,9 @@ x_non_menubar_window_to_frame (dpyinfo, wdesc) ...@@ -425,7 +433,9 @@ x_non_menubar_window_to_frame (dpyinfo, wdesc)
continue; continue;
x = f->output_data.x; x = f->output_data.x;
/* This frame matches if the window is any of its widgets. */ /* This frame matches if the window is any of its widgets. */
if (x->widget) if (x->busy_window == wdesc)
return f;
else if (x->widget)
{ {
if (wdesc == XtWindow (x->widget) if (wdesc == XtWindow (x->widget)
|| wdesc == XtWindow (x->column_widget) || wdesc == XtWindow (x->column_widget)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment