Commit graph

26 commits

Author SHA1 Message Date
Osspial bbcd3019e8 Add ability to change the min/max size of windows at runtime (#405)
* Add min/max size setting for win32 and wayland backends

* Implement dynamic min/max size on macos

* Add min/max size setting for x11

* Add empty functions for remaining platforms

* Improved min/max size setting for x11

* Added CHANGELOG entry for new min/max methods

* Added documentation for new min/max methods

* On win32, bound window size to min/max dimensions on window creation

* On win32, force re-check of window size when changing min/max dimensions

* Fix freeze when setting min and max size
2018-03-23 10:35:35 +01:00
Paul Rouget e6fefd5e93 Send Awakened event on Android when event loop is woken up (#417) 2018-03-06 18:06:56 +01:00
Imanol Fernandez c62296dc2b Add set_suspend_callback method for Android (#406)
Makes it possible for glutin to register a callback when a suspend event happens on Android
2018-02-15 14:09:14 +01:00
Paul Rouget ff17eff00f Implement MonitorId::get_dimensions for Android (#400) 2018-02-08 14:55:17 +01:00
Francesca Sunshine 463f316cb8 Add set_decorations method to Window (#365)
This has been stubbed on all platforms other than X11. The X11 implementation has also been
revised to toggle correctly, as it was previously only able to remove decorations.
2017-12-22 13:50:46 +01:00
Ken Reed 01d1178d7b Made poll events loop over as many events as there may be instead of just one. (#333) 2017-10-29 07:02:57 +01:00
Chris Tolliday 159364bec3 Impl Clone for EventsLoopProxy (#331) 2017-10-25 20:03:57 +02:00
kryptan 4e4db1749d Make MonitorId::get_position() return (i32, i32) instead of (u32, u32) because it can be negative on Windows (#324) 2017-10-19 19:08:05 +02:00
kryptan 48902297b7 Implement public API for high-DPI (#319)
* Implement public API for high-DPI #105

* Recover get_inner_size_points and get_inner_size_pixels and change their implementation assuming get_inner_size() returns size in pixels

* Update changelog for high-DPI changes
2017-10-17 13:56:38 +02:00
tomaka 52a7b07c79 Move the Suspended event outside of WindowEvent (#284)
* Move Suspended event outside of WindowEvent

* Adjust the iOS code
2017-09-15 16:24:09 +02:00
Pedro Côrte-Real 59c33d2c6a Move fullscreen modes to not touch physical resolutions (#270)
* 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.
2017-09-07 10:33:46 +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 fe1deb83ae Update Android code with EventsLoop (#272)
* Update Android code with EventsLoop

* Fix run_forever
2017-09-04 12:41:02 +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
Pedro Côrte-Real 9693f7caa9 Convert new fullscreen API in all platforms 2017-08-29 02:16:16 +01:00
Pedro Côrte-Real b35c4a5ee5 maximized/fullscreen as noops for other platforms 2017-08-28 02:23:55 +01:00
Pedro Côrte-Real 1d97a2a506 Implement Windowed Fullscreen
There are two kinds of fullscreen. One where you take over the whole
output the other where you just set the window size to the screen
size and get rid of decorations. The first one already existed,
implement the second which is more common for normal desktop apps.
Use an enum to consolidate all the fullscreen states.
2017-08-28 02:23:55 +01:00
Imanol Fernandez 5ebeb8ab5f Fix Android compilation error 2017-07-06 23:33:42 +02:00
Imanol Fernandez f961bdd668 Implement android events and wake event loop. 2017-03-06 14:39:42 +01:00
Pierre Krieger 422b332c1b Add a transition macro system 2017-01-28 15:00:17 +01:00
Pierre Krieger 188ecae101 Move some implementations around 2016-10-31 17:13:11 +01:00
Pierre Krieger 1f6c4d65a6 Implement headless contexts on android 2015-07-27 10:18:45 +02:00
Pierre Krieger f6c26ec593 Handle errors from MakeCurrent and SwapBuffers 2015-06-16 10:44:44 +02:00
Pierre Krieger ace4808fac Remove the "headless" feature 2015-05-04 07:48:42 +02:00
Pierre Krieger 0eaa8fd9eb Use the EGL API with Android 2015-05-01 09:44:35 +02:00
Pierre Krieger 3ad7f9a584 Create reorganization 2015-04-24 09:51:23 +02:00