Commit graph

92 commits

Author SHA1 Message Date
Danny Fritz 58a00bffbb Windows: implement with_resizable (#540) (#541)
* Windows: implement with_resizable (#540)

* Fixed typo
2018-06-02 10:51:24 -04:00
Francesca Frangipane cebd15bfd1
X11: Improve hint support (#529)
Fixes #257
2018-05-20 10:47:22 -04:00
Francesca Frangipane f51f7c0ca8
Add option to make window "always on top" (#528)
* macOS: always_on_top

* Windows: always_on_top

* X11: always_on_top

* Stub set_always_on_top on other platforms
2018-05-20 10:24:05 -04:00
Francesca Frangipane dec728cfa2
macOS: Implement NSTextInputClient (#518)
Fixes #263
2018-05-17 21:28:30 -04:00
Francesca Frangipane d86f53a02c
X11: Fix get_current_monitor (#515)
* X11: Fix get_current_monitor

Fixes #64

* impl Debug for MonitorId on all platforms
2018-05-14 08:14:57 -04:00
Francesca Frangipane 102dd07456
Window icons (#497) 2018-05-07 17:36:21 -04:00
Osspial 8fd49a4dbe Add methods to get the position of a window's client area, relative to the desktop (#430)
* Add get_inner_position for windows, prototypes for other platforms

* Fix linux builds

* Implement get_inner_position for osx

* Add get_inner_pos implementations for other platforms

* Fixed get_inner_position on macOS

* Corrected set_position on macOS

* Added CHANGELOG entry
2018-04-16 21:40:30 -04:00
Evan Weiler 2477d8ce46 [ci skip] Doc fix for struct winit::Window (#452) 2018-04-13 14:51:10 -04:00
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
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
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
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 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
Pedro Côrte-Real 60b575a7c1 Get rid of FullScreenState::get_monitor() 2017-08-29 02:53:13 +01: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 1382adbf11 Unify fullscreen and fullscreen_windowed APIs
Use the enum to make a single fullscreen API that's much more
consistent. Both set_fullscreen() and with_fullscreen() take the
same enum and support all the variations so you can build the window
however you want and switch between the modes at runtime.
2017-08-29 01:36:24 +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
Pedro Côrte-Real a4052b8693 Add window maximization API
Implement a simple API to set a window to maximized. Implement it
only for the X11 backend.
2017-08-28 01:28:42 +01:00
Lloyd Cunningham 24f5b0b591 Derive Clone for MonitorId 2017-08-05 18:15:50 -05:00
Alex Butler 3a89843767 Add WINIT_UNIX_BACKEND documentation 2017-06-21 20:10:23 +01: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
vanderlokken 5645941a14 Fixed obsolete comments 2017-05-11 03:10:07 +03:00
mitchmindtree be09639b69 Update the macOS backend to the new futures-compatible API.
This is a follow up to the new API introduced in #20.

This also fixes the issue where window resize events would not be
emitted until the end of the resize. This PR fixese #39 by ensuring that
the user callback given to either `EventsLoop::poll_events` or
`EventsLoop::run_forever` can be called by each window delegate's resize
callback directly.
2017-02-03 23:05:57 +11:00
Pierre Krieger b988c174fe Add WindowId type 2017-02-03 09:13:11 +01:00
Pierre Krieger 9cd0430ec7 Remove stuff from Window's API 2017-02-03 06:48:58 +01:00
Pierre Krieger bcb242983b Add documentation for the new API 2017-01-28 15:33:54 +01:00
Pierre Krieger e7d43174e7 Implement the transition API 2017-01-28 15:05:36 +01:00
Pierre Krieger 422b332c1b Add a transition macro system 2017-01-28 15:00:17 +01:00
tomaka f1d70d351e Merge pull request #82 from tomaka/documentation
Some documentation improvements
2017-01-28 13:31:36 +01:00
k-brac 3e2154a922 child window created using a winapi::HWND instead of a WindowProxy 2016-11-29 13:02:42 +01:00
k-brac 2b25bf1480 child window creation improvement 2016-11-28 13:50:07 +01:00
k-brac 5a09e8ba21 first try to allow child window on windows 2016-11-25 17:05:39 +01:00
mitchmindtree 53065bda40 Move resize_callback field from WindowBuilder into WindowAttributes struct 2016-11-12 02:55:21 +11:00
mitchmindtree eb18b3d8b6 Add a WindowBuilder::with_window_resize_callback method.
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.
2016-11-11 22:08:46 +11:00
Pierre Krieger 2c58e85584 Some documentation improvements 2016-11-06 09:51:20 +01:00
Andrey Lesnikov 7f6ae8910e Merge https://github.com/tomaka/glutin
Conflicts:
	.travis.yml
	Cargo.toml
	examples/fullscreen.rs
	src/api/android/mod.rs
	src/api/cocoa/headless.rs
	src/api/cocoa/helpers.rs
	src/api/cocoa/mod.rs
	src/api/glx/mod.rs
	src/api/osmesa/mod.rs
	src/api/win32/callback.rs
	src/headless.rs
	src/lib.rs
	src/platform/linux/mod.rs
	src/window.rs
2016-09-19 19:53:28 +03:00
mitchmindtree 561349669a Addresses several warnings emitted on OS X by removing unused imports and allowing non_upper_case_globals in cocoa event conversion function. 2016-06-22 12:40:48 +10:00
Ivan Ukhov 54f442ea06 Generalize WindowBuilder::with_title 2016-05-08 09:28:42 +02:00
Corey Farwell dc49156fe6 Allow OSX WindowBuilder to specify 'activation behavior'. 2016-04-29 10:43:30 -04:00
Pierre Krieger 10bb03c5f0 Remove most OpenGL stuff and make it compile on win32 2016-02-23 12:56:23 +01:00
Pierre Krieger ec76d991ad Unlocks platform-specific attributes 2016-02-10 17:39:35 +01:00
Pierre Krieger 0b6418fabb Change PixelFormatRequirements 2015-12-19 11:32:51 +01:00
Aceeri 78eb4a5990 Minimum/maximum dimensions for windows in win32 api 2015-11-09 01:42:54 -08:00
Pierre Krieger 37262fb228 Remove public exports of gl_common and libc 2015-11-09 08:46:52 +01:00
Pierre Krieger 8c6a27d426 Add an os module containing platform-specific traits 2015-10-03 09:53:37 +02:00
Pierre Krieger 86fa1b58e5 Rename MonitorID -> MonitorId 2015-09-24 09:11:59 +02:00
Pierre Krieger aa9cb99929 Add #[inline] attributes 2015-09-23 13:11:47 +02:00