aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2017-04-26 15:20:09 +0200
committerMartin Rudalics2017-04-26 15:20:09 +0200
commit7a4851e11b3bbc0fbfc7ea021b69374ab23eb882 (patch)
tree0e7e840a859c02e5bd6d50af7277d03ead6af4a3
parentb780f16953355e931a70f7b0fd666fa7f9dad795 (diff)
downloademacs-7a4851e11b3bbc0fbfc7ea021b69374ab23eb882.tar.gz
emacs-7a4851e11b3bbc0fbfc7ea021b69374ab23eb882.zip
Try to fix latest fix of w32_mouse_position
* src/w32term.c (w32_mouse_position): Fix a bug introduced by latest fix and try to make the affected code more rigorous.
-rw-r--r--src/w32term.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/w32term.c b/src/w32term.c
index f02201c9d76..6b0da0cb3e9 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -3464,25 +3464,25 @@ w32_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window,
3464 f1 = dpyinfo->last_mouse_frame; 3464 f1 = dpyinfo->last_mouse_frame;
3465 else 3465 else
3466 { 3466 {
3467 /* Try to check for a child window first. */ 3467 HWND wfp = WindowFromPoint (pt);
3468 HWND wfp = ChildWindowFromPoint (wfp, pt);
3469 3468
3470 if (wfp) 3469 if (wfp)
3471 { 3470 {
3472 struct frame *f2 = x_any_window_to_frame (dpyinfo, wfp); 3471 f1 = x_any_window_to_frame (dpyinfo, wfp);
3472 if (f1)
3473 {
3474 HWND cwfp = ChildWindowFromPoint (wfp, pt);
3473 3475
3474 /* If f2 is one of our frames, make sure it's a child 3476 if (cwfp)
3475 frame (Bug#26615, maybe). */ 3477 {
3476 if (f2 && FRAME_PARENT_FRAME (f2)) 3478 struct frame *f2 = x_any_window_to_frame (dpyinfo, cwfp);
3477 f1 = f2;
3478 }
3479 3479
3480 if (!f1) 3480 /* If a child window was found, make sure that its
3481 { 3481 frame is a child frame (Bug#26615, maybe). */
3482 /* Check for a top-level window second. */ 3482 if (f2 && FRAME_PARENT_FRAME (f2))
3483 wfp = WindowFromPoint (pt); 3483 f1 = f2;
3484 if (wfp) 3484 }
3485 f1 = x_any_window_to_frame (dpyinfo, wfp); 3485 }
3486 } 3486 }
3487 } 3487 }
3488 3488