Commit graph

74 commits

Author SHA1 Message Date
mitchmindtree cbadc4bc31 Fix issue where window would not focus on startup.
Fix issue where key window would lose all mouse events once mouse left
that window.

Make sure that only window under mouse receives mouse scroll wheel
events.
2017-02-05 18:12:32 +11:00
mitchmindtree 3482c53c89 Rename old glutin ivar to winit 2017-02-05 13:28:56 +11:00
mitchmindtree 3ce7904e01 Wrap the temporarily stored user callback in a type to enforce
invariants

This also removes the need for "box"ing the callback in favour of
storing a raw `*mut` pointer. We can do this by ensuring that we never
store the pointer for longer than the lifetime of the user callback,
which is the duration of a call to `poll_events` or `run_forever`.

Also removes old commented out event code from the window module.
2017-02-05 12:51:09 +11:00
mitchmindtree c03311fa2d Add a method to simplify emitting an event from the macos poll_events and run_forever methods 2017-02-04 13:30:34 +11:00
mitchmindtree fd0ddee63c Panic if the user attempts to run an event loop on a non-main thread on macOS 2017-02-04 02:55:42 +11:00
mitchmindtree ea19409960 Make sure EventsLoop::interrupt awakens the waiting event loop 2017-02-04 02:54:40 +11:00
mitchmindtree 35dcf8dab9 Only return Awakened on NsApplicationActivated, rather than on every unknown event. 2017-02-04 00:51:38 +11:00
mitchmindtree be09639b69 Update the macOS backend to the new futures-compatible API.
This is a follow up to the new API introduced in #20.

This also fixes the issue where window resize events would not be
emitted until the end of the resize. This PR fixese #39 by ensuring that
the user callback given to either `EventsLoop::poll_events` or
`EventsLoop::run_forever` can be called by each window delegate's resize
callback directly.
2017-02-03 23:05:57 +11:00
Pierre Krieger 885b927d23 Merge remote-tracking branch 'origin/master' into impl-20 2017-02-03 09:14:24 +01:00
tomaka ae53bb0f14 Merge pull request #102 from cjhowe/master
iOS Support
2017-02-03 09:09:02 +01:00
Pierre Krieger 422b332c1b Add a transition macro system 2017-01-28 15:00:17 +01:00
Owen Jacobson 6f82ccfba9
De-duplicate resize events.
This tracks resizes separately, and synthesizes them for the event iterators as needed, so that OS X apps don't generate a whole set of resize events after each resize.
2017-01-24 13:46:46 -05:00
Owen Jacobson 7d6b4c3fe5
Naive implementation of resize events for OS X.
These events are batched, and delievered en masse at the end of the resize. This isn't a great developer experience (and it should probably be called out in the docs), but it makes it possible for winit client applications to detect and respond to resizes without special-casing Mac OS targets.

See #39. This is only a partial fix, and does not provide on-the-fly resize events.
2017-01-24 00:13:45 -05:00
mitchmindtree 9b15440b62 Fix non_upper_case_globals warnings on macos 2017-01-22 17:54:45 +11:00
tomaka 41ac24b107 Merge pull request #113 from samdphillips/mac-middle-mouse-button
Add middle mouse button events for MacOS.
2017-01-19 20:45:51 +01:00
Jeff Muizelaar 3b1fdc0f55 macos: Map our user generated event to Event::Awakened
This fixes propagation of Event::Awakend from wakeup_event_loop() when
using poll_event() on macOS.

Currently wait_event() translates all unknown events into
Event::Awakened so doesn't need the explicit translation.
2017-01-19 14:17:55 -05:00
Sam Phillips 55e52d6071 Add middle mouse events for MacOS. 2017-01-17 19:47:36 -08:00
Christian Howe 5146bce88e Fix iOS build and add to Travis CI 2016-12-13 07:29:17 -06:00
Corey Farwell cb0811faf3 Implement window transparency on macOS.
Fixes https://github.com/tomaka/winit/issues/57.
2016-11-30 14:36:51 -05:00
Corey Farwell 57d1e162ee Update min/max window constraints to support MacOS 10.10. 2016-11-23 10:50:12 -05:00
Corey Farwell e3fce3d5ec Implement min/max window dimension constraints for MacOS.
Fixes https://github.com/tomaka/winit/issues/80.
2016-11-23 09:31:41 -05:00
Andy Barron db45e58390 Add MouseEntered/MouseLeft for Windows, X11, Wayland, & Cocoa 2016-11-03 01:31:16 -07:00
Pierre Krieger 188ecae101 Move some implementations around 2016-10-31 17:13:11 +01:00
Pierre Krieger 3ad7f9a584 Create reorganization 2015-04-24 09:51:23 +02:00