Commit graph

142 commits

Author SHA1 Message Date
Pierre Krieger aaa1c76841 Fix compilation on x11 2015-03-28 10:30:46 +01:00
Pierre Krieger 3d692870e2 Change grab_cursor and ungrab_cursor to set_cursor_state 2015-03-26 17:15:18 +01:00
Eduard Bopp 18f9bc44c9 Implement grabbing of the mouse pointer for X11
Contains new methods in the Window API that closely mirror the Xlib API. The
methods are left unimplemented for other platforms for now.
2015-03-25 13:10:55 +01:00
Brendan Zabarauskas 8a463f6643 Merge pull request #316 from binsoftware/cocoa-fixes
Cocoa fixes: memory leaks, monitor handling, is_current()
2015-03-24 18:33:53 +11:00
Nicholas Bishop 3413a2d973 Fix compilation by replacing "range" with ".." syntax 2015-03-22 18:54:18 -04:00
Ryan Stewart 1b2fd6e6d0 fix headless build by ensuring NativeMonitorId enum is available internally even without the window feature; add Eq/PartialEq to NativeMonitorId 2015-03-18 14:16:35 -07:00
Ryan Stewart 779f3ce888 fix X11 build issue due to missing import 2015-03-16 15:43:33 -07:00
Ryan Stewart 9914d826b8 expose platform-native monitor identifier 2015-03-16 14:11:49 -07:00
Pierre Krieger c61c33a833 Add set_cursor_position function 2015-03-10 10:29:07 +01:00
Pierre Krieger 689ace8b25 Add is_current function 2015-03-04 07:43:55 +01:00
mitchmindtree 1055eed078 Removed as_slice_with_nul as CString now derefs to a CStr 2015-02-22 01:17:47 +11:00
mitchmindtree 0389c834e4 RingBuf -> VecDeque for other platforms, as_slice_with_nul -> as_bytes_with_nul 2015-02-22 00:40:23 +11:00
Ryan Stewart 25ce029cf6 expose the platform-specific window handle (currently Win only) 2015-02-20 12:33:25 -08:00
Pierre Krieger f4f84c6566 Improve the OpenGL context request system 2015-02-18 17:15:01 +01:00
Pierre Krieger ba7f2a923f Don't call MakeCurrent(null, null) when destroying 2015-02-18 09:00:00 +01:00
tomaka 59220d35ce Fix poll_events returning None when it shouldn't 2015-02-12 18:42:02 +01:00
tomaka 4500702a02 Merge pull request #70 from tomaka/fix-iterators
Use platform-specific iterators instead
2015-02-10 22:34:18 +01:00
tomaka 4c8628ed67 Implement get_outer_size() on x11 2015-02-10 14:40:03 +01:00
Pierre Krieger 4bfcedad3e X11: use platform specific iterators instead 2015-02-10 08:31:31 +01:00
tomaka 6b52bf95a4 Merge pull request #254 from aepsil0n/mousebutton-renaming
Rename enum variants of MouseButton
2015-02-05 18:37:53 +01:00
Manish Goregaokar 256645cc3c Add some more support for X11 keys (partially fixes #251) 2015-02-05 22:28:54 +05:30
Eduard Bopp b2367fe2e6 Rename enum variants of MouseButton
With enums that are namespaced by default, it seems reasonable to be less
redundant in the variant naming here.
2015-02-05 16:52:53 +01:00
Akos Kiss e4469cfce7 Reorder the fields of XErrorEvent to match the struct layout found in recent Xlib.h
Fixes #244
2015-02-01 22:08:34 +00:00
Glenn Watson 1b73aeaa24 On some X11 driver implementations, calling XCloseDisplay from a different thread
causes memory corruption, resulting in a crash. Change window proxy to be a weak
reference so that the XCloseDisplay is always called from the main window.
2015-01-30 07:11:55 +10:00
tomaka f8c66ff2a9 Merge pull request #220 from tomaka/x11-vsync
Implement vsync for x11 and add vsync example
2015-01-25 12:56:15 +01:00
tomaka a2e03e7c15 Merge pull request #221 from tomaka/fix-rc
Fix race condition with XOpenIM
2015-01-25 12:55:58 +01:00
Andrew Kelley 02a57e0422 fix for latest rustc 2015-01-23 19:18:22 -07:00
Pierre Krieger 56c6afd03c Fix race condition with XOpenIM 2015-01-23 11:10:23 +01:00
Pierre Krieger b05ef16d81 Implement vsync for x11 and add vsync example 2015-01-23 09:33:22 +01:00
Glenn Watson de3f354566 Fix log prefix 2015-01-23 06:01:22 +10:00
Glenn Watson 19475f8521 Some GPU/driver combinations have glxCreateContextAttribsARB present, but it fails with an X error. In this case, catch the X error and fall back to the old method of creating a context. 2015-01-22 12:07:31 +10:00
Akos Kiss 935e5a36a2 c_char isn't always i8 2015-01-20 21:49:23 +00:00
Glenn Watson fd5e77f23e Add missing get_api stubs.
Add hidpi_factor() support for retina displays.
Fix Resize and MouseMoved events to handle retina displays.
Fix inverted y position for MouseMoved events on mac.
Fix initial painting on retina display.
2015-01-19 11:54:11 +10:00
Andrey Lesnikov 5a4fee967a x11, android, win32: [ui]size, [u]int -> [ui]32 2015-01-13 16:23:30 +03:00
tomaka 05a03fb6a1 Merge pull request #192 from bjwbell/mouse-cursors
Add mouse cursor support
2015-01-13 10:43:46 +01:00
Bryan Bell 995bd37c78 Change uint/int to usize/isize
From https://github.com/rust-lang/rfcs/pull/544 the types uint/int were
renamed to usize/isize.
2015-01-12 19:33:31 -08:00
Bryan Bell 95f0990074 Refine X11 cursor selections
For MouseCursor::Cell, NotAllowed, NoDrop, Grab, Grabbing, ... set the
appropriate X11 cursor.

Also alphabetize the cursors listed in the MouseCursor enum.
2015-01-12 19:00:45 -08:00
Bryan Bell b532b8c65f Add mouse cursor support
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.
2015-01-12 16:22:37 -08:00
Austin Bonander 8d9133d331 Update to latest Rust nightly 2015-01-08 03:45:46 -08:00
Pierre Krieger 885d5e9c38 Update for Rustc 2015-01-05 14:39:58 +01:00
Pierre Krieger 4c5e430dd3 Update for Rustc 2015-01-03 23:15:39 +01:00
Ty Overby a698146943 Change the way that events are represented.
The bulk of this commit is changing instances of Vec to RingBuf which is
optimized for the push_back() / pop_front() strategy that is used
internaly in the event system.

The glutin custom iterators are now just wrappers around the RingBuf
iterator type.  This will bring the running time of iterator traversal from
O(n^2) to O(n) because shifting-on-delete won't be performed.
2015-01-01 23:44:02 -08:00
Pierre Krieger b9710f05a9 Unify WindowBuilder and HeadlessRendererBuilder for easier implementations 2014-12-31 07:34:26 +01:00
Pierre Krieger b9a6366f96 Update for changes in Send/Sync traits 2014-12-30 08:20:50 +01:00
Pierre Krieger 7f6f4f8d04 Update for gl_generator's changes 2014-12-24 08:12:10 +01:00
Glenn Watson fa5cb66cff Add resize example, fix warnings, make callback an option so it can be removed. 2014-12-19 05:44:47 +10:00
Glenn Watson 0ad9c3d453 Add callback function to allow resize messages to be sent on mac. 2014-12-19 05:44:20 +10:00
tomaka 0164449955 Merge pull request #161 from glennw/thread-proxy
Introduce a WindowProxy for accessing a subset of functionality
2014-12-18 20:36:37 +01:00
Glenn Watson 435c64f473 Fix event name 2014-12-18 10:57:12 +10:00
Pierre Krieger 03d6a41ba3 Update for rustc for x11 2014-12-17 10:25:38 +01:00