aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1995-04-03 23:37:17 +0000
committerKarl Heuer1995-04-03 23:37:17 +0000
commit19126e1177b52706720fb6ec53c7d02edd7f7f10 (patch)
tree02f706753aaa56051f2aa01f399a258ccaf6a12a /src
parent2d271e2eac416bad259487e3c29cd0760692cfc7 (diff)
downloademacs-19126e1177b52706720fb6ec53c7d02edd7f7f10.tar.gz
emacs-19126e1177b52706720fb6ec53c7d02edd7f7f10.zip
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
and x_top_window_to_frame.
Diffstat (limited to 'src')
-rw-r--r--src/xselect.c2
-rw-r--r--src/xterm.c67
2 files changed, 39 insertions, 30 deletions
diff --git a/src/xselect.c b/src/xselect.c
index 50c752bae0b..0400574d1b9 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -560,7 +560,7 @@ x_reply_selection_request (event, format, data, size, type)
560 frame); 560 frame);
561 } 561 }
562 562
563 if (x_window_to_frame (window)) /* #### debug */ 563 if (x_window_to_frame (dpyinfo, window)) /* #### debug */
564 error ("attempt to transfer an INCR to ourself!"); 564 error ("attempt to transfer an INCR to ourself!");
565#if 0 565#if 0
566 fprintf (stderr, "\nINCR %d\n", bytes_remaining); 566 fprintf (stderr, "\nINCR %d\n", bytes_remaining);
diff --git a/src/xterm.c b/src/xterm.c
index 0c4a6253997..a9cf2d4e98b 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -2306,7 +2306,7 @@ XTmouse_position (fp, insist, bar_window, part, x, y, time)
2306 never use them in that case.) */ 2306 never use them in that case.) */
2307 2307
2308 /* Is win one of our frames? */ 2308 /* Is win one of our frames? */
2309 f1 = x_any_window_to_frame (win); 2309 f1 = x_any_window_to_frame (FRAME_X_DISPLAY_INFO (*fp), win);
2310 } 2310 }
2311 2311
2312 /* If not, is it one of our scroll bars? */ 2312 /* If not, is it one of our scroll bars? */
@@ -3022,7 +3022,7 @@ x_scroll_bar_clear (f)
3022} 3022}
3023 3023
3024/* This processes Expose events from the menubar specific X event 3024/* This processes Expose events from the menubar specific X event
3025 loop in menubar.c. This allows to redisplay the frame if necessary 3025 loop in xmenu.c. This allows to redisplay the frame if necessary
3026 when handling menubar or popup items. */ 3026 when handling menubar or popup items. */
3027 3027
3028void 3028void
@@ -3030,10 +3030,12 @@ process_expose_from_menu (event)
3030 XEvent event; 3030 XEvent event;
3031{ 3031{
3032 FRAME_PTR f; 3032 FRAME_PTR f;
3033 struct x_display_info *dpyinfo;
3033 3034
3034 BLOCK_INPUT; 3035 BLOCK_INPUT;
3035 3036
3036 f = x_window_to_frame (event.xexpose.window); 3037 dpyinfo = x_display_info_for_display (event.xexpose.display);
3038 f = x_window_to_frame (dpyinfo, event.xexpose.window);
3037 if (f) 3039 if (f)
3038 { 3040 {
3039 if (f->async_visible == 0) 3041 if (f->async_visible == 0)
@@ -3044,7 +3046,7 @@ process_expose_from_menu (event)
3044 } 3046 }
3045 else 3047 else
3046 { 3048 {
3047 dumprectangle (x_window_to_frame (event.xexpose.window), 3049 dumprectangle (x_window_to_frame (dpyinfo, event.xexpose.window),
3048 event.xexpose.x, event.xexpose.y, 3050 event.xexpose.x, event.xexpose.y,
3049 event.xexpose.width, event.xexpose.height); 3051 event.xexpose.width, event.xexpose.height);
3050 } 3052 }
@@ -3252,7 +3254,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3252 if (event.xclient.data.l[0] 3254 if (event.xclient.data.l[0]
3253 == dpyinfo->Xatom_wm_take_focus) 3255 == dpyinfo->Xatom_wm_take_focus)
3254 { 3256 {
3255 f = x_window_to_frame (event.xclient.window); 3257 f = x_window_to_frame (dpyinfo, event.xclient.window);
3256 /* Since we set WM_TAKE_FOCUS, we must call 3258 /* Since we set WM_TAKE_FOCUS, we must call
3257 XSetInputFocus explicitly. But not if f is null, 3259 XSetInputFocus explicitly. But not if f is null,
3258 since that might be an event for a deleted frame. */ 3260 since that might be an event for a deleted frame. */
@@ -3273,7 +3275,8 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3273 a keyboard or mouse event arrives. */ 3275 a keyboard or mouse event arrives. */
3274 if (numchars > 0) 3276 if (numchars > 0)
3275 { 3277 {
3276 f = x_top_window_to_frame (event.xclient.window); 3278 f = x_top_window_to_frame (dpyinfo,
3279 event.xclient.window);
3277 3280
3278 /* This is just so we only give real data once 3281 /* This is just so we only give real data once
3279 for a single Emacs process. */ 3282 for a single Emacs process. */
@@ -3290,7 +3293,9 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3290 else if (event.xclient.data.l[0] 3293 else if (event.xclient.data.l[0]
3291 == dpyinfo->Xatom_wm_delete_window) 3294 == dpyinfo->Xatom_wm_delete_window)
3292 { 3295 {
3293 struct frame *f = x_any_window_to_frame (event.xclient.window); 3296 struct frame *f
3297 = x_any_window_to_frame (dpyinfo,
3298 event.xclient.window);
3294 3299
3295 if (f) 3300 if (f)
3296 { 3301 {
@@ -3314,7 +3319,8 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3314 == dpyinfo->Xatom_wm_window_moved) 3319 == dpyinfo->Xatom_wm_window_moved)
3315 { 3320 {
3316 int new_x, new_y; 3321 int new_x, new_y;
3317 struct frame *f = x_window_to_frame (event.xclient.window); 3322 struct frame *f
3323 = x_window_to_frame (dpyinfo, event.xclient.window);
3318 3324
3319 new_x = event.xclient.data.s[0]; 3325 new_x = event.xclient.data.s[0];
3320 new_y = event.xclient.data.s[1]; 3326 new_y = event.xclient.data.s[1];
@@ -3329,8 +3335,10 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3329 else if (event.xclient.message_type 3335 else if (event.xclient.message_type
3330 == dpyinfo->Xatom_editres) 3336 == dpyinfo->Xatom_editres)
3331 { 3337 {
3332 struct frame *f = x_any_window_to_frame (event.xclient.window); 3338 struct frame *f
3333 _XEditResCheckMessages (f->display.x->widget, NULL, &event, NULL); 3339 = x_any_window_to_frame (dpyinfo, event.xclient.window);
3340 _XEditResCheckMessages (f->display.x->widget, NULL,
3341 &event, NULL);
3334 } 3342 }
3335#endif /* USE_X_TOOLKIT and HAVE_X11R5 */ 3343#endif /* USE_X_TOOLKIT and HAVE_X11R5 */
3336 } 3344 }
@@ -3338,7 +3346,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3338 3346
3339 case SelectionNotify: 3347 case SelectionNotify:
3340#ifdef USE_X_TOOLKIT 3348#ifdef USE_X_TOOLKIT
3341 if (! x_window_to_frame (event.xselection.requestor)) 3349 if (! x_window_to_frame (dpyinfo, event.xselection.requestor))
3342 goto OTHER; 3350 goto OTHER;
3343#endif /* not USE_X_TOOLKIT */ 3351#endif /* not USE_X_TOOLKIT */
3344 x_handle_selection_notify (&event); 3352 x_handle_selection_notify (&event);
@@ -3346,7 +3354,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3346 3354
3347 case SelectionClear: /* Someone has grabbed ownership. */ 3355 case SelectionClear: /* Someone has grabbed ownership. */
3348#ifdef USE_X_TOOLKIT 3356#ifdef USE_X_TOOLKIT
3349 if (! x_window_to_frame (event.xselectionclear.window)) 3357 if (! x_window_to_frame (dpyinfo, event.xselectionclear.window))
3350 goto OTHER; 3358 goto OTHER;
3351#endif /* USE_X_TOOLKIT */ 3359#endif /* USE_X_TOOLKIT */
3352 { 3360 {
@@ -3368,11 +3376,11 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3368 3376
3369 case SelectionRequest: /* Someone wants our selection. */ 3377 case SelectionRequest: /* Someone wants our selection. */
3370#ifdef USE_X_TOOLKIT 3378#ifdef USE_X_TOOLKIT
3371 if (!x_window_to_frame (event.xselectionrequest.owner)) 3379 if (!x_window_to_frame (dpyinfo, event.xselectionrequest.owner))
3372 goto OTHER; 3380 goto OTHER;
3373#endif /* USE_X_TOOLKIT */ 3381#endif /* USE_X_TOOLKIT */
3374 if (x_queue_selection_requests) 3382 if (x_queue_selection_requests)
3375 x_queue_event (x_window_to_frame (event.xselectionrequest.owner), 3383 x_queue_event (x_window_to_frame (dpyinfo, event.xselectionrequest.owner),
3376 &event); 3384 &event);
3377 else 3385 else
3378 { 3386 {
@@ -3397,14 +3405,14 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3397 3405
3398 case PropertyNotify: 3406 case PropertyNotify:
3399#ifdef USE_X_TOOLKIT 3407#ifdef USE_X_TOOLKIT
3400 if (!x_any_window_to_frame (event.xproperty.window)) 3408 if (!x_any_window_to_frame (dpyinfo, event.xproperty.window))
3401 goto OTHER; 3409 goto OTHER;
3402#endif /* not USE_X_TOOLKIT */ 3410#endif /* not USE_X_TOOLKIT */
3403 x_handle_property_notify (&event); 3411 x_handle_property_notify (&event);
3404 break; 3412 break;
3405 3413
3406 case ReparentNotify: 3414 case ReparentNotify:
3407 f = x_top_window_to_frame (event.xreparent.window); 3415 f = x_top_window_to_frame (dpyinfo, event.xreparent.window);
3408 if (f) 3416 if (f)
3409 { 3417 {
3410 int x, y; 3418 int x, y;
@@ -3416,7 +3424,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3416 break; 3424 break;
3417 3425
3418 case Expose: 3426 case Expose:
3419 f = x_window_to_frame (event.xexpose.window); 3427 f = x_window_to_frame (dpyinfo, event.xexpose.window);
3420 if (f) 3428 if (f)
3421 { 3429 {
3422 if (f->async_visible == 0) 3430 if (f->async_visible == 0)
@@ -3426,7 +3434,8 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3426 SET_FRAME_GARBAGED (f); 3434 SET_FRAME_GARBAGED (f);
3427 } 3435 }
3428 else 3436 else
3429 dumprectangle (x_window_to_frame (event.xexpose.window), 3437 dumprectangle (x_window_to_frame (dpyinfo,
3438 event.xexpose.window),
3430 event.xexpose.x, event.xexpose.y, 3439 event.xexpose.x, event.xexpose.y,
3431 event.xexpose.width, event.xexpose.height); 3440 event.xexpose.width, event.xexpose.height);
3432 } 3441 }
@@ -3447,7 +3456,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3447 case GraphicsExpose: /* This occurs when an XCopyArea's 3456 case GraphicsExpose: /* This occurs when an XCopyArea's
3448 source area was obscured or not 3457 source area was obscured or not
3449 available.*/ 3458 available.*/
3450 f = x_window_to_frame (event.xgraphicsexpose.drawable); 3459 f = x_window_to_frame (dpyinfo, event.xgraphicsexpose.drawable);
3451 if (f) 3460 if (f)
3452 { 3461 {
3453 dumprectangle (f, 3462 dumprectangle (f,
@@ -3467,7 +3476,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3467 break; 3476 break;
3468 3477
3469 case UnmapNotify: 3478 case UnmapNotify:
3470 f = x_any_window_to_frame (event.xunmap.window); 3479 f = x_any_window_to_frame (dpyinfo, event.xunmap.window);
3471 if (f) /* F may no longer exist if 3480 if (f) /* F may no longer exist if
3472 the frame was deleted. */ 3481 the frame was deleted. */
3473 { 3482 {
@@ -3496,7 +3505,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3496 case MapNotify: 3505 case MapNotify:
3497 /* We use x_top_window_to_frame because map events can come 3506 /* We use x_top_window_to_frame because map events can come
3498 for subwindows and they don't mean that the frame is visible. */ 3507 for subwindows and they don't mean that the frame is visible. */
3499 f = x_top_window_to_frame (event.xmap.window); 3508 f = x_top_window_to_frame (dpyinfo, event.xmap.window);
3500 if (f) 3509 if (f)
3501 { 3510 {
3502 f->async_visible = 1; 3511 f->async_visible = 1;
@@ -3522,7 +3531,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3522 break; 3531 break;
3523 3532
3524 case KeyPress: 3533 case KeyPress:
3525 f = x_any_window_to_frame (event.xkey.window); 3534 f = x_any_window_to_frame (dpyinfo, event.xkey.window);
3526 3535
3527 if (f != 0) 3536 if (f != 0)
3528 { 3537 {
@@ -3666,7 +3675,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3666 then a mere LeaveNotify is enough to free you. */ 3675 then a mere LeaveNotify is enough to free you. */
3667 3676
3668 case EnterNotify: 3677 case EnterNotify:
3669 f = x_any_window_to_frame (event.xcrossing.window); 3678 f = x_any_window_to_frame (dpyinfo, event.xcrossing.window);
3670 3679
3671 if (event.xcrossing.focus) /* Entered Window */ 3680 if (event.xcrossing.focus) /* Entered Window */
3672 { 3681 {
@@ -3691,7 +3700,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3691 break; 3700 break;
3692 3701
3693 case FocusIn: 3702 case FocusIn:
3694 f = x_any_window_to_frame (event.xfocus.window); 3703 f = x_any_window_to_frame (dpyinfo, event.xfocus.window);
3695 if (event.xfocus.detail != NotifyPointer) 3704 if (event.xfocus.detail != NotifyPointer)
3696 x_focus_event_frame = f; 3705 x_focus_event_frame = f;
3697 if (f) 3706 if (f)
@@ -3703,7 +3712,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3703 3712
3704 3713
3705 case LeaveNotify: 3714 case LeaveNotify:
3706 f = x_top_window_to_frame (event.xcrossing.window); 3715 f = x_top_window_to_frame (dpyinfo, event.xcrossing.window);
3707 if (f) 3716 if (f)
3708 { 3717 {
3709 if (f == dpyinfo->mouse_face_mouse_frame) 3718 if (f == dpyinfo->mouse_face_mouse_frame)
@@ -3727,7 +3736,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3727 break; 3736 break;
3728 3737
3729 case FocusOut: 3738 case FocusOut:
3730 f = x_any_window_to_frame (event.xfocus.window); 3739 f = x_any_window_to_frame (dpyinfo, event.xfocus.window);
3731 if (event.xfocus.detail != NotifyPointer 3740 if (event.xfocus.detail != NotifyPointer
3732 && f == x_focus_event_frame) 3741 && f == x_focus_event_frame)
3733 x_focus_event_frame = 0; 3742 x_focus_event_frame = 0;
@@ -3744,7 +3753,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3744 && FRAME_LIVE_P (last_mouse_frame)) 3753 && FRAME_LIVE_P (last_mouse_frame))
3745 f = last_mouse_frame; 3754 f = last_mouse_frame;
3746 else 3755 else
3747 f = x_window_to_frame (event.xmotion.window); 3756 f = x_window_to_frame (dpyinfo, event.xmotion.window);
3748 if (f) 3757 if (f)
3749 note_mouse_movement (f, &event.xmotion); 3758 note_mouse_movement (f, &event.xmotion);
3750 else 3759 else
@@ -3771,7 +3780,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3771 break; 3780 break;
3772 3781
3773 case ConfigureNotify: 3782 case ConfigureNotify:
3774 f = x_any_window_to_frame (event.xconfigure.window); 3783 f = x_any_window_to_frame (dpyinfo, event.xconfigure.window);
3775#ifdef USE_X_TOOLKIT 3784#ifdef USE_X_TOOLKIT
3776 if (f 3785 if (f
3777#if 0 3786#if 0
@@ -3901,7 +3910,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3901 && FRAME_LIVE_P (last_mouse_frame)) 3910 && FRAME_LIVE_P (last_mouse_frame))
3902 f = last_mouse_frame; 3911 f = last_mouse_frame;
3903 else 3912 else
3904 f = x_window_to_frame (event.xmotion.window); 3913 f = x_window_to_frame (dpyinfo, event.xmotion.window);
3905 3914
3906 if (f) 3915 if (f)
3907 { 3916 {