Commit Graph

6549 Commits

Author SHA1 Message Date
Carlos Garnacho
7a926cc7e0 gdkevents: Fallback to the event device seat
There's places where we don't set a seat yet, plus the places
outside GTK+ where events are created, we should warn and fall
back to the master device seat with these.
2015-12-16 19:47:05 +01:00
Carlos Garnacho
b0d72a36d8 gdkevents: Ensure the seat data is copied in events 2015-12-16 19:47:05 +01:00
Carlos Garnacho
c70da9b7ae gdk: Set seat on events generated in common code 2015-12-16 19:47:05 +01:00
Cosimo Cecchi
990dc9961a gdkevents: fix a compiler warning 2015-12-16 10:35:46 -08:00
Olivier Fourdan
b456db8cf4 wayland: Check transient loop
Gdk Wayland backend walks up the transient windows tree, but does not
check for cycles when doing so.

As a result, if two or more windows are transient to each other, the
Wayland gdk backend will enter an infinite loop.

While this is clearly a bug in the application, gtk+/gdk should be more
robust and handle such errors more gracefully.

To avoid looping infinitely at various point in the code, check for a
possible loop when setting the transient relationship and deny the
request to set a window transient for another if that would create a
loop.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=759299
2015-12-16 14:11:11 +01:00
Emmanuele Bassi
0b19197493 Fix the fix to the last commit
I should not push while compilation is still going on
2015-12-16 12:42:27 +00:00
Emmanuele Bassi
00102e35ea Fix previous commit
The scale parameter was missing.
2015-12-16 12:41:16 +00:00
Lars Uebernickel
1f07625705 gdk_pixbuf_get_from_window: honor device scale
gdk_pixbuf_get_from_window() paints the given window onto a new cairo
surface. Create that new surface with the same device scale as the
window so that the result is not scaled down on hidpi screens.

This is similar to 657a43e (which was reverted), but doesn't modify the
behavior of gdk_pixbuf_get_from_surface().

https://bugzilla.gnome.org/show_bug.cgi?id=757147
2015-12-16 13:07:58 +01:00
Carlos Garnacho
47632df9a5 gdkevents: Avoid gdk_device_manager_get_client_pointer()
It's now deprecated.
2015-12-15 23:24:59 +01:00
Carlos Garnacho
ee549c9ded GdkWindow: Listen to ::seat-removed in order to remove pointer info
Our actions on ::device-removed only actually applied to master
pointers, so listening to GdkDisplay::seat-removed and operating
on the seat pointer is equivalent.
2015-12-15 23:22:00 +01:00
Carlos Garnacho
b4aa498fe7 GdkWindow: Iterate through seats in gdk_window_set_cursor()
And set the pointer on all seat pointers, equivalent to the master
pointer lookup we were performing with GdkDeviceManager
2015-12-15 23:20:40 +01:00
Carlos Garnacho
ff686344c9 GdkWindow: Avoid gdk_device_manager_get_client_pointer()
It's now deprecated
2015-12-15 23:19:49 +01:00
William Hua
a6e4de2884 gdkborder: add GdkBorder to gdktypes.h 2015-12-15 10:13:03 -05:00
William Hua
c6bd3ddb8a gdkwindow: move GdkWindowTypeHint to gdktypes.h 2015-12-15 10:13:03 -05:00
Carlos Garnacho
5d6a2ae54f win32: Use GdkSeatDefault to implement GdkSeat 2015-12-15 00:40:22 +01:00
Carlos Garnacho
af54b82c0a quartz: Use GdkSeatDefault to implement GdkSeat 2015-12-15 00:40:21 +01:00
Carlos Garnacho
321154eb4b broadway: Use GdkSeatDefault to Implement GdkSeat 2015-12-15 00:40:21 +01:00
Carlos Garnacho
a33aefc281 wayland: Improve creation of windowing surface roles
We no longer need a grabbed seat, instead we'll just use the default
seat if this happens, not without first warning and recommending
gdk_seat_grab() for the operation.

https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:40:21 +01:00
Carlos Garnacho
c7280e4a31 wayland: Replace deprecated functions
We can just gdk_seat_ungrab() here.

https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:40:21 +01:00
Carlos Garnacho
4065bd1e96 gdk: Deprecate GdkDeviceManager and gdk_device_grab/ungrab()
GdkSeat is now the preferred way to deal with input devices and grabs.

https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:40:21 +01:00
Carlos Garnacho
3009eac85e wayland: Emit cancelled on touchpoint used on window dragging/moving
This allows GDK to unset the grab itself. Also, make sure we unset
the "pointer emulating" touch on the device if this is the
pointer emulating sequence.

https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:40:21 +01:00
Carlos Garnacho
77cf80f3a9 wayland: Unset "pointer emulating" touch on wl_touch.cancel
And emit the corresnponding leave event on its master pointer.

https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:40:21 +01:00
Carlos Garnacho
fc19a999ec gdk: Manage GDK_TOUCH_CANCEL events on gdk_windowing_got_event()
These events must get active/implicit grabs undone, and can be done
on client-side code.

https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:40:21 +01:00
Carlos Garnacho
09947a63ed wayland: Make gdk_wayland_device_get_focus() work on touch
So we can figure out the focus for the master device.

https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:40:21 +01:00
Carlos Garnacho
8ec3fb39a2 GdkDisplay: Add ::seat-added/removed signals
These will be emitted as seats come and go.

https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:40:21 +01:00
Carlos Garnacho
17525ef7a6 wayland: Add GdkSeat implementation
GdkWaylandDeviceData conceptually gathers the data that belongs to
a seat, so it's been renamed (although the old typedef stays, plenty
of refactoring is due here...).

The methods in GdkSeatClass have also been implemented, the most
remarkable is ::grab, which ensures the grab is performed on all
the relevant "master" devices.

https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:40:21 +01:00
Carlos Garnacho
d236fd7aab x11: Use GdkSeatDefault to implement GdkSeat
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:32:55 +01:00
Carlos Garnacho
6e8d5f70db x11: Use gdk_event_set_device() consistently
Move the variable definitions above the function, and use those
throughout all branches of the event handling switch.
2015-12-15 00:16:15 +01:00
Carlos Garnacho
da6d52711a GdkEvent: Add GdkSeat getter and internal setter
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:16:15 +01:00
Carlos Garnacho
6f4edc091b GdkDisplay: Add GdkSeat getters
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:16:15 +01:00
Carlos Garnacho
d24f63e9ce GdkDevice: Add GdkSeat property and getter
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:16:15 +01:00
Carlos Garnacho
0472c088a1 gdk: Add GdkSeatDefault
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:16:15 +01:00
Carlos Garnacho
8d68f59bef gdk: Add GdkSeat
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:16:15 +01:00
Carlos Garnacho
3733e53c1a x11: Use client pointer as default core pointer for gtk+2 API
There is no need to fiddle with the master devices list.

https://bugzilla.gnome.org/show_bug.cgi?id=759323
2015-12-15 00:04:20 +01:00
Lucas Baudin
306ee6d9a5 wayland: recursively search for the settings schema.
On some systems, the gtk settings are not used properly for wayland.
Indeed, g_settings_schema_source_get_default is used, and as the docs says it,
"all lookups performed against the default source should probably be done
recursively.".

https://bugzilla.gnome.org/show_bug.cgi?id=759409
2015-12-14 08:20:04 -05:00
Matthias Clasen
23b2b49321 x11: Implement drag cancel animation
Showing the drag cancel animation can be done in the X11
drag context implementation now that we hold the drag
window there, and have the start coordinates.

Since we can't control if and when the application destroys
the drag widget, we take a snapshot of the window contents
and display that during the animation. This should be good
enough for all practical purposes.
2015-12-13 15:49:25 -05:00
Matthias Clasen
c590b83397 gdk: Add gdk_drag_drop_done
This will allow us to move the drag cancel animation to GDK.
For now, it does nothing.
2015-12-13 10:39:43 -05:00
Matthias Clasen
ed89e5f62a x11: Store drag start coordinates
These will be used in later commits.
2015-12-13 10:39:43 -05:00
Matthias Clasen
268c7a3e44 gdk: Allow passing the start coordinates in drag_begin
Add a variant of gdk_drag_begin that takes the start position
in addition to the device. All backend implementation have been
updated to accept (and ignore) the new arguments.

Subsequent commits will make use of the data in some backends.
2015-12-13 10:39:43 -05:00
Jonas Ådahl
561833334b wayland: Implement DND icon hotspot API
In Wayland, the hotspot of a DND icon is set using the buffer offset in
wl_buffer.attach. To implement this, add a private API to cause the
next wl_surface.attach to offset the new buffer with a given offset.
Setting a DND icon hotspot sets this offset while also queuing a redraw
of the window to trigger the wl_surface.attach.

https://bugzilla.gnome.org/show_bug.cgi?id=759168
2015-12-11 09:16:46 -05:00
Matthias Clasen
28ae8a3608 Revert "wayland: Implement DND icon hotspot API"
This reverts commit 3ab9d96623.

Pushed prematurely.
2015-12-08 13:04:17 -05:00
Jonas Ådahl
3ab9d96623 wayland: Implement DND icon hotspot API
In Wayland, the hotspot of a DND icon is set using the buffer offset in
wl_buffer.attach. To implement this, add a private API to cause the
next wl_surface.attach to offset the new buffer with a given offset.
Setting a DND icon hotspot sets this offset while also queuing a redraw
of the window to trigger the wl_surface.attach.

https://bugzilla.gnome.org/show_bug.cgi?id=759168
2015-12-08 11:47:07 -05:00
Matthias Clasen
7d1a0b075d Trivial code restructuring 2015-12-07 21:57:45 -05:00
Matthias Clasen
3b4bfba37d wayland: Add a dummy implementation of gdk_drag_context_set_hotspot
This just records the hotspot coordinates. Still to do:
apply the hotspot when updating the drag window.
2015-12-07 21:53:38 -05:00
Matthias Clasen
475f6e09b1 x11: Implement gdk_drag_context_set_hotspot
This makes the drag behavior under X11 match what we had previously.
2015-12-07 21:52:51 -05:00
Matthias Clasen
f4ebdb64ee gdk: Add api to set drag window hotspot
With GdkDragContext now being in charge of placing the window,
it needs to know about the hotspot to place under the cursor.
2015-12-07 21:52:03 -05:00
William Hua
d2ef875e09 mir: remove deprecated function call 2015-12-04 11:17:43 -05:00
Lionel Landwerlin
bd332f10ab gdkoffscreenwindow: use embedder to derive surfaces & scale factor
In Gdk, a GdkOffscreenWindow parent has to be the root window. This is
problematic on Wayland because the root window doesn't necessary have the
right information with regard to scale factor.

This patch proposes to rely on the embedder, if available, to derive
surfaces as well as getting the scale factor.

https://bugzilla.gnome.org/show_bug.cgi?id=758936
2015-12-03 21:47:29 +00:00
Matthias Clasen
9fd6db87d2 Drop gdk_wayland_drag_context_get_dnd_window
This backend-specific and libgtk-only API is now unused,
so drop it.
2015-12-02 00:47:53 -05:00
Matthias Clasen
fff8297a50 Add gdk_drag_context_get_drag_window
This makes gdk_wayland_drag_context_get_dnd_window
backend-independent API and adds an implementation
for X11.
2015-12-01 23:47:56 -05:00