1
0
Fork 0
Commit graph

887 commits

Author SHA1 Message Date
Carlos Garnacho
5c9a2c54c4 xwayland: Avoid late errno checks
We do some things when binding to a socket fails (closing the fd,
logging, unlinking files, ...) those might affect errno in some
or other way, so it might no longer be EADDRINUSE even if we later
try to make those non fatal.

It seems better to check errno soon after the failure, and don't
rely on it in any way at a later point. All error paths in
bind_to_abstract_socket() also have early logging, which also might
help figure out better the point of failure when the socket fails
to be created.

https://bugzilla.gnome.org/show_bug.cgi?id=769578
2016-08-06 17:14:52 +02:00
Carlos Garnacho
dd549604e2 xwayland: Fix typo
Check the unix_fd, which is the one just created, the abstract_fd
is already checked above.
2016-08-06 16:42:25 +02:00
Jonas Ådahl
98cd8136ca MetaWindowWayland: Don't set X11 window attributes that'll get ignored
We only use a handful of the attributes set, so lets stop pretending
that things are initialized for a reason. Eventually we should stop
using XWindowAttributes in the generic MetaWindow creation path.

https://bugzilla.gnome.org/show_bug.cgi?id=769070
2016-07-23 10:55:02 +08:00
Florian Müllner
ead09bf6cc wayland: Shut up a compiler warning
If the compiler cannot figure out that the condition for setting
the dev variable is the same as the condition for accessing it,
it will complain about potential uninitialized use.
2016-07-22 23:21:30 +02:00
Carlos Garnacho
c6beb1cfc5 wayland: Emit wp_tablet_pad_group.buttons after focus changes
The buttons grabbed by the compositor might have changed in between,
so just broadcast the button array again.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
b34fe72bb7 wayland: Check serial on wp_tablet_pad.set_feedback
We must lookup the mode switch serial for the group where the button
belongs to. Also, avoid the changes if the client requests setting
the feedback for buttons owned by the compositor.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
18f301cec9 wayland: Export function to tell whether a button belongs to a pad group 2016-07-22 13:31:09 +02:00
Carlos Garnacho
406677e2a0 wayland: Check serial on wp_tablet_pad_strip.set_feedback 2016-07-22 13:31:09 +02:00
Carlos Garnacho
4f25057413 wayland: Check serial on wp_tablet_pad_ring.set_feedback 2016-07-22 13:31:09 +02:00
Carlos Garnacho
2f492c133c wayland: Fix label lookup on >1 strips/rings
We assumed that each group could only have 1 strip and/or ring, because
accounting is performed per group, so we could not assume the real
index for anything above 1. Get rid of this restriction, now that
MetaWaylandTabletPad does its own accounting of rings/strips, alongside
groups.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
138a47b8f9 wayland: Move strips/rings management back to MetaWaylandTabletPad
This is best for 2 reasons:
- It's feels cleaner doing first creation of rings/strips and then
  the group assignment. The other option is making groups iterate
  other all rings/strips and selectively skip those not meant for
  it, which sounds somewhat redundant.
- Some minimal accounting of rings/strips without group restrictions
  is needed for meta_wayland_tablet_pad_get_label().

The rings/strips memory is now owned by MetaWaylandTabletPad instead
of groups, which is sort of meaningless since all are meant to go
at the same time.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
62e4954c96 wayland: Add method to relate a pad strip to its group 2016-07-22 13:31:09 +02:00
Carlos Garnacho
062b696df2 wayland: Add method to relate a pad ring to its group 2016-07-22 13:31:09 +02:00
Carlos Garnacho
6296d30e1a wayland: Add getters for the current feedback strings in MetaWaylandTabletPad
Each of the buttons/rings/strips may have one such feedback string, this API
makes is meant to make lookups consistent.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
7bba20e536 wayland: Hook MetaWaylandTabletPad to pad button actions management
These are handled by the MetaInputSettings, so hook the events emitted
to it.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
ba9ec00694 wayland: Add update() phase to MetaWaylandTabletPad
This will be needed to update internal state of pad groups.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
08cda496f8 wayland: Apply pressure settings before sending wp_tablet_tool.pressure 2016-07-22 13:31:09 +02:00
Carlos Garnacho
7e267e9b01 wayland: Implement stylus button actions
Those just send different BTN_ keycodes.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
f3b94d9a78 wayland: Implement wp_tablet.path
Now that we have clutter_input_device_get_device_node(), it is trivial
to implement.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
5ea39e0e77 wayland: Implement wp_tablet_tool.hardware_id_wacom
We can now fetch this info from the ClutterInputDeviceTool, so
use it to implement this event.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
c1d157e136 wayland: Add focus management to pads
All pads will share the same focus than the keyboard, so this means that:
- The focus changes in-sync for keyboard and all pad devices, and
- Newly plugged pads will be immediately focused on that same surface
2016-07-22 13:31:09 +02:00
Carlos Garnacho
2cd21f1b20 wayland: Add MetaWaylandTabletSeat API to correlate pads/tablets
All pads have one tablet, but a tablet may have multiple pads. Add
API to look things up from a MetaWaylandTablet(Pad).
2016-07-22 13:31:09 +02:00
Carlos Garnacho
5ccde659c1 wayland: Add pointer from MetaWaylandTabletSeat to MetaWaylandSeat
It will be useful to backreference to the MetaWaylandSeat from tablet
code.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
fd62a1f6ce wayland: Wire up pad device event management
The tablet manager will now lookup the correct MetaWaylandTabletSeat,
and forward the events through it.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
b8808ca24d wayland: Implement pad management in MetaWaylandTabletSeat
Now pads are looked up and notified upon, both on startup and
when plugging a tablet.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
41ff0aaf60 wayland: Implement wp_tablet_pad
This object represents the collection of buttons, strips and rings
in a tablet pad. All the objects created (pad, strips and rings)
share a common focus surface and have the same lifetime.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
c5d0791710 wayland: Implement wp_tablet_pad_group 2016-07-22 13:31:09 +02:00
Carlos Garnacho
828277f5e0 wayland: Implement wp_tablet_pad_strip
This represents pad sliders.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
e56d6b06cf wayland: Implement wp_tablet_pad_ring
This object represents pad "wheels"
2016-07-22 13:31:09 +02:00
Carlos Garnacho
8b769a3412 wayland: Set an specific role on surfaces passed in wp_tablet_tool.set_cursor
This is now separated from the generic cursor one. This means that wl_surfaces
can't be shared across wl_pointer and wp_tablet_tool. This is a change in
tablet protocol v2.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
8d3ac8c3e9 wayland: Add MetaWaylandSurfaceRoleTabletCursor
This is a simple subclass of MetaWaylandSurfaceRoleCursor, mostly
so we can distinguish by GType, the methods in the parent class
still apply and are useful.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
074b0d6b2a wayland: Make MetaWaylandSurfaceRoleCursor derivable 2016-07-22 13:31:09 +02:00
Carlos Garnacho
8e8cdf1873 wayland: Make additional data in MetaWaylandSurfaceRoleCursor private
This will help subclassing it.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
72ee6b8b65 wayland: Use wl_fixed_t for angle arguments in wp_tablet_tool
This is a change in tablet protocol v2
2016-07-22 13:31:09 +02:00
Carlos Garnacho
3d9bb1cc09 wayland: Use tablet protocol v2
This commit merely updates the code generation from the v2 protocol
description.
2016-07-22 13:31:09 +02:00
Thomas Hindoe Paaboel Andersen
b5e797f453 MetaSurfaceActorWayland: clean up var assigned to self
https://bugzilla.gnome.org/show_bug.cgi?id=769054
2016-07-22 10:44:19 +08:00
Jonas Ådahl
95a68854ad configure.ac: Add AC_GNU_SOURCE
We define it here and there already, and if we are to include private
cogl files, we need it in more places. Lets just add it everywhere.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Rui Matos
b281f9566d wayland-surface: Make get_relative_coordinates() accurate for X apps
Using clutter API to transform coordinates is only accurate right
after a clutter layout pass but this function is used e.g. to deliver
pointer motion events which can happen at any time. This isn't a
problem for wayland clients since they don't control their position,
but X clients do and we'd be sending outdated coordinates if a client
is moving a window in response to motion events.

https://bugzilla.gnome.org/show_bug.cgi?id=768039
2016-07-15 14:27:16 +02:00
Carlos Garnacho
21fd87c4af xwayland: Use CurrentTime on all XConvertSelection calls
The call fetching the targets mistakenly used the timestamp meant
to back up the TIMESTAMP atom (hence, it's the timestamp at which
the selection is *owned* by the compositor, on behalf of a wayland
client).

This timestamp is actually only updated when the compositor gets
to own the selection, so it's a randomly late timestamp to retrieve
the TARGETS atom content, which certain clients might end up
ignoring.

https://bugzilla.gnome.org/show_bug.cgi?id=768007
2016-06-27 11:42:26 +02:00
Olivier Fourdan
989ec7fc60 wayland: Mark pending moved as moved
The result flag needs to be marked as moved even for pending moves,
otherwise the window's unconstrained_rect doesn't get updated in
meta_window_move_resize_internal() and the anchor grab is wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=764180
2016-06-13 17:31:35 +02:00
Olivier Fourdan
c72efc90cb wayland: Implement force-quit using kill()
The X11 backend uses EWMH's _NET_WM_PID to get the PID of an offending
client and kill its PID to force the client to terminate.

The Wayland backend is using a Wayland protocol error, but if the client
is hung, that will not be sufficient to kill the client.

Retrieve the client PID under Wayland using the Wayland client API
wl_client_get_credentials() and kill() the client the same way the X11
backend does.

https://bugzilla.gnome.org/show_bug.cgi?id=767464
2016-06-10 09:55:19 +02:00
Olivier Fourdan
e7430a4535 wayland: add extended state for tiled
xdg-shell allows desktop environments to extend the list of states
within a given range.

Use this possibility to add a new state for tiled so that gtk+ can
benefit from this.

https://bugzilla.gnome.org/show_bug.cgi?id=766860
2016-06-08 14:54:41 +02:00
Rui Matos
2292458f5e wayland/*-shell: UTF-8 validate title, class and app ID strings
The protocol says these must be UTF-8 so let's ensure they are.

https://bugzilla.gnome.org/show_bug.cgi?id=752788
2016-06-07 20:17:39 +02:00
Rui Matos
15300ae72e wayland-outputs: Refactor event sending to ensure we're consistent
This makes us behave the same both on bind and when an output
changes. In particular, we were not sending scale and done events on
output changes. We were also unconditionally sending mode events on
output changes even though these should only be sent if there is an
actual mode change.

https://bugzilla.gnome.org/show_bug.cgi?id=766528
2016-05-20 15:45:25 +02:00
Marek Chalupa
6cc688d575 wayland: don't send notify when window is being unmanaged
If we try to send notify event (either from surface_state_changed()
or from meta_window_wayland_move_resize_internal()),
we will crash, because we don't have a sufrace anymore.
There's no reason why to resize the window that is being
unmanaged anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=751847
2016-05-12 20:06:11 +02:00
Carlos Garnacho
ccf6dcd865 wayland: Ensure tablet objects tear down resources properly
Otherwise the resource is still linked to a wl_list whose storage
has been freed, leading to invalid writes.
2016-05-10 17:45:04 +02:00
Carlos Garnacho
2c13ae2b59 wayland: Remove unused list from MetaWaylandTablet
This object has no concept of focus itself, so the focus_resource_list
is unused.
2016-05-10 17:45:04 +02:00
Carlos Garnacho
2cec7ac596 wayland: Ensure each MetaWaylandSeat gets its MetaWaylandTabletSeat
Those need to be created in advance in order to handle properly the
events, even on lack of requesting clients.
2016-05-03 18:17:01 +02:00
Carlos Garnacho
0f93ad8b53 wayland: Add methods to update the position of different tools' cursors 2016-05-03 18:17:01 +02:00
Carlos Garnacho
a631010a7a wayland: Implement tool notification
Those must be notified to clients before proximity_in, only if the client
didn't have a resource for this tool previously.
2016-05-03 18:17:01 +02:00