comparison src/xfns.c @ 11197:1bdc265aab86

(x_window_to_frame): New arg DPYINFO. All callers changed. (x_any_window_to_frame, x_top_window_to_frame): Likewise.
author Karl Heuer <kwzh@gnu.org>
date Mon, 03 Apr 1995 23:34:26 +0000
parents 0a7048d331e6
children dd1c883953a2
comparison
equal deleted inserted replaced
11196:a74358cc05c6 11197:1bdc265aab86
261 It could be the frame's main window or an icon window. */ 261 It could be the frame's main window or an icon window. */
262 262
263 /* This function can be called during GC, so use GC_xxx type test macros. */ 263 /* This function can be called during GC, so use GC_xxx type test macros. */
264 264
265 struct frame * 265 struct frame *
266 x_window_to_frame (wdesc) 266 x_window_to_frame (dpyinfo, wdesc)
267 struct x_display_info *dpyinfo;
267 int wdesc; 268 int wdesc;
268 { 269 {
269 Lisp_Object tail, frame; 270 Lisp_Object tail, frame;
270 struct frame *f; 271 struct frame *f;
271 272
273 { 274 {
274 frame = XCONS (tail)->car; 275 frame = XCONS (tail)->car;
275 if (!GC_FRAMEP (frame)) 276 if (!GC_FRAMEP (frame))
276 continue; 277 continue;
277 f = XFRAME (frame); 278 f = XFRAME (frame);
279 if (FRAME_X_DISPLAY_INFO (f) != dpyinfo)
280 continue;
278 #ifdef USE_X_TOOLKIT 281 #ifdef USE_X_TOOLKIT
279 if (f->display.nothing == 1) 282 if (f->display.nothing == 1)
280 return 0; 283 return 0;
281 if ((f->display.x->edit_widget 284 if ((f->display.x->edit_widget
282 && XtWindow (f->display.x->edit_widget) == wdesc) 285 && XtWindow (f->display.x->edit_widget) == wdesc)
294 #ifdef USE_X_TOOLKIT 297 #ifdef USE_X_TOOLKIT
295 /* Like x_window_to_frame but also compares the window with the widget's 298 /* Like x_window_to_frame but also compares the window with the widget's
296 windows. */ 299 windows. */
297 300
298 struct frame * 301 struct frame *
299 x_any_window_to_frame (wdesc) 302 x_any_window_to_frame (dpyinfo, wdesc)
303 struct x_display_info *dpyinfo;
300 int wdesc; 304 int wdesc;
301 { 305 {
302 Lisp_Object tail, frame; 306 Lisp_Object tail, frame;
303 struct frame *f; 307 struct frame *f;
304 struct x_display *x; 308 struct x_display *x;
307 { 311 {
308 frame = XCONS (tail)->car; 312 frame = XCONS (tail)->car;
309 if (!GC_FRAMEP (frame)) 313 if (!GC_FRAMEP (frame))
310 continue; 314 continue;
311 f = XFRAME (frame); 315 f = XFRAME (frame);
316 if (FRAME_X_DISPLAY_INFO (f) != dpyinfo)
317 continue;
312 if (f->display.nothing == 1) 318 if (f->display.nothing == 1)
313 return 0; 319 return 0;
314 x = f->display.x; 320 x = f->display.x;
315 /* This frame matches if the window is any of its widgets. */ 321 /* This frame matches if the window is any of its widgets. */
316 if (wdesc == XtWindow (x->widget) 322 if (wdesc == XtWindow (x->widget)
326 332
327 /* Return the frame whose principal (outermost) window is WDESC. 333 /* Return the frame whose principal (outermost) window is WDESC.
328 If WDESC is some other (smaller) window, we return 0. */ 334 If WDESC is some other (smaller) window, we return 0. */
329 335
330 struct frame * 336 struct frame *
331 x_top_window_to_frame (wdesc) 337 x_top_window_to_frame (dpyinfo, wdesc)
338 struct x_display_info *dpyinfo;
332 int wdesc; 339 int wdesc;
333 { 340 {
334 Lisp_Object tail, frame; 341 Lisp_Object tail, frame;
335 struct frame *f; 342 struct frame *f;
336 struct x_display *x; 343 struct x_display *x;
339 { 346 {
340 frame = XCONS (tail)->car; 347 frame = XCONS (tail)->car;
341 if (!GC_FRAMEP (frame)) 348 if (!GC_FRAMEP (frame))
342 continue; 349 continue;
343 f = XFRAME (frame); 350 f = XFRAME (frame);
351 if (FRAME_X_DISPLAY_INFO (f) != dpyinfo)
352 continue;
344 if (f->display.nothing == 1) 353 if (f->display.nothing == 1)
345 return 0; 354 return 0;
346 x = f->display.x; 355 x = f->display.x;
347 /* This frame matches if the window is its topmost widget. */ 356 /* This frame matches if the window is its topmost widget. */
348 if (wdesc == XtWindow (x->widget)) 357 if (wdesc == XtWindow (x->widget))