Commit graph

23 commits

Author SHA1 Message Date
tomaka
2e079fe9a2 Merge pull request #211 from Ralith/transparent-ids
Transparent axis/button IDs
2017-07-17 07:37:26 +02:00
Rukai
e1e21ded28 Fix x11 ModifiersState 2017-07-15 09:58:32 -07:00
tomaka
9462a51f32 Merge pull request #203 from Determinant/xim-improvement
XIM: Increase the string lookup buffer size and add IC focus/unfocus.
2017-07-12 19:14:11 +02:00
Rukai
117beed0b5 Fix x11 mouse scroll wheel 2017-07-11 17:15:23 +10:00
Determinant
75856e0e39 dynamically reallocate buffer; release mutex before callback 2017-07-01 12:24:35 -04:00
Benjamin Saunders
3d9e8da9ec Transparent axis/button IDs 2017-07-01 02:22:02 -07:00
Determinant
5e5debc48f increase the buffer size; proper IC focus/unfocus 2017-06-23 14:27:48 -04:00
mitchmindtree
04ccad1dbc Rename ControlFlow variant from Complete to Break 2017-06-20 21:25:53 +10:00
mitchmindtree
df1276d72a Fix x11 EventsLoopProxy::wakeup implementation using a dummy, InputOnly window 2017-06-17 22:59:56 +10:00
mitchmindtree
4b42af910b Make x11 backend take &mut self in poll_events method 2017-06-09 22:55:48 +10:00
mitchmindtree
f2dd2f0752 WIP - Make poll_events and run_forever take &mut self
This removes the need for the EventsLoop::interrupt method by inroducing
a ControlFlow type. This new type is to be returned by the user's
callback and indicates whether the `EventsLoop` should continue waiting
for events or break from the loop.

Only the wayland, x11 and api_transition backends have been updated so
far, and only the wayland backend has actually been tested.
2017-06-02 21:19:45 +10:00
mitchmindtree
38856b1c60 X11 - Move event insertion from interrupt to proxy wakeup. 2017-05-31 18:07:51 +10:00
mitchmindtree
f6587aed39 [WIP] Have EventsLoopProxy::wakeup return a Result. Begin linux impl.
X11 and Wayland implementations are now half implemented, however both
still do not correctly break from the inner blocking event dispatch
functions when `wakeup` is called, which they should do.
2017-05-25 23:19:13 +10:00
Joe Wilm
4ec5078bdb Fix poll_events on x11 not draining completely
If the interrupted flag were set going into poll_events, it would only
ever handle the first event in the queue. Now, the flag is reset at the
start so events are processed until the caller requests otherwise.
2017-05-11 23:00:22 -07:00
Joe Wilm
46057d7122 Remove unnecessary locking
For X11 interrupt, we can just use the root window which doesn't require
taking a lock to find.
2017-05-09 21:30:31 -07:00
Joe Wilm
f3db0ba641 Fix x11 interrupt to actually wake event loop
This is the same behavior as with WindowProxy::wakeup_event_loop in
previous versions.

Unfortunately, `EventsLoop::interrupt` is also the recommend way to exit
a `run_forever` loop from within the event handler callback. Pushing an
extra event on the queue in that case is simply wasteful. Changing this
would require a refactor taking one of two possible forms:

1. Add a method *in addition* to interrupt intended for waking up the
   event loop
2. Add a return type to the event callback like

    enum Continue { True, False }

   which would be used in lieu of the atomic interrupt flag.
2017-05-09 09:51:00 -07:00
Joe Wilm
8288d419fd Remove unnecessary mut 2017-05-09 09:50:16 -07:00
Joe Wilm
c92ac695af Fix x11 poll_events to drain queue
It was only processing a single event per call. The docs say

> Fetches all the events that are pending, calls the callback function
> for each of them, and returns.

which suggests that was incorrect.
2017-05-09 09:20:35 -07:00
Joe Wilm
0b75a6b60c Make keyboard input event order consistent
All platforms should now receive events in the following order:

1. KeyboardInput(ElementState::Pressed, ..)
2. ReceivedCharacter
3. KeyboardInput(ElementState::Released, ..)

cc https://github.com/tomaka/glutin/issues/878
2017-05-07 21:16:48 -07:00
Benjamin Saunders
22bc119cd7 Richer input events
This expands input events to represent sub-pixel mouse positions, devices responsible for generating events, and raw
device-oriented events. The X11 back end is refactored to make full use of the new expressiveness. Other backends have
had new functionality minimally stubbed out, save for the macos backend which already supports sub-pixel mouse
positions.
2017-04-23 01:08:15 -07:00
Victor Berger
9aaa788434 linux: Remove dead code from wayland & fix some trivial warnings. 2017-03-04 11:26:12 +01:00
Victor Berger
624a422f20 linux: move api transition boilerplate to x11/wayland submodules 2017-03-04 09:09:09 +01:00
Victor Berger
4acf437221 Move api module into platform::linux 2017-03-04 09:09:09 +01:00
Renamed from src/api/x11/mod.rs (Browse further)