Commit Graph

56 Commits

Author SHA1 Message Date
Carlos Garnacho
7b85a3417a wayland: Implement drag sources
The wl_data_source is retrieved from the selection object for the DnD
selection, and used to initiate a drag. When the drag is finished, a
button release or touch end event is synthesized to finish the DnD
operation after the compositor grab is gone.

https://bugzilla.gnome.org/show_bug.cgi?id=697855
2014-09-01 19:17:53 +02:00
Carlos Garnacho
9b0b88d16b wayland: Implement the dropping part of DnD
All destination-side events are emitted, and updates to the drop context
are notified through the currently handled wl_data_offer.

https://bugzilla.gnome.org/show_bug.cgi?id=697855
2014-09-01 19:17:53 +02:00
Carlos Garnacho
7744799072 wayland: Implement drag/source side of selections
This has been made to work similarly to X11, requests for the data device
contents are notified through GDK_SELECTION_REQUEST events, the data stored
in the GDK_SELECTION property as a reaction to that event is then stored
into the wayland selection implementation, and written to the fd when
requested/available.

https://bugzilla.gnome.org/show_bug.cgi?id=697855
2014-09-01 19:17:53 +02:00
Carlos Garnacho
3b953041a9 wayland: Implement drop/destination side of selections
This implementation makes the destination side of selections work
similarly to X11's, gdk_selection_convert() triggers data fetching,
which is notified through GDK_SELECTION_NOTIFY events on arrival,
the buffered data is then available through gdk_selection_property_get().

https://bugzilla.gnome.org/show_bug.cgi?id=697855
2014-09-01 19:17:53 +02:00
Carlos Garnacho
2c36dc7592 wayland: Add internal API to unset a touch implicit grab
This removes both the wayland specific accounting, and the Gdk implicit
grab tracking.

https://bugzilla.gnome.org/show_bug.cgi?id=731380
2014-08-26 13:39:41 +02:00
Carlos Garnacho
537ff9fcad wayland: Improve implicit grab serial retrieval
_gdk_wayland_device_get_button_press_serial() has been replaced by
_gdk_wayland_device_get_implicit_grab_serial(), which takes a touch/pointer
event and figures out the relevant serial, and
_gdk_wayland_device_get_last_implicit_grab_serial() which returns
the most recent serial.

The button press serial was currently used when operating popping up
xdg_shell/surface popups and window menus, so this is now touch aware, of
some sort.

https://bugzilla.gnome.org/show_bug.cgi?id=734374
2014-08-26 13:32:46 +02:00
Jasper St. Pierre
a07fc2f85d wayland: Remove overly complex cursor cache 2014-08-10 12:34:56 -04:00
Jasper St. Pierre
b0bd9d82a3 Revert "wayland: Prevent stale paints and weird artifacts when using Weston"
This reverts commit 76922c169f.

This is too local a fix, and is broken if the user paints to a small
region, as the entire buffer will be wiped.
2014-07-14 19:12:19 -04:00
Jasper St. Pierre
76922c169f wayland: Prevent stale paints and weird artifacts when using Weston
Weston releases buffers almost immediately after they're done, which
means that GTK+ doesn't use a temporary surface and instead paints
directly onto the SHM backing store that Weston will use.

Normally, after painting to the temporary surface, GTK+ *replaces*
the existing backing surface with CAIRO_OPERATOR_SOURCE. However,
if we immediately paint to the backing surface, it might have junk
from the last paint in it. So clear out the backing surface whenever
somebody calls begin_paint_region().

Maybe we should just always use the temporary surface like the X11
codepath, since that prevents us from having to do weird things like
this, but oh well.
2014-06-20 09:02:02 -04:00
Jasper St. Pierre
8201e2bfab wayland: Merge buffer implementations 2014-04-12 08:20:33 -07:00
Jasper St. Pierre
9127087e1c wayland: Replace wl_shell_surface with xdg_shell 2013-11-18 13:44:20 -05:00
Giovanni Campagna
7f8bf41633 gtk-shell: extend the protocol with shell capabilities
Add the concept of shell capabilities, which allow the compositor
to advertise support for the app menu and the global menubar,
which are then propagated as GdkSettings.

https://bugzilla.gnome.org/show_bug.cgi?id=707129
2013-09-03 17:03:43 +02:00
Alexander Larsson
b2113b7384 gdk: Add gdk_cursor_new_from_surface
We need this to be able to handle scaled cursor images.
We implement the new _from_pixbuf by converting to a surface and
assuming the scale was 1.
2013-08-07 13:34:10 +02:00
Alexander Larsson
ce68a2f870 wayland: Implement gdk_screen_get_monitor_scale()
We bind to the newer version of the wl_output which supports
the new done and scale events, and if we use this to get the
scale for each monitor (defaulting to 1 if not supported).
2013-07-03 14:34:13 +02:00
Benjamin Otte
a30b84f522 wayland: Don't add/remove displays manually
This code is handled by GdkDisplay itself these days.
2013-05-01 18:12:38 +02:00
Owen W. Taylor
23031defde wayland: fill in refresh_interval in GdkFrameTimings
Track the outputs that a window is on, and use the refresh rate from
a random one of those outputs for the refresh_interval in
GdkFrameTimings.

https://bugzilla.gnome.org/show_bug.cgi?id=698864
2013-04-25 13:50:01 -04:00
Benjamin Otte
edfaeba32b Revert "wayland: Cache the discovery connection and reuse if possible"
This reverts commit 524ce7f88e.
2013-04-19 16:22:32 -04:00
Benjamin Otte
cadfa58801 wayland: Get rid of generic macros
They're unused.
2013-04-19 16:18:25 -04:00
Rob Bradford
524ce7f88e wayland: Cache the discovery connection and reuse if possible
This will prevent us opening, closing and reopening the same display
connection in the majority of cases.

https://bugzilla.gnome.org/show_bug.cgi?id=694465
2013-04-19 14:03:24 +01:00
Benjamin Otte
f7c0b025b9 displaymanager: Move set_default_display vfunc
... to GdkDisplayClass.make_default. It's only implemented by X11
anyway.
2013-04-15 15:43:26 +02:00
Chris Cummins
6deff39f74 wayland: Use more explicit out parameter names
Prevent confusion between positional values and hotspot values.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2013-04-09 12:52:56 +01:00
Matthias Clasen
eb9ab7aad4 wayland: Fix up key event translation
The is_modifier field is supposed to be set if the key
would act as a modifier, not if any modifiers are currently
active. To fix this, introduce a private
_gdk_wayland_keymap_key_is_modifier function.

At the same time, make the hardware_keycode field in key
events actually contain the hardware keycode, not a copy
of the keyval.
2013-04-06 10:48:57 -04:00
Chris Cummins
b8ed3e9ef5 wayland: Implement animatable cursors
Cursor animations are handled on a per-device basis, with
GdkWaylandDevice updating the pointer surface for each frame.

https://bugzilla.gnome.org/show_bug.cgi?id=696429
2013-03-28 10:33:57 -04:00
Kristian Høgsberg
fc713dffb3 wayland: Pass most recent button press serial to set_popup_surface 2013-03-27 13:39:58 -04:00
Matthias Clasen
4987728d7a wayland: Handle seat removal
Also, emit ::device-added and ::device-removed signals
as devices appear and disappear.
2013-03-26 22:57:46 -04:00
Matthias Clasen
28c865b4e2 wayland: Make monitor removal work
The global_removal argument is the _name_ of the object.
We were comparing it to the _object id_ of the object.
To fix this, store the name at the time the object is bound.
2013-03-26 22:16:15 -04:00
Matthias Clasen
9182eacadf wayland: Don't recreated keymaps on layout change
The GDK model for keymaps expects the keymap object to stay
around and emit a ::keys-changed signal. So, do that. This
should make layout changes work, but it remains untested since
weston does not support layout changes at runtime.

At the same time, plug a memory leak where GdkWaylandKeymap
forgot to free its xkb objects in finalize.
https://bugzilla.gnome.org/show_bug.cgi?id=696339
2013-03-23 18:04:15 -04:00
Matthias Clasen
a70acc03c5 wayland: Respect keymap repeat information
xkb has a function to tell us whether a key should be repeated
or not. Lets use that information.
2013-03-23 17:29:28 -04:00
Matthias Clasen
c61956c592 wayland: Implement cursor theme changing
Add gdk_wayland_display_set_cursor_theme and implement it.
2013-03-22 20:30:51 -04:00
Thomas Hindoe Paaboel Andersen
c5145421af wayland: complete cursor_for_pixbuf
Finishes the implementation for loading cursors from pixbufs.

Gnome bug #696223
2013-03-21 18:00:23 -04:00
Kristian Høgsberg
62eb5d0358 wayland: Add a cursor cache
We avoid creating a new GdkCursor object every time
_gdk_wayland_display_get_cursor_for_name/type() is called.
2013-03-20 22:56:50 -04:00
Thomas Wood
fbc0572068 wayland: attempt to determine the possible parent surface for popups
Use the surface beneath the device that created the grab as the transient
parent for the popup surfaces.

https://bugzilla.gnome.org/show_bug.cgi?id=693913
2013-02-18 19:38:21 -05:00
Rob Bradford
4e1d999940 wayland: Add support for output device removal
Since we only receive an object id for the removed object we must try and
remove that from the list of devices based on that id.
2013-02-14 13:28:07 +00:00
Jan Arne Petersen
ff2a387154 wayland: Handle wl_output in GdkWaylandScreen
Expose information about outputs in GdkScreen (gdk_screen_get_n_monitors
and gdk_screen_get_monitor_*).
2013-02-13 15:52:05 +00:00
Jan Arne Petersen
e437016a65 wayland: Make GdkWaylandDevice public
Rename GdkDeviceCore to GdkWaylandDevice and export it properly in a
header file. Add public accessors for wl_seat, wl_pointer and
wl_keyboard.

https://bugzilla.gnome.org/show_bug.cgi?id=692823
2013-02-01 23:03:17 -05:00
Jan Arne Petersen
01c0dd9182 wayland: Make GdkWaylandWindow public
Allows to access Wayland specific window information like wl_surface and
wl_shell_surface.

Add gdk_wayland_window_get_wl_surface for getting the Wayland wl_surface
and gdk_wayland_window_get_wl_shell_surface for getting the Wayland
wl_shell_surface.
2013-01-23 22:26:27 +01:00
Jan Arne Petersen
2b9f0b4817 wayland: Make GdkWaylandDisplay public
Allows to access Wayland specific display information like wl_display
etc.

Add gdk_wayland_display_get_wl_display for getting the Wayland
wl_display.
2013-01-23 22:26:27 +01:00
Scott Moreau
e5b88f1bdd wayland: Update to reflect protocol changes 2012-10-19 12:21:35 +01:00
Rob Bradford
bef037f5d2 wayland: Remove unused function declaration 2012-07-16 20:11:41 +01:00
José Dapena Paz
a4c80bd9cb wayland: Create and expose an xkb_state on the keymap object
This is then logically associated with the input device since each (keyboard)
input device has its own keymap.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-07-16 20:11:41 +01:00
José Dapena Paz
d2267824b3 wayland: Refactor the keymap handling so it is associated with device
Although GDK expects the keymap to be associated with the display under
Wayland this is really associated with the input device so expose this by
finding the first keyboard device.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-07-16 20:11:41 +01:00
Rob Bradford
1d080a01c1 wayland: Process the keymap that is sent over from the compositor
Load the keymap from the file descriptor that the compositor has sent us and
then save that into our internal object for future use.
2012-07-16 13:44:29 +01:00
Rob Bradford
7fe87016f3 wayland: Add internal API for handling Wayland serial numbers
We need to keep track of the serial numbers for various API requests.
2012-07-12 15:58:38 +01:00
Rob Bradford
93a338245a wayland: Switch to new wayland cursors mechanism 2012-07-12 15:58:38 +01:00
Rob Bradford
3eb0b195ed wayland: Port to new input protocol mechanism
This replaces the wl_input_device with wl_pointer, wl_keyboard, wl_touch all
tied together under a wl_seat.

This is quite a radical change in protocol and for now keyboard handling is
disabled.
2012-07-12 15:58:38 +01:00
Rob Bradford
bdca0520e6 wayland: Store the device that does a grab for a window on the window
This allows us to get the device if we need to make the window a popup. This
relies on the side effect that GTK calls into GDK to take a grab before the
popup window is shown.
2012-02-27 17:15:12 +00:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Kristian Høgsberg
aae9a71986 wayland: Also synthesize a configure event from gdk_window_wayland_move_resize 2012-01-29 07:32:44 -05:00
Kristian Høgsberg
7328cc73aa wayland: Set GdkWindow focused state based on keyboard focus 2012-01-16 15:36:28 -05:00
Kristian Høgsberg
4ca3e53a3e wayland: Drop GdkToplevelWayland and gdkwindow-wayland.h 2011-02-10 22:51:23 -05:00