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 466 - Mouse click event not sent in fullscreen
Summary: Mouse click event not sent in fullscreen
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: HG 2.0
Hardware: PowerPC Mac OS X 10.4 (Intel)
: P2 blocker
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-21 09:25 UTC by kuon
Modified: 2009-12-04 00:24 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kuon 2007-07-21 09:25:50 UTC
When switching to fullscreen, all events are correctly sent, except the mouse click.

I don't get the mousebuttondown nor up events.

In window mode, it is working as expected.
Comment 1 kuon 2007-07-25 07:28:27 UTC
Any idea about why the mouseButtonDown event is not triggered in fullscreen?

This is getting urgent. (as all bugs)
Comment 2 Sam Lantinga 2007-07-25 08:24:14 UTC
No idea.  I'm on vacation right now, but I'll look at it when I get back, if Christian hasn't solved it already. :)
Comment 3 kuon 2007-07-25 09:06:11 UTC
Don't worry, I will dig a hole into the code, to see what I can find. I was just wondering if anybody looked at it.

Enjoy your vacation btw.
Comment 4 Christian Walther 2007-07-31 07:21:02 UTC
I'm just starting to familiarize myself with SDL 1.3...

I suspect that mouse click events are not caught by the window in fullscreen mode because they go to the shielding window put up by CGDisplayCapture() instead. A possible solution to this may be raising the Cocoa window above the shielding window, but the documentation for CGShieldingWindowLevel() says this is not recommended. What I would suggest is to handle the mouse events at the NSApplication level in Cocoa_PumpEvents() while in fullscreen - letting [NSApp sendEvent:] dispatch the event to the appropriate window is not needed in that case anyway.

By the way, "In window mode, it is working as expected" is not quite correct, in my experience - I don't get right click events, only left and middle. I suspect they're swallowed by the NSView for contextual menu handling. If/when we introduce a custom NSView subclass as recently done in 1.2 for the cursor rects (r3291) that can probably be fixed by overriding rightMouseDown: to pass the event up the responder chain there.
Comment 5 Sam Lantinga 2009-12-03 01:01:40 UTC
I think this is fixed in the latest SDL 1.3 snapshot:
http://www.libsdl.org/tmp/SDL-1.3.zip

Can you give it a try and let me know if this is fixed?
Comment 6 kuon 2009-12-03 01:29:11 UTC
Same as #465 I don't have the exact original code, but after a small test case, it's working, so I guess it can be closed too.
Comment 7 Sam Lantinga 2009-12-04 00:24:08 UTC
Thanks! :)