Commit graph

86 commits

Author SHA1 Message Date
Pierre Krieger
82f5cd8272 Add better X error handling 2015-12-30 14:58:07 +01:00
Pierre Krieger
033d92aae5 Only call XSetInputFocus if the window is visible 2015-12-24 11:58:50 +01:00
Pierre Krieger
360d2bf452 Call XSync before XSetInputFocus 2015-12-24 11:55:39 +01:00
Emilio Cobos Álvarez
a69ded9c8a x11: Improve xlib error reporting 2015-12-15 13:56:35 +01:00
tomaka
48a02a0c8c Merge pull request #659 from Aceeri/minmaxwindow
Minimum/maximum dimensions for windows in win32 API
2015-12-05 18:01:55 +01:00
Olaf Buddenhagen
32ed86a976 Fix compilation for 32 bit targets
Regression introduced in 47df0e9eaa

Casting fullscreen_atom (which is the result from XInternAtom, i.e.
c_ulong) as i64 is obviously wrong -- the whole point of types such as
c_ulong is that long in C does *not* always have the same bit size...

Cast it as c_long instead.

While this is the most straightforward fix, I'm not sure it's the best
one: perhaps the x11 crate should offer a set_ulong() method along with
set_long(), which could be used here instead of the cast?
2015-11-30 09:13:08 +01:00
tomaka
6a3ee2af75 Merge pull request #646 from adambadawy/master
Fix fullscreen on X11
2015-11-11 20:38:12 +01:00
Aceeri
2be3c142f0 Fixed wrong variable binding for WindowAttributes on asserts 2015-11-09 03:29:26 -08:00
Aceeri
9a05577df8 Not implemented asserts to prevent silent fails 2015-11-09 03:18:48 -08:00
Pierre Krieger
37262fb228 Remove public exports of gl_common and libc 2015-11-09 08:46:52 +01:00
Daggerbot
7e4f795a53 Change some uses of c_void to avoid libc version conflicts. 2015-11-04 08:21:42 -08:00
Adam Badawy
c068a770f0 Update x11-dl 2015-10-27 03:22:13 -04:00
Adam Badawy
10f5528c14 Fix using garbage memory 2015-10-27 03:10:57 -04:00
Adam Badawy
d1a5730374 Remove deprecated comment 2015-10-27 03:09:52 -04:00
Adam Badawy
f9929fab2f Use mode when switching to fullscreen 2015-10-27 03:07:37 -04:00
Adam Badawy
4f8095816e Allow any mode larger than requested dimensions
We were previously allowing only fullscreen modes which were exactly as
tall as the requested dimensions, perhaps erroneously.
2015-10-27 00:33:48 -04:00
Adam Badawy
23a5104098 Comment fullscreen XClientMessage code 2015-10-26 05:33:01 -04:00
Adam Badawy
47df0e9eaa Fix misbehaving fullscreen window 2015-10-26 04:06:40 -04:00
Adam Badawy
ed8dfa9a52 Fix issue #509
Focusing the newly created window seems to grab the keyboard.
2015-10-25 21:56:49 -04:00
Adam Badawy
918dc67992 Fix issue #582
I switched `vsyncstart` and `vdisplay` again, as per the discussion on
issue #582.
2015-10-25 21:52:20 -04:00
Matt Brubeck
8c0dfe19c2 Change X11 events based on multitouch option
* If `multitouch` is enabled, touch input generates touch events.
* If `multitouch` is disabled, touch input generates emulated mouse events.
2015-10-23 08:01:03 -07:00
Pierre Krieger
7a625ef3d8 Remove the window feature entirely 2015-10-03 10:33:37 +02: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
Pierre Krieger
5182023fd6 Switch X11 and wayland to the new design 2015-09-21 12:04:33 +02:00
Pierre Krieger
b5d0a3eb67 Convert GLX to the new design 2015-09-21 12:03:59 +02:00
Pierre Krieger
3054e2ee02 Switch EGL to use only pf_reqs and opengl 2015-09-21 12:03:57 +02:00
Pierre Krieger
48fe9b2644 Extract WindowAttributes from the BuilderAttribs 2015-09-21 12:03:55 +02:00
Pierre Krieger
c244f8c033 Extract GlAttributes from BuilderAttribs 2015-09-21 12:03:55 +02:00
Pierre Krieger
82bb047fda Report the error from x11-rs when failing to open shared libraries 2015-09-20 08:48:53 +02:00
Pierre Krieger
b9a4f5fbe9 Err when a X connection cannot be created instead of panicking 2015-09-20 08:42:32 +02:00
tomaka
08cb668037 Merge pull request #580 from mbrubeck/scroll-lines
Fix smooth-scrolling increment on some X11 devices
2015-09-01 07:29:59 +02:00
Michael Neumann
b707959c2c Make it work on DragonFly/FreeBSD
Tested on DragonFly BSD. Should work similarily on FreeBSD.
2015-08-30 13:52:09 +02:00
Mariusz Ceier
5392ba0db0 Correct event type
KeymapNotify should not be handled by calling XRefreshKeyboardMapping.

XRefreshKeyboardMapping expects XMappingEvent.
2015-08-28 11:23:44 +02:00
Matt Brubeck
576720fd97 Read scroll axis info from all devices
When multiple scrolling devices are attached, XIAllMasterDevices does not
include the scroll axes for all hardware devices.
2015-08-27 06:52:32 -07:00
Matt Brubeck
c310f7bb80 Take XIScrollClassInfo::increment into account
From the "Smooth Scrolling" section of [XI2Proto.txt][1]:

> One unit of scrolling in either direction is considered to be equivalent to
> one button event, e.g. for a unit size of 1.0, -2.0 on an valuator type
> Vertical sends two button press/release events for button 4. Likewise, a
> button press event for button 7 generates an event on the Horizontal
> valuator with a value of +1.0. The server may accumulate deltas of less than
> one unit of scrolling.

From [What's new in XI 2.1 - smooth scrolling][2]:

> The increment defines what delta the driver considers to be one scroll
> event. For an increment of +5, each delta of 5 should be regarded as one
> scroll unit down. For an increment of -3, each delta of 3 should be regarded
> as one scroll unit up (i.e. inverted).

[1]: http://www.x.org/releases/X11R7.7/doc/inputproto/XI2proto.txt
[2]: http://who-t.blogspot.com/2011/09/whats-new-in-xi-21-smooth-scrolling.html

This fixes scrolling with my Microsoft mouse in X11 on Debian 8.1.
2015-08-24 15:44:02 -07:00
Matt Brubeck
93ce9c24f5 Handle touch events on X11 2015-08-18 15:17:25 -07:00
Colin Sherratt
72fc0dc3a3 Enable grave key on X11 2015-08-17 23:28:34 -04:00
Zetok Zalbavar
6c73209746
Prefer GLX over EGL
fixes #314 for me.

I've "tested" change by running examples (which prior to change simply
crashed), but since I did not run those examples successfuly ever before,
I don't know whether they worked as intended.
2015-08-14 15:08:44 +01:00
Glenn Watson
86408438fc Fix a rare crash in some X11 implementations (details below). 2015-08-11 04:16:01 +02:00
Pierre Krieger
587dedaa9e Correctly handle eglGetDisplay 2015-08-07 16:22:31 +02:00
tomaka
be0440666b Merge pull request #553 from tomaka/egl-default
Use EGL by default with X11
2015-08-02 14:00:50 +02:00
Pierre Krieger
be9c8c0186 Try libEGL.so.1 before libEGL.so 2015-07-28 20:48:12 +02:00
Pierre Krieger
743cc317d7 Use EGL by default with X11 2015-07-28 19:54:17 +02:00
Daggerbot
6d6290df6e Implement Window.set_inner_size on X11. 2015-07-23 22:50:25 +00:00
Akos Kiss
07c8154cb7 Add aarch64-unknown-linux-gnu support
* Adding dependencies
* Replacing `i8` with `c_char` ot `_` (since `c_char` can be
  unsigned on some platforms, aarch64 is one of them)
2015-07-23 06:19:54 +00:00
Robert Knight
602a737440 Only listen for mouse events from master devices
XInput2 has a concept of master and slave devices,
where a slave device is the actual physical device,
attached to a master device representing the cursor or keyboard
focus.

See http://who-t.blogspot.co.uk/2009/05/xi2-recipes-part-1.html

Mouse events were being received from both the master and slave
devices, but we are only interested in events from the master device.

Fixes #533
2015-07-22 06:44:51 +01:00
Pierre Krieger
baf9b92d3f Correct window creation on X11 2015-07-19 13:53:40 +02:00
tomaka
896640f2e0 Merge pull request #523 from tomaka/egl-split
Split creating an EGL context in two parts
2015-07-19 09:42:56 +02:00