Commit Graph

15 Commits

Author SHA1 Message Date
Jasper St. Pierre
0824eb7c96 cursor-tracker: Make sure to sync after we change the cursor
So the cursor changes immediately...
2013-11-19 15:43:46 -05:00
Jasper St. Pierre
73a9082062 cursor-tracker: Make ensure_wayland_cursor take a ref
This fixes a crash in the last commit because that's what I thought
this would do.

It also simplifies callers drastically...
2013-11-18 19:47:34 -05:00
Jasper St. Pierre
4091f5493d cursor-tracker: Force the grab cursor on grab ops
This makes window moving have a 'window move' cursor, and similar.
2013-11-18 19:34:24 -05:00
Jasper St. Pierre
d96b053c9d cursor-tracker: Use a sync methodology for the cursor image
Rather than have MetaWaylandSeat do all the state management itself,
put the split between the root cursor and the window cursor in the
cursor tracker itself. We'll expand this to add a "grab" cursor in
the next commit, allowing us to force a cursor on grab operations.
2013-11-18 19:25:47 -05:00
Jonas Ådahl
dc8231c2cf MetaCursorTracker: Set hot spot when cursor buffer set from wl_buffer
When creating MetaCursorReference using a wl_resource, use the provided
hotspot coordinates.

This makes clients such as clickdot work more correctly.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=709593
2013-10-21 21:13:56 +02:00
Jasper St. Pierre
a6bf340ff8 display: Deduplicate cursor loading code
Rather than do the cursor -> name translation ourselves in two different
places, use the facilities in libXcursor to do it for us. Put the shared
piece of code in meta-cursor-tracker, and use it for both server-side and
client-side cursor loading.
2013-10-07 13:34:40 -04:00
Jasper St. Pierre
35ef7c95b2 cursor-tracker: Fix the translation for DND_IN_DRAG 2013-10-07 13:09:16 -04:00
Giovanni Campagna
58622c0515 MetaCursorTracker: fix compilation in big endian arches
The enum name was wrong.
Patch originally by Dan Horák <dan@danny.cz>

https://bugzilla.gnome.org/show_bug.cgi?id=708813
2013-09-26 13:33:23 +02:00
Giovanni Campagna
6c1feedbdf Fixup previous MetaCursorTracker commit
I had it fixed locally, then it was lost in a bad rebase.
2013-09-16 10:06:44 +02:00
Giovanni Campagna
7baf687499 MetaCursorTracker: add support for loading cursors from the theme
Not only this way we get the right Adwaita cursor as the default
(instead of shipping our own in png format), but we also add
support for all MetaCursors as root cursor (which most important
should allow us to have I-beams in shell entries)

https://bugzilla.gnome.org/show_bug.cgi?id=707573
2013-09-16 09:31:44 +02:00
Giovanni Campagna
a3e44d13d1 wayland: implement HW cursors
Use the DRM API and libgbm to upload cursor buffers to the
appropriate HW plane, saving on GL calls and compositing.

https://bugzilla.gnome.org/show_bug.cgi?id=707573
2013-09-16 09:27:48 +02:00
Giovanni Campagna
5b3340e585 MetaCursorTracker: add methods for setting the cursor visibility
clutter_stage_show_cursor()/hide_cursor() only works in the X11
backend (where someone else is in charge of showing the cursor),
and even then, it has confusing effects when running nested wayland,
so an abstraction layer is needed.

https://bugzilla.gnome.org/show_bug.cgi?id=707474
2013-09-09 18:04:07 +02:00
Giovanni Campagna
6f4f611ba8 MetaCursorTracker: extend with query pointer abilities
We need an abstraction in gnome-shell for XQueryPointer, and
MetaCursorTracker seems a good place for it.

https://bugzilla.gnome.org/show_bug.cgi?id=707474
2013-09-09 18:04:07 +02:00
Jasper St. Pierre
c9fbb51775 wayland: Fix build when building without Wayland 2013-08-23 22:05:11 -04:00
Giovanni Campagna
2ae7454f36 Add MetaCursorTracker, a new helper for tracking the cursor sprite
Under X, we need to use XFixes to watch the cursor changing, while
on wayland, we're in charge of setting and painting the cursor.
MetaCursorTracker provides the abstraction layer for gnome-shell,
which can thus drop ShellXFixesCursor. In the future, it may grow
the ability to watch for pointer position too, especially if
CursorEvents are added to the next version of XInput2, and thus
it would also replace the PointerWatcher we use for gnome-shell's
magnifier.

https://bugzilla.gnome.org/show_bug.cgi?id=705911
2013-08-19 16:09:53 +02:00