* Fix X11 screen resolution change using XrandR
The previous XF86 resolution switching was broken and everything
seems to have moved on to xrandr. Use that instead while cleaning
up the code a bit as well.
* Use XRandR for actual multiscreen support in X11
* Use actual monitor names in X11
* Get rid of ptr::read usage in X11
* Use a bog standard Vec instead of VecDeque
* Get rid of the XRandR mode switching stuff
Wayland has made the decision that apps shouldn't change screen
resolutions and just take the screens as they've been setup. In the
modern world where GPU scaling is cheap and LCD panels are scaling
anyway it makes no sense to make "physical" resolution changes when
software should be taking care of it. This massively simplifies the
code and makes it easier to extend to more niche setups like MST and
videowalls.
* Rename fullscreen options to match new semantics
* Implement XRandR 1.5 support
* Get rid of the FullScreen enum
Moving to just having two states None and Some(MonitorId) and then
being able to set full screen in the current monitor with something
like:
window.set_fullscreen(Some(window.current_monitor()));
* Implement Window::get_current_monitor()
Do it by iterating over the available monitors and finding which
has the biggest overlap with the window. For this MonitorId needs
a new get_position() that needs to be implemented for all platforms.
* Add unimplemented get_position() to all MonitorId
* Make get_current_monitor() platform specific
* Add unimplemented get_current_monitor() to all
* Implement proper primary monitor selection in X11
* Shut up some warnings
* Remove libxxf86vm package from travis
Since we're no longer using XF86 there's no need to keep the package
around for CI.
* Don't use new struct syntax
* Fix indentation
* Adjust Android/iOS fullscreen/maximized
On Android and iOS we can assume single screen apps that are already
fullscreen and maximized so there are a few methods that are implemented
by just returning a fixed value or not doing anything.
* Mark OSX/Win fullscreen/maximized unimplemented()!
These would be safe as no-ops but we should make it explicit so
there is more of an incentive to actually implement them.
* 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
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.
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.
This commit only updates the top-level API to get some early feedback.
None of the platform-specific code has been updated yet. I'm hoping to
get around to this over the next couple days however if someone more
familiar with the windows backend would like to do a PR against this
fork that would be a great help.
Closes#187.
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.
Making applications track modifier keys results in unnecessary work for
consumers, it's error prone, and it turns out to have unavoidable bugs.
For example, alt-tabbing with x11 results in the alt modifier state
getting stuck.
To resolve these problems, this patch adds a Mods value to the keyboard
input event.
Based on this patch: d287fa96e3
This allows for passing the window_resize_callback fn during the window
building stage. More importantly, this allows setting the callback
without the need for mutable access to the Window, making it possible
to set the callback in the downstream glium crate.
This may solve tomaka/glium#1232 for most folk.
Depending on the platform and device, scroll deltas may either
be represented as pixel deltas specifying the amount
in pixels to scroll or they may be expressed in 'lines' or 'chunks'
for low resolution devices (eg. a traditional mouse wheel).
Pixel deltas are currently available on OS X. X11 currently
supports only integer line deltas, though pixel deltas
are available via XInput2. Windows supports fractional
line deltas.
Add a new api, window.set_cursor, for setting the cursor. The enum MouseCursor lists the possible cursors.
Only X11 is implemented. On OSX, Android, & Win32 the window.set_cursor function
either does nothing or calls the "unimplemented!" macro.