Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upStn/unfork glutin #19120
Stn/unfork glutin #19120
Conversation
highfive
commented
Nov 5, 2017
|
Heads up! This PR modifies the following files:
|
highfive
commented
Nov 5, 2017
| }, | ||
| } => { | ||
| // TODO: position is necessary according to @paulrouget, but pos is not given in | ||
| // the event's struct. |
This comment has been minimized.
This comment has been minimized.
paulrouget
Nov 6, 2017
Contributor
Yes. The PR that brings these coordinates to the wheel and click events didn't make it to upstream iirc.
| } | ||
| } | ||
|
|
||
| fn create_event_loop_waker(&self) -> Box<EventLoopWaker> { | ||
| struct GlutinEventLoopWaker { | ||
| window_proxy: Option<glutin::WindowProxy>, | ||
| events_loop: Option<Arc<Mutex<glutin::EventsLoop>>>, |
This comment has been minimized.
This comment has been minimized.
paulrouget
Nov 6, 2017
Contributor
I don't think you need to use EventsLoop. Things will be probably easier with:
proxy: Arc<glutin::EventsLoopProxy>,
| if let Some(ref window_proxy) = self.window_proxy { | ||
| window_proxy.wakeup_event_loop() | ||
| if let Some(ref events_loop) = self.events_loop { | ||
| events_loop.lock().unwrap().create_proxy().wakeup(); |
This comment has been minimized.
This comment has been minimized.
paulrouget
Nov 6, 2017
Contributor
This will be easier if you use EventsLoopProxy. No need to create a proxy everytime.
|
An important change in upstream glutin is the way keys are handled. If you look at servo glutin, there are 2 code paths, one for Mac+Linux, and one for Windows. Now, with upstream glutin, only the Windows code path is needed. For example, get rid of the |
|
For |
|
About coordinates, please look at: |
|
|
53f3af4
to
c10d77c
|
|
c10d77c
to
9ce14f4
|
|
||
| #[cfg(target_os = "windows")] | ||
| fn handle_keyboard_input(&self, element_state: ElementState, _scan_code: u8, virtual_key_code: VirtualKeyCode) { | ||
| fn set_key(&self, element_state: ElementState, virtual_key_code: VirtualKeyCode) { |
This comment has been minimized.
This comment has been minimized.
stuartnelson3
Nov 11, 2017
Author
Contributor
I had no idea what to name this; any suggestion is welcome.
|
@paulrouget i looked at the two links you provided for getting mouse position, but I feel a bit stuck -- I'm not seeing a way in the glutin library to get anything other than the bounds of the window (inner or outer), and I couldn't see anything in the servo::gl library that would help, either. any ideas? |
|
The glutin library does not provide the mouse coordinates on click and wheel events. So we need to fix the glutin library to do so. Now, glutin is split in 2: glutin for the opengl stuff, and winit for the windowing and events. So what you actually need to fix is winit. The 2 links show how we did it for the servoglutin. So someone need to adapt these 2 PRs to the winit library. |
|
|
49b420b
to
7442d4e
|
|
7442d4e
to
9b052a6
|
|
b369eda
to
d82ad5a
@jdm successfully got glutin bumped. The last steps are the above two, I believe. I'm not sure what how folks feel about completing the above two |
|
Hm, the build is failing on |
|
@stuartnelson3 This patch needs to be upstreamed I think servo/glutin@0851887. I would do it myself but don't have any osx to test it. Let's ping @nox about it :) |
|
|
dd07964
to
601663b
|
|
|
@stuartnelson3 can you describe what's left to be done here? Do you need an early review? |
|
Also, I'd be happy to take over if you don't have time to continue. |
|
@paulrouget yeah feel free to take over. the patch in this comment needs to be upstreamed: #19120 (comment) Good luck! |
|
@paulrouget I suspect we're still missing fixes for the work items listed in the original comment in #17311. |
|
Taking over this PR. See #19895 @stuartnelson3 thanks a lot for your initial PR. That made my life a lot easier :) |
unfork glutin I'm taking over #19120. Fix #18918. Beside the change in the API, I had to rewrite main loop. At this point, we should have a very similar behavior as servo-glutin. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19895) <!-- Reviewable:end -->
stuartnelson3 commentedNov 5, 2017
•
edited
continuation of work started in #17311
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsBuild is currently working on Linux and mac, need to check other platforms.
Note:
PR is currently blocked by rust-windowing/winit#349
This change is