emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 7a4851e: Try to fix latest fix of w32_mouse_positio


From: Martin Rudalics
Subject: [Emacs-diffs] master 7a4851e: Try to fix latest fix of w32_mouse_position
Date: Wed, 26 Apr 2017 09:21:12 -0400 (EDT)

branch: master
commit 7a4851e11b3bbc0fbfc7ea021b69374ab23eb882
Author: Martin Rudalics <address@hidden>
Commit: Martin Rudalics <address@hidden>

    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.
---
 src/w32term.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/w32term.c b/src/w32term.c
index f02201c..6b0da0c 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,
          f1 = dpyinfo->last_mouse_frame;
        else
          {
-           /* Try to check for a child window first.  */
-           HWND wfp = ChildWindowFromPoint (wfp, pt);
+           HWND wfp = WindowFromPoint (pt);
 
            if (wfp)
              {
-               struct frame *f2 = x_any_window_to_frame (dpyinfo, wfp);
+               f1 = x_any_window_to_frame (dpyinfo, wfp);
+               if (f1)
+                 {
+                   HWND cwfp = ChildWindowFromPoint (wfp, pt);
 
-               /* If f2 is one of our frames, make sure it's a child
-                  frame (Bug#26615, maybe).  */
-               if (f2 && FRAME_PARENT_FRAME (f2))
-                 f1 = f2;
-             }
+                   if (cwfp)
+                     {
+                       struct frame *f2 = x_any_window_to_frame (dpyinfo, 
cwfp);
 
-           if (!f1)
-             {
-               /* Check for a top-level window second.  */
-               wfp = WindowFromPoint (pt);
-               if (wfp)
-                 f1 = x_any_window_to_frame (dpyinfo, wfp);
+                       /* If a child window was found, make sure that its
+                          frame is a child frame (Bug#26615, maybe).  */
+                       if (f2 && FRAME_PARENT_FRAME (f2))
+                         f1 = f2;
+                     }
+                 }
              }
          }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]