We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1409

Summary: Hidden Windows receiving Mouse Enter/Leave/Moved Events on OSX.
Product: SDL Reporter: Rodrigo Cardoso <rodrigo.alfenas>
Component: eventsAssignee: Sam Lantinga <slouken>
Status: RESOLVED ABANDONED QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P1 CC: rodrigo.alfenas, sdlbug
Version: HG 2.0Keywords: target-2.0.0
Hardware: x86   
OS: Mac OS X (All)   
Attachments: The code snippet I used to show/hide the window

Description Rodrigo Cardoso 2012-02-01 12:34:43 UTC
Created attachment 812 [details]
The code snippet I used to show/hide the window

I was writing a simple gui app for mac, and I needed to simulate the default mac app behavior that when you close an app, the OS just hides the window but do not terminate the app (unless you explicitly call quit from the menu).

The problem is, when I hid the window using SDL_HideWindow(window); sdl still reports mouse events for that window, including mouse enter/ mouse leave in the area previouly occupied by the window.

I am certain that it should not send any mouse events in this "ghost" window, right?


---
It also receives keyboard events, but I am not sure if it should. The app is still in focus, but with no windows, so maybe you have another interpretation in this case.

Anyway, if you think it should still have keyboard focus, could it receive a SDL_WINDOWEVENT_FOCUS_GAINED when the user clicks the icon? So I would know when to show the window in this specific case.

Thank you
Comment 1 Rodrigo Cardoso 2012-02-06 08:52:21 UTC
I was thinking, It certainly should receve keyboard events when no windows are shown. so, forget about it.

But Mouse enter/Mouse Leave/Mouse moved events should not be fired in invisible windows, right?
Comment 2 Sam Lantinga 2012-02-07 16:03:32 UTC
That's correct. :)
Comment 3 Ryan C. Gordon 2013-07-12 18:52:35 UTC
(Sorry if you get a lot of copies of this email, we're touching dozens of bug reports right now.)

Tagging a bunch of bugs as target-2.0.0, Priority 1.

This means we're in the final stretch for an official SDL 2.0.0 release! These are the bugs we really want to fix before shipping if humanly possible.

That being said, we don't promise to fix them because of this tag, we just want to make sure we don't forget to deal with them before we bless a final 2.0.0 release, and generally be organized about what we're aiming to ship.

Hopefully you'll hear more about this bug soon. If you have more information (including "this got fixed at some point, nevermind"), we would love to have you come add more information to the bug report when you have a moment.

Thanks!
--ryan.
Comment 4 Robotic-Brain 2014-08-18 01:05:53 UTC
Is this still relevant?
If so, it can be fixed by adding 

[nswindow resignKeyWindow];

to Cocoa_HideWindow() in SDL_cocowindow.m

However, I don't think this use case is valid.
Most OSX apps are Document-based, which means they can have an unlimited number of windows. If those windows are closed, they get literally destroyed and not just hidden like the example suggests. "Normal" One-windowed applications quit if their only window was closed.
Comment 5 Ryan C. Gordon 2018-08-06 21:20:17 UTC
Hello, and sorry if you're getting dozens of copies of this message by email.

We are closing out bugs that appear to be abandoned in some form. This can happen for lots of reasons: we couldn't reproduce it, conversation faded out, the bug was noted as fixed in a comment but we forgot to mark it resolved, the report is good but the fix is impractical, we fixed it a long time ago without realizing there was an associated report, etc.

Individually, any of these bugs might have a better resolution (such as WONTFIX or WORKSFORME or INVALID) but we've added a new resolution of ABANDONED to make this easily searchable and make it clear that it's not necessarily unreasonable to revive a given bug report.

So if this bug is still a going concern and you feel it should still be open: please feel free to reopen it! But unless you respond, we'd like to consider these bugs closed, as many of them are several years old and overwhelming our ability to prioritize recent issues.

(please note that hundred of bug reports were sorted through here, so we apologize for any human error. Just reopen the bug in that case!)

Thanks,
--ryan.