Commit graph

40 commits

Author SHA1 Message Date
Osspial
9602716ed2
Event Loop 2.0 API and Windows implementation (#638)
* Rename EventsLoop and associated types to EventLoop

* Rename WindowEvent::Refresh to WindowEvent::Redraw

* Remove second thread from win32 backend

* Update run_forever to hijack thread

* Replace windows Mutex with parking_lot Mutex

* Implement new ControlFlow and associated events

* Add StartCause::Init support, timer example

* Add ability to send custom user events

* Fully invert windows control flow so win32 calls into winit's callback

* Add request_redraw

* Rename platform to platform_impl

* Rename os to platform, add Ext trait postfixes

* Add platform::desktop module with EventLoopExt::run_return

* Re-organize into module structure

* Improve documentation

* Small changes to examples

* Improve docs for run and run_return

* Change instances of "events_loop" to "event_loop"

* Rename MonitorId to MonitorHandle

* Add CHANGELOG entry

* Improve WaitUntil timer precision

* When SendEvent is called during event closure, buffer events

* Fix resize lag when waiting in some situations

* Update send test and errors that broke some examples/APIs

* Improve clarity/fix typos in docs

* Fix unreachable panic after setting ControlFlow to Poll during some RedrawRequested events.

* Fix crash when running in release mode

* Remove crossbeam dependency and make drop events work again

* Remove serde implementations from ControlFlow

* Fix 1.24.1 build

* Fix freeze when setting decorations

* Replace &EventLoop in callback with &EventLoopWindowTarget

* Document and implement Debug for EventLoopWindowTarget

* Fix some deadlocks that could occur when changing window state

* Fix thread executor not executing closure when called from non-loop thread

* Fix buffered events not getting dispatched

* Fix crash with runner refcell not getting dropped

* Address review feedback

* Fix CHANGELOG typo

* Catch panics in user callback
2019-02-05 10:30:33 -05:00
trimental
c91dfdd6fe Wayland: add set_wayland_theme() to control client decoration color… (#775)
* Wayland: add `set_wayland_theme()` to control client decoration color theme

* Change &mut self to &self

* Remove endianness comment
2019-01-29 11:04:15 +01:00
Victor Berger
7fe90e6c80 Introduce WindowBuilderExt::with_app_id for wayland (#700) 2018-11-15 16:59:56 -05:00
Tobias Umbach
bc03ffb317 Add X11-specific with_gtk_theme_variant option (#659) 2018-09-20 17:00:04 -04:00
Iku Iwasa
8c78013257 Support NetBSD platform (#603)
* Support NetBSD platform

* CHANGELOG tweak + target ordering
2018-07-16 10:25:26 -04:00
Francesca Frangipane
1b74822cfc
DPI for everyone (#548) 2018-06-14 19:42:18 -04:00
Francesca Frangipane
cebd15bfd1
X11: Improve hint support (#529)
Fixes #257
2018-05-20 10:47:22 -04:00
Francesca Frangipane
dec728cfa2
macOS: Implement NSTextInputClient (#518)
Fixes #263
2018-05-17 21:28:30 -04:00
Francesca Frangipane
8440091a4e
macOS: Implement with_resize_increments (#519)
Fixes #135
2018-05-16 10:16:36 -04:00
Victor Berger
1e97103094 wayland: migrate to smithay-client-toolkit (#490)
* wayland: migrate to smithay-client-toolkit

* Update smithay-client-toolkit

* Add changelog entry for wayland rework
2018-05-05 13:36:34 -04:00
Francesca Frangipane
cc8907b956
X11: Implement resize increments and base size (#494) 2018-05-03 09:41:11 -04:00
Francesca Sunshine
23e4293179 unix::WindowExt no longer returns pointers for things that aren't actually pointers (#364)
Fixes #256

`get_xlib_window` and `get_xlib_screen_id` previously returned `Option<*mut c_void>` by
casting integer IDs into pointers, which while producing no functionality issues, is
semantically incorrect and rather surprising. Worse still, the docs for `get_xlib_window`
stated that it was in fact a valid pointer.

Additionally, now all `unix::WindowExt` methods return `std::os::raw` types rather than
`libc` types; note that the two versions of `c_void` are not interchangeable in the eyes of
the compiler, so those wanting the `libc` type will need to explicitly cast.

This is a breaking change, and will require some trivial changes to glutin.
2017-12-17 10:17:26 +01:00
Victor Berger
61d25be3e0
wayland: upgrade wayland-window (#339)
* wayland: upgrade wayland-window

This new version of wayland window considerably simplifies the
window handling for winit, meaning much of the previous juggling
is no longer needed, and the windows will appear even if nothing is
drawn.

* wayland: cleanup unused stuff
2017-11-03 17:35:29 +01:00
Victor Berger
229029f2da Formalize thread-safety guarantees (#322) 2017-10-18 20:40:21 +02:00
Victor Berger
515595153d Wayland: rework the event loop & expose readiness signal (#298)
* wayland: don't create a second event_queue

As each EventsLoop has its own context, this is no longer necessary.

* wayland: buffer events rather than direct dispatch

Changes the behavior of the event loop to first internally
buffer the events generated by the wayland handlers, and then
dispatch them to the client's closure.

- It simplifies the event loop logic
- It makes it possible for the user to call window methods such as
  `set_title()` or `set_inner_size()` without causing a deadlock

* wayland: add is_ready() & fix protocol errors

Adds a `is_ready()` method to the windows to advertize
when it is legal to start drawing, and fix a few wayland
protocol mishandling in the process.
2017-09-27 16:31:46 +02:00
tomaka
15fbc0dff4 Publish 0.8.1 with fixes necessary for glutin (#296) 2017-09-23 09:36:30 +02:00
tomaka
342d5d8587 Remove api_transition macro (#279)
* Remove api_transition macro

* Rename Window2 to Window

* Try fix X11 code
2017-09-06 17:32:24 +02:00
tomaka
3d1c18ded9 Events loop backend (#269)
* Don't use UNIX_BACKEND in Window2::new

* Move get_available_monitors and get_primary_monitor to EventsLoop

* Remove UNIX_BACKEND

* Restore choosing the Linux backend

* Return a XNotSupported for new_x11()

* Fix fullscreen example
2017-09-01 11:04:57 +02:00
tomaka
7dc6fcdedc Rework MonitorId::get_native_identifier (#267)
* Rework MonitorId::get_native_identifier

* Try fix compilation

* Returns the monitor ID on wayland as well

* Try fix compilation

* Fix iOS compilation
2017-08-30 08:49:18 +02:00
Determinant
f2ee78bcf5 Merge branch 'master' of https://github.com/tomaka/winit into xim-send-spot 2017-07-12 00:04:12 -04:00
Determinant
aea61a74fb remove the the redundant code, fix a bug 2017-07-12 00:00:51 -04:00
Victor Berger
66a12d5332 linux: stop exposing wayland_client's types 2017-06-23 20:20:49 +02:00
Victor Berger
08254e68fb Readd pub import erroneously removed 2017-03-15 10:11:43 +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
Pierre Krieger
5025db2d59 Unix fix attempt 2017-01-28 16:09:22 +01:00
rerion
941c8d3344 Add TODO & bump version 2017-01-07 15:00:15 +01:00
rerion
f5812018ca Add get_x11_xconnection function 2017-01-07 14:34:38 +01:00
rerion
d4b8fd9f5a Add methods allowing creation of X11 window with specified visual and screen 2017-01-06 22:46:41 +01:00
Andrey Lesnikov
f5daac771e Prepared winit for glutin porting 2016-10-20 11:06:57 +03:00
Victor Berger
44996acf94 wayland: expose internals as side unsable methods 2016-10-10 08:01:58 +02:00
Victor Berger
c991172a28 wayland: remove old code for new backend 2016-10-09 16:08:10 +02:00
Nicolas Koch
32d01b288e Add support for xcb
Due to XCB and Xlib compability, we can take a shortcut and use X11's
underlying xcb_connection. This way, a complete XCB backend implementation can
be avoided.
2016-07-31 00:00:43 +02:00
Victor Berger
c49c6bcd6e
wayland: WindowExt implementations. 2016-05-08 09:28:54 +02:00
Pierre Krieger
d216d6b052 Merge remote-tracking branch 'glutin/master' into merge-glutin
Conflicts:
	Cargo.toml
	build.rs
	src/api/caca/mod.rs
	src/api/cocoa/mod.rs
	src/api/egl/ffi.rs
	src/api/egl/mod.rs
	src/api/glx/mod.rs
	src/api/osmesa/mod.rs
2016-03-26 17:55:03 +01:00
Kirill Zdornyy
74a28adba2 Fix this_platform_is_not_supported on OpenBSD.
I followed the steps of @mneumann.
2016-03-01 18:06:13 -08:00
Pierre Krieger
16f76b2407 Make it compile on Linux 2016-02-27 13:59:11 +01:00
Pierre Krieger
ec76d991ad Unlocks platform-specific attributes 2016-02-10 17:39:35 +01:00
Matt Brubeck
93bec2ffca Fix typo in WindowExt::get_xlib_display 2015-10-22 13:59:52 -07:00
Pierre Krieger
8c6a27d426 Add an os module containing platform-specific traits 2015-10-03 09:53:37 +02:00