Commit Graph

6865 Commits

Author SHA1 Message Date
Matthias Clasen
7a7e3fc0e3 Ad d new API to the docs 2016-04-21 22:55:57 -04:00
Frediano Ziglio
cf14fea5a8 Save scancode inside GdkEventPrivate
Windows save in hardware_keycode an information which is not so low
level and some application require the hardware scancode.
As Windows provides this information save it in GdkEventPrivate
and provide a function to get this information.
For no Windows system the function return the hardware_keycode instead.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=765259
2016-04-21 22:35:47 -04:00
Rui Matos
deaf664ed2 wayland: Leave existing mods on map_virtual_modifiers
map_virtual_modifiers() is supposed to add the necessary virtual mods
but otherwise leave the mods that are passed in.

https://bugzilla.gnome.org/show_bug.cgi?id=765270
2016-04-19 21:14:20 +02:00
Matthias Clasen
b8a86e6ca4 wayland: Some more debug spew
Print the modifiers and their mapping out as well. This
information is contained in the keymap, but this is a bit
easier to digest.
2016-04-19 12:43:03 -04:00
Matthias Clasen
e7d84898ee wayland: Add debug output for keymaps
Use GDK_DEBUG=input to see your keymap sent over and over again.
Efficiency!
2016-04-19 12:23:51 -04:00
Chun-wei Fan
9a87b6be2b MSVC builds: Update how introspection builds are done
This first adds a common autotools module that can be included by
the Makefile.am's to generate the file lists and the g-ir-scanner/
g-ir-compiler command lines to build the introspection files.

The autotools files for gdk/ and gtk/ are then updated to generate
the full file lists needed to build the introspection files, with
the full command lines for g-ir-scanner and g-ir-compiler as NMake
Makefile modules that can be used to build the introspection files
for Visual Studio builds.

https://bugzilla.gnome.org/show_bug.cgi?id=765195
2016-04-19 14:50:25 +08:00
Christian Hergert
b584b3d12a frame-clock: avoid g_signal_emit_by_name()
These were showing up higher in Sysprof profiles.

The simple fix is to avoid the emit_by_name() and let the interface emit
the signals directly. No function preconditions are provided since these
are internal API.
2016-04-18 15:33:53 -07:00
Matthias Clasen
bbb45a2b2d Add docs for new API 2016-04-18 11:46:58 -04:00
Carlos Garnacho
f7108d4d43 wayland: Improve checks when flushing scroll events
If we get gdk_wayland_seat_flush_frame_event() with no previous event to be
flushed, we fallback into the scroll event checks. However, there's no check
performed there as to whether it really scrolled, so it'd always send a smooth
scroll event with 0/0 deltas in this case.

This should be mostly harmless, but still, we should only end up emitting scroll
events if those really happened.
2016-04-18 14:14:33 +01:00
Carlos Garnacho
bfcd9a2193 wayland: Do not check the pointer focus when receiving wl_pointer.frame
The frame event is also meant to compress wl_pointer.leave events, at this
point the focus surface will be definitely NULL. In the end, wl_pointer.frame
should flush the last composed event despite the pointer focus.

https://bugzilla.gnome.org/show_bug.cgi?id=765065
2016-04-18 14:14:33 +01:00
Carlos Garnacho
358d15ae5e gdk: Make GDK_TOUCH_CANCEL be dealt with similarly to GDK_TOUCH_END
We must emit the cancel event with the same semantics, and towards the GdkWindow
that is currently under the touchpoint, so make proxy_button_event() deal with
GDK_TOUCH_CANCEL.

Fixes the GDK_TOUCH_CANCEL event being emitted only on the toplevel, which is
usually non-sufficient.
2016-04-18 14:14:33 +01:00
Matthias Clasen
117c0c0aea Add gdk_pango_context_get_for_display
This is the obvious 1 line equivalent of the for_screen function.
2016-04-18 07:04:44 -04:00
Matthias Clasen
6664008815 wayland: Make virtual modifier mapping more similar to X
Ignore virtual modifiers that are mapped to Mod1 (as Meta
often is), to avoid interfering with our fix interpretation
of Mod1 as Alt.
2016-04-17 01:50:23 -04:00
Matthias Clasen
5ba8a25d29 wayland: Fix the map_virtual_modifiers implementation
We were not stripping real modifiers out, and thus always
thought there's a conflict when the passed in modifiers
included any real modifiers.
2016-04-16 23:16:12 -04:00
Matthias Clasen
64c2a65cc0 wayland: Implement virtual modifiers
Since Wayland is using libxkbcommon, it inherits X unfortunate
real/virtual modifier distinction, so we have to do the same
gymnastics we do for X to map between the two.

This should fix matching of accelerators using virtual modifiers
(modulo gnome-shell bugs regarding the handling of Super).

https://bugzilla.gnome.org/show_bug.cgi?id=764424
2016-04-15 22:22:48 -04:00
Matthias Clasen
101cecf724 Clarify docs a bit
The wording here was just awkward: TRUE is returned if... Note that
FALSE is also returned if...
2016-04-15 22:22:48 -04:00
Jeremy Tan
8ebb6969cb GDK W32: Fix positioning of reparented window
MoveWindow should not be used over the pre-existing move/resize
functions, which already correctly position a window with respect
to its parent, while also taking into account the size of window
decorations.

https://bugzilla.gnome.org/show_bug.cgi?id=765100
2016-04-15 13:21:11 +00:00
Jeremy Tan
260d521dd7 GDK W32: Fix bounding rect calculation on window creation The bounding rect specifies the top left and bottom right corners - the bottom right corner must account for the current window position.
https://bugzilla.gnome.org/show_bug.cgi?id=764996
2016-04-13 14:15:36 +00:00
Руслан Ижбулатов
c2aa7d0749 GDK W32: Deduplicate reparenting
gdk_window_reparent() already changes children list for old and new parent.
Doing so twice results in a circular reference in the list, which can hang
the application later, for example in gtk_window_show().

https://bugzilla.gnome.org/show_bug.cgi?id=764845
2016-04-12 12:56:11 +00:00
Ignacio Casal Quinteiro
a3bff7d41e win32: rollback change and use _gdk_display
This makes usage of _gdk_display again when creating a window.
This is needed because there is a window created when the display
is being initialized, so it becomes a chicken and egg problem.
For now we roll back this to fix the wintab crash but we might
want to fix this again in the future by improving the wintab
initialization.

https://bugzilla.gnome.org/show_bug.cgi?id=764664
2016-04-11 22:25:41 +02:00
Ignacio Casal Quinteiro
c9add3161f win32: add missing empty lines 2016-04-11 22:25:41 +02:00
Matthias Clasen
6e47dad33d gdkdevice: Expose tool as property
This may occasionally be useful.
2016-04-11 12:08:21 -04:00
Friedrich Beckmann
fe80230985 quartz: zoom/rotate change compile/runtime check from 10.7 to 10.8
The zoom/rotate change for quartz does not build on 10.7. This change
adds zoom/rotate support in quartz only for 10.8 and following. The
problems is described here:
https://bugzilla.gnome.org/show_bug.cgi?id=760276 and here
https://trac.macports.org/ticket/51052
NSEventPhaseMayBegin was only introduced in 10.8 although documentation
says it is introduced in 10.7. Tests on 10.7 indicate that the phase
property for the Magnify event is not supported at all on 10.7
2016-04-09 18:05:59 -04:00
Matthias Clasen
7dc588c4d3 Add a note about GDK_AXIS_X/Y
These axes mmay or may not be present, best to ignore them.
2016-04-09 17:38:03 -04:00
Matthias Clasen
0d64582688 wayland: Keyboard don't have x/y
These axes are not very useful in the first place, but on a
keyboard they just don't make any sense at all.
2016-04-09 17:31:39 -04:00
Matthias Clasen
9044f78751 Move GdkDeviceTool into its own files 2016-04-09 15:48:34 -04:00
Carlos Garnacho
057ae4ace0 wayland: Propagate slider/rotation axes from tools to devices 2016-04-08 17:34:29 +02:00
Carlos Garnacho
d3a3d0673f gdkevents: Fix GDK_AVAILABLE_IN annotation
These functions have just been added. An oversight prior to merging
wayland tablet.
2016-04-08 15:09:36 +02:00
Carlos Garnacho
6628ffd686 wayland: Check the tablet manager before creating a wp_tablet_seat
This makes things non-crashy if the compositor doesn't provide wp_tablet_manager
2016-04-06 17:29:11 +02:00
Carlos Garnacho
cd1604ae1c wayland: Hook tablets to GdkSeat
Those are now also grabbed togetther with other master pointers,
so everything is able to interoperate on eg. popups triggered by
other devices.
2016-04-06 16:12:13 +02:00
Carlos Garnacho
fb32f11e3d wayland: Translate pen buttons into button events
up/down already take GDK_BUTTON_PRIMARY, we translate BTN_STYLUS(2)
into GDK_BUTTON_MIDDLE/SECONDARY.
2016-04-06 16:12:12 +02:00
Stephen Chandler Paul
4f6bc82052 Wayland: Translate wl_tablet.down/up into button events
These are sent with button=GDK_BUTTON_PRIMARY, axes must be also
included in these events, in addition to motion ones.
2016-04-06 16:12:12 +02:00
Stephen Chandler Paul
0f6be24e28 Wayland: Translate tool axes in motion events
On wayland, such axes are per-tool, we must update device capabilities
on the fly as new tools enter proximity, first the slave device so
it matches the current tool, and then the master device so it looks
the same than the current slave device.
2016-04-06 16:12:12 +02:00
Stephen Chandler Paul
72884a274c Wayland: Implement proximity/crossing/motion event emission on tablets
Each tablet will update its own GdkWaylandPointerData separately. This
commit only adds plain motion event emission so far, no axes are managed
yet.
2016-04-06 16:12:12 +02:00
Stephen Chandler Paul
7cc0850a5a Wayland: Add initial support for drawing tablets
Only the management of tablets and tools is added so far. No tablet events
are yet interpreted.

As it's been the tradition in GTK+, erasers are split into their own device,
whereas the rest of the tools are meant to be routed through the
GDK_SOURCE_PEN device. Both pen/eraser devices are slaves to a master
pointer device, separate to wl_pointer's. This is so each tablet can
maintain its own cursor/positioning accounting.

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
2016-04-06 16:12:12 +02:00
Carlos Garnacho
45b4d765c0 wayland: Refactor master pointer data into a separate struct
This will enable multiple "pointers" to have separate data here.
Will come out useful when adding support for tablets, as they
will have a separate cursor for all purposes.
2016-04-06 16:12:12 +02:00
Stephen Chandler Paul
af894af386 gdkcursor-wayland.c: Minor indentation fix
Changed the tabs to spaces

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
2016-04-06 16:12:12 +02:00
Carlos Garnacho
6febc22918 x11: Use XInternAtom directly on poking device hardware IDs
This way we don't cache the property if it wasn't previously there,
added by the driver itself. Bailing out is due there.
2016-04-06 15:43:29 +02:00
Stephen Chandler Paul
9e72d24b23 GdkDeviceTool: Add GdkAxisFlags info to tablet tools
Different tools may have different sets of axes, we should store that
info somewhere.
2016-04-06 15:43:29 +02:00
Stephen Chandler Paul
8b2fd3ed1b GdkDeviceTool: Add GdkDeviceToolType to identify the physical tool type
Because there are multiple different types of styluses that can be used with
tablets, we have to have some sort of identifier for them attached to the
GdkDeviceTool, especially since knowing the actual tool type for a GdkDeviceTool
is necessary for matching up a GdkDeviceTool with it's appropriate
GdkInputSource in Wayland (eg. matching up a GdkDeviceTool eraser with the
GDK_SOURCE_ERASER GdkInputSource of a wayland tablet).

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
2016-04-06 15:43:29 +02:00
Carlos Garnacho
9a81b65959 x11: Set GdkDeviceTool on motion/button events
The last known tool from the device is used here. If no tool is known,
the event will just have a NULL pointer there.
2016-04-06 15:43:29 +02:00
Carlos Garnacho
0287ec7e89 x11: Update GdkDevices on "Wacom Serial IDs" property changes
This takes care of the emission of GdkDevice::tool-changed, plus the
updating of the internal device accounting.
2016-04-06 15:43:29 +02:00
Carlos Garnacho
6286883e8d gdk: Forward tools in client-side windows event translation 2016-04-06 15:43:29 +02:00
Carlos Garnacho
6d73e75153 events: Add gdk_event_[gs]et_device_tool()
This getter/setter will manage the tool pointer in GdkEventPrivate. The
setter should be most notably used by backends.
2016-04-06 15:43:29 +02:00
Carlos Garnacho
5a25c5a9f2 GdkSeatDefault: Add functions to add/remove tools
This may be used by any backend using GdkSeatDefault as its seat
implementation.
2016-04-06 15:43:29 +02:00
Carlos Garnacho
6824dd7b8a gdk: Add GdkSeat::tool-added/removed signals
And a helper function to lookup a tool from the seat. Those are
tracker per-seat, and may be shared across devices.
2016-04-06 15:43:29 +02:00
Carlos Garnacho
d5f141a9b7 gdkdevice: Add GdkDevice::tool-changed signal
On the devices and backends that support it, this signal will be emitted
on slave/floating devices whenever the tool they are interacting with
changes. These notifications may also work as a sort of proximity events,
as the tool will be unset when the pen moves too far.

For backends, gdk_device_update_tool() has been included, all that should
be done on their side is just calling this whenever any tool might have
changed.
2016-04-06 15:43:29 +02:00
Carlos Garnacho
4ba95b09ba gdkdevice: Add GdkDeviceTool to identify device tools
GdkDeviceTool is an opaque object that can be used to identify a given
tool (eg. pens on tablets) during the app/device lifetime. Tools are only
set on non-master devices, and are owned by these.

The accounting functions are made private, the only public call on
GdkDeviceTool so far is gdk_device_tool_get_serial(), useful to identify
the tool across runs.
2016-04-06 15:43:29 +02:00
Carlos Garnacho
0f962f1075 device: Add gdk_device_get_axes(), and ::axes property
This returns a GdkAxisFlags, holding the axes currently available
through this device.
2016-04-06 15:43:29 +02:00
Carlos Garnacho
32d7ba76b3 device: Add distance/rotation/slider GdkAxisUse values
These are possible to handle in tablets, so add a value for these in the
axis enum.
2016-04-06 15:43:29 +02:00