If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

close window widget on unfocused window focuses window

VERIFIED FIXED

Status

()

Core
Event Handling
VERIFIED FIXED
14 years ago
14 years ago

People

(Reporter: Felix Miata, Assigned: Ganesh)

Tracking

Trunk
x86
OS/2
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

14 years ago
To reproduce:
1-Open some app
2-Open Mozilla
3-Focus the other app
4-Click the close window widget on the Mozilla titlebar

Actual behavior:
1-Mozilla window is focused (OS/2 trunk 2003122508)

Expected behavior:
1-Mozilla window is closed (OS/2 1.5, Win32 1.6b, Linux trunk 2003122208)

Comment 1

14 years ago
Warpzilla trunk 2003121708 (and older) -> WFM (Warpzilla gets closed)
Warpzilla trunk 2003121808 (and newer) -> bug (Warpzilla gets focused)
Win98SE Moz trunk 2003122608 (and 2003121508) -> WFM

Ganesh, take a look.
Assignee: pedemont → grajaman

Comment 3

14 years ago
I just checked in a fix for this.

I had missed part of the IWB patch for the new focus code.

Index: nsFrameWindow.cpp
===================================================================
RCS file: /cvsroot/mozilla/widget/src/os2/nsFrameWindow.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- nsFrameWindow.cpp	17 Dec 2003 21:02:26 -0000	1.42
+++ nsFrameWindow.cpp	7 Jan 2004 22:07:23 -0000	1.43
@@ -442,10 +442,18 @@
          }
          break;
       /* To simulate Windows better, we need to send a focus message to the */
-      /* client when the frame is activated */
+      /* client when the frame is activated if there is a non mozilla window
focused */
       case WM_ACTIVATE:
-         if (SHORT1FROMMP(mp1))
-           WinPostMsg(mWnd, WM_FOCUSCHANGED, 0, MPFROM2SHORT(1,0));
+         if (SHORT1FROMMP(mp1)) {
+            char className[19];
+            ::WinQueryClassName(WinQueryFocus(HWND_DESKTOP), 19, className);
+            if (strcmp(className, WindowClass()) != 0) {
+#ifdef DEBUG_FOCUS
+              printf("Extra WM_FOCUSCHANGED because className was %s on
WM_ACTIVATE\n", className);
+#endif
+              WinSendMsg(mWnd, WM_FOCUSCHANGED, 0, MPFROM2SHORT(1,0));
+            }
+         }
          break;
    }
 
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
(Reporter)

Comment 4

14 years ago
verified in 2004010908 trunk
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.