Commit graph

97 commits

Author SHA1 Message Date
Manish Goregaokar
1de66e4efb Add support for navigation keys 2016-03-17 16:04:03 +05:30
Patrick Walton
7886ff9acd Add phases to wheel events.
Needed for apps to support overscroll on the Mac.
2016-03-03 16:49:35 -07:00
Kirill Zdornyy
74a28adba2 Fix this_platform_is_not_supported on OpenBSD.
I followed the steps of @mneumann.
2016-03-01 18:06:13 -08:00
tomaka
3246613a51 Merge pull request #709 from gdamjan/support-utf8-window-title
support utf8 window titles via _NET_WM_NAME standard
2016-02-03 10:13:14 +01:00
Michael Howell
0a43f8f733 Allow it to work under Xvfb.
Part of servo/servo#8641
2016-01-19 09:44:33 -07:00
Damjan Georgievski
e9fc0eeb87 call set_title() in new()
…instead of low-level X11 calls that don't work with utf8
2016-01-17 18:52:21 +01:00
Damjan Georgievski
c923b27cad support utf8 window titles via _NET_WM_NAME standard
based on this freerdp patch
9767f7f042

thanks to emiliocobos on irc
2016-01-17 18:52:13 +01:00
Emilio Cobos Álvarez
4d729164c7 x11: Poll the window until it is really visible
Fixes #697

It seems that `XSync` doesn't really makes the window viewable.

This feels hacky, other option to do it could be using `XIfEvent` or
similar to listen to `MapNotify` events, but we'll have a loop still.

In practice, this lasts between two and thre iterations on my machine,
which is something not noticeable.
2016-01-16 18:19:56 +01:00
tomaka
88e64a87a9 Merge pull request #700 from ecoal95/querydevice-leak
x11: Prevent leak on XIQueryDevice
2016-01-07 15:44:43 +01:00
Emilio Cobos Álvarez
21b9245ccc x11: Prevent leak on XIQueryDevice
Per http://linux.die.net/man/3/xiquerydevice:

> XIFreeDeviceInfo frees the information returned by
> XIQueryDevice.
2016-01-06 17:44:26 +01:00
Pierre Krieger
8319043298 Fix wrong screen ID used on GLX 2016-01-05 18:06:30 +01:00
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