Commit Graph

5907 Commits

Author SHA1 Message Date
Emmanuele Bassi
fb8eacfb02 device: Guard against divisions by zero
The range of a device could be 0, so we need to bail out from the
scaling during the axis translation.

https://bugzilla.gnome.org/show_bug.cgi?id=707033
2013-09-23 23:21:19 +01:00
Emmanuele Bassi
300c76df17 x11: Ensure we have a stage before accessing its fields
For some XI2 we do not have a Stage associated to the event window.

Original patch by: Giovanni Campagna <scampa.giovanni@gmail.com>
Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>

https://bugzilla.gnome.org/show_bug.cgi?id=708439
2013-09-20 10:56:57 +01:00
Emmanuele Bassi
0f217f0722 Documentation fixes 2013-09-19 22:58:43 +01:00
Emmanuele Bassi
a1d29abc38 evdev: Clean up debug and error messages
https://bugzilla.gnome.org/show_bug.cgi?id=707901
2013-09-19 22:51:52 +01:00
Emmanuele Bassi
9eb479aeef evdev: Cache the regexp
Instead of recreating it for every new device, we can cache the GRegex
and reuse it.

https://bugzilla.gnome.org/show_bug.cgi?id=707901
2013-09-19 22:51:52 +01:00
Emmanuele Bassi
a26690a73d cogl: Compensate for window scaling
The common stage window code that we share on Cogl-based backends should
also use the scaling factor.

https://bugzilla.gnome.org/show_bug.cgi?id=705915
2013-09-19 22:51:52 +01:00
Emmanuele Bassi
75f81fee70 x11: Apply the window scaling factor
On high DPI density displays we create surfaces with a size scaled up by
a certain factor. Even if the contents stay at the same relative size
and position, we need to compensate the scaling both when changing the
surface size, and when dealing with input.

https://bugzilla.gnome.org/show_bug.cgi?id=705915
2013-09-19 22:51:52 +01:00
Emmanuele Bassi
0d0cb13c8d stage: Adjust drawing to include the window scaling factor
In order to transparently support high DPI density displays, we must
maintain all coordinates and sizes exactly as they are now — but draw
them on a surface that is scaled up by a certain factor. In order to
do that we have to change the viewport and initial transformation
matrix so that they are scaled up by the same factor.

https://bugzilla.gnome.org/show_bug.cgi?id=705915
2013-09-19 22:51:52 +01:00
Emmanuele Bassi
b9072a5e21 stage-window: Add scaling factor accessors
We'll need to set and get the scaling factor of a ClutterStage from its
StageWindow implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=705915
2013-09-19 22:51:52 +01:00
Giovanni Campagna
5c44a5e6f4 ClutterEvent: preserve extended state across clutter_event_copy()
We're going nowhere if we don't copy these, because the final
delivered event is a copy of the event generated by the backend.

https://bugzilla.gnome.org/show_bug.cgi?id=708383
2013-09-19 18:05:33 +02:00
Giovanni Campagna
b29115e883 evdev: fix a crash when reclaiming devices
That was not how you iterate a list!

https://bugzilla.gnome.org/show_bug.cgi?id=707901
2013-09-16 00:18:01 +02:00
Emmanuele Bassi
08ddd02bb2 backend: Do not use CLUTTER_WINDOWING_EGL unconditionally
https://bugzilla.gnome.org/show_bug.cgi?id=708079
2013-09-15 10:28:58 +01:00
Giovanni Campagna
89cd3112fe evdev: add minimal support for touchpads
The added support is very very basic (single touch, motion only,
no acceleration, no pressure recognition), but anything more
complex requires a state machine that will be hopefully provided
by libinputcommon in the future.
And at least, with this patch the pointer moves, which will be
useful for people testing wayland in 3.10 without a physical mouse.

https://bugzilla.gnome.org/show_bug.cgi?id=706494
2013-09-12 09:50:12 +02:00
Florian Müllner
986e46dc66 text: Consider text direction when computing layout offsets
Currently this is only the case when the actor's x-expand/x-align
flags have been set and clutter_text_compute_layout_offsets() is
used.

https://bugzilla.gnome.org/show_bug.cgi?id=705779
2013-09-11 17:54:57 +02:00
Giovanni Campagna
da3e6988ad Add API to restrict the windowing backend to load
In situations when the default backend would fail (for example
when compiled with X11 support but run without DISPLAY), or
when the application is using backend specific code, it makes
sense to let the application choose the backend explicitly.

https://bugzilla.gnome.org/show_bug.cgi?id=707869
2013-09-11 09:54:35 +02:00
Lionel Landwerlin
5c035f2107 click-action: disconnect signals and gsources on dispose
https://bugzilla.gnome.org/show_bug.cgi?id=707774
2013-09-10 21:48:42 +01:00
Jasper St. Pierre
ac70bd3503 box-layout: Fix floating point truncation when calculating a child's size
The child size is a float, not an int.

https://bugzilla.gnome.org/show_bug.cgi?id=707808
2013-09-09 19:32:57 -04:00
Rob Bradford
a748aab0ed wayland: Check for NULL surface on pointer leave events
In the protocol this is the expected behaviour when the client has
destroyed the surface.

https://bugzilla.gnome.org/show_bug.cgi?id=707377
2013-09-09 18:18:18 +01:00
Giovanni Campagna
d4ddabeaad evdev: remove keyboard state accessor
It was a bad idea to add it, because clutter events are batched,
so by the time the application processes one, the keyboard state
internally tracked by clutter could be already different.
Instead, apps should use clutter_event_get_state_full()

https://bugzilla.gnome.org/show_bug.cgi?id=706494
2013-09-09 18:02:04 +02:00
Lionel Landwerlin
bf007a1339 backend: add missing transfer annotation 2013-09-09 16:25:48 +01:00
Giovanni Campagna
15d036ea1e evdev: use EV_SYN/SYN_REPORT for dispatching motion events
We can't dispatch a motion event for EV_REL (because we don't
have yet the other half of the event), but we can't also queue
them at the end of processing (because we may lose some history
or have button/keys intermixed).
Instead, we use EV_SYN, which means "one logical event was
completed", and let the winsys-independent code do the actual
motion compression.

https://bugzilla.gnome.org/show_bug.cgi?id=706494
2013-09-09 13:24:23 +02:00
Giovanni Campagna
5e005b4298 evdev: implement horizontal scrolling
If the kernel reports REL_HWHELL, convert it to horizontal
scroll events.
Also reorganize a bit the recognition for the other event
enums.

https://bugzilla.gnome.org/show_bug.cgi?id=706494
2013-09-09 13:24:23 +02:00
Giovanni Campagna
d882366d11 evdev: implement setting leds
When the leds are changed in the keyboard state, propagate the
change to the actual devices.

https://bugzilla.gnome.org/show_bug.cgi?id=706494
2013-09-09 13:24:23 +02:00
Giovanni Campagna
cd1749a2a5 evdev: switch to libevdev for fetching the events
libevdev is a library that wraps the evdev subsystem, with
the ability to synchronize the state after a SYN_DROPPED event
from the kernel.

https://bugzilla.gnome.org/show_bug.cgi?id=706494
2013-09-09 13:24:19 +02:00
Giovanni Campagna
19536c8835 evdev: sync the keyboard state when releasing and reclaiming devices
When we release a device, we lose all the events after that point,
so our state can become stale. Similarly, we need to sync the
state with the effectively pressed keys when we reclaim.
This ensures that modifier keys don't get stuck when switching
VTs using a keybinding.

https://bugzilla.gnome.org/show_bug.cgi?id=706494
2013-09-09 13:18:27 +02:00
Giovanni Campagna
59f1e531f9 ClutterEvent: add API to query the full keyboard state when the event was generated
When talking to other applications or serializing the modifier
state (and in particular when implementing a wayland compositor),
the effective modifier state alone is not sufficient, one needs
to know the base, latched and locked modifiers.

Previously one could do with backend specific functionality
such as clutter_device_manager_evdev_get_xkb_state(), but the
problem is that the internal data structures are updated as
soon as the events are fetched from the upstream source, but
the events are reported to the application some time later,
and thus the two can get out of sync.
This way, on the other hand, the information is cached in the
event, and provided to the application with the value that
was current when the event was generated.

https://bugzilla.gnome.org/show_bug.cgi?id=706494
2013-09-09 13:18:23 +02:00
Giovanni Campagna
dd940a71b1 evdev: update the state of the core pointer and core keyboard for all events
These two devices are logically tied togheter, and their state
should always be the same. Also, we need to update them after
the event is queued, as the current modifier state (as opposed to the
modifier mask in the event) should include also the effect of the last
key press/release.

https://bugzilla.gnome.org/show_bug.cgi?id=706494
2013-09-09 13:18:23 +02:00
Giovanni Campagna
0db9075562 ClutterInputDevice: add new API for querying the modifier state
This way, the full state of the device is exposed.

https://bugzilla.gnome.org/show_bug.cgi?id=706494
2013-09-09 13:18:19 +02:00
Giovanni Campagna
b73f513091 evdev: use monotonic times for the events
The monotonic clock is what X uses too, so this way the timestamps
can be compared.

https://bugzilla.gnome.org/show_bug.cgi?id=706543
2013-09-09 12:02:25 +02:00
Giovanni Campagna
aef3d0022c evdev: add callback to constrain the pointer position
Add a new callback that is called prior to emitting pointer
motion events and that can modify the new pointer position.
The main purpose is allowing multiscreen apps to prevent the
pointer for entering the dead area that exists when the screens
are not the same size, but it could also used to implement
pointer barriers.
A callback is needed to make sure that the hook is called early
enough and the Clutter state is always consistent.

https://bugzilla.gnome.org/show_bug.cgi?id=706652
2013-09-09 12:00:52 +02:00
Emmanuele Bassi
e224415a47 Revert "clutter-offscreen-effect: Allocate the cogl texture directly"
This reverts commit 180e7d74f3.

The lazy texture allocation is gone in Cogl 1.15.9.
2013-09-02 17:06:49 +01:00
Jasper St. Pierre
05f56affe1 box-layout: Fix RTL layout swapping with non-zero container offsets
https://bugzilla.gnome.org/show_bug.cgi?id=706450
2013-08-21 10:13:24 -04:00
Emmanuele Bassi
4698e791bf Update exported symbols 2013-08-20 00:09:28 +01:00
Emmanuele Bassi
bf1997c4ef paint-nodes: Have a fallback buffer for the root node
If we don't get passed a CoglFramebuffer when creating the root paint
node then we ask Cogl to give us the current draw buffer.

This allows the text-cache conformance test to pass, but it'll require
further investigation.
2013-08-20 00:01:45 +01:00
Florian Müllner
c14bd84eef table-layout: Fix default values for expand/fill child properties
Currently the default values according to their param spec don't
match the actually used defaults, so update the former to reflect
the actual behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=703809
2013-08-19 23:37:53 +01:00
Florian Müllner
8e850ff3e4 box-layout: Fix (legacy) expand/fill properties
Whether a child should receive extra space should be determined
by the expand property, not [xy]_fill (which just determine how
additional space should be used). The behavior is already correct
when using the ClutterActor:[xy]_expand properties, but needs
fixing for the corresponding ClutterBoxLayoutChild property.

https://bugzilla.gnome.org/show_bug.cgi?id=703809
2013-08-19 23:37:46 +01:00
Florian Müllner
40a1903db6 bin-layout: Fix offsets
Just as BoxLayout, BinLayout uses an odd interpretation of the box
passed into allocate(): to define a child area of (w x h) starting at
(x, y), callers need to pass a box of (x, 2 * x + w, y, 2 * y + h).
This behavior is just confusing, change it to use the full box for
child allocations.

https://bugzilla.gnome.org/show_bug.cgi?id=703809
2013-08-19 23:37:43 +01:00
Florian Müllner
5dd2dcf14f box-layout: Fix child offsets
Currently, BoxLayout interprets the box passed into allocate() in
a fairly peculiar way:
 - in the direction of the box, all space between [xy]1 and [xy]2
   is distributed among children (e.g. children occupy the entire
   width/height of the box, offset by [xy]1)
 - in the opposite direction, expanded children receive space
   between [xy]1 and the height/width of the box (e.g. children
   occupy the width/height of the box minus [xy]1, offset by [xy]1)
The second behavior doesn't make much sense, so adjust it to interpret
the box parameter in the same way as the first one.

https://bugzilla.gnome.org/show_bug.cgi?id=703809
2013-08-19 23:37:41 +01:00
Florian Müllner
5bab9a8655 actor: Minor cleanup
In clutter_allocate_align_fill(), x2/y2 may be set twice for no
particular reason; save a couple of lines by not doing this.

https://bugzilla.gnome.org/show_bug.cgi?id=703809
2013-08-19 23:37:38 +01:00
Emmanuele Bassi
0d7bbc747f docs: Fix gtk-doc warnings 2013-08-19 23:30:09 +01:00
Emmanuele Bassi
0b6498d655 Use paint nodes to set up the stage
This allows to set a Content on a stage, and consolidates the paint
code where it belongs.

https://bugzilla.gnome.org/show_bug.cgi?id=704625
2013-08-19 23:23:45 +01:00
Emmanuele Bassi
1d9e264051 paint-nodes: Remove modelview from ClutterRootNode
It's pointless, since RootNode sits at the top and there's no modelview
to be set.

https://bugzilla.gnome.org/show_bug.cgi?id=704625
2013-08-19 23:23:43 +01:00
Emmanuele Bassi
b50e1c3b62 actor: Do not set remove-on-complete on implicit transitions
The implicitly created transitions are removed when complete by the
implicit transition machinery. The remove-on-complete hint is for
user-provided transitions.

https://bugzilla.gnome.org/show_bug.cgi?id=705739
2013-08-19 23:22:38 +01:00
Emmanuele Bassi
edf00747ef docs: Use the correct signal name
ClutterTransition:remove-on-complete uses the ClutterTimeline::stopped
signal, as it's the signal that tells us that the timeline's duration
has fully elapsed.
2013-08-19 23:22:38 +01:00
Giovanni Campagna
0e519e2b3b evdev: implement wheel events
Mouse wheel events come as EV_REL/REL_WHEEL, and we can convert
them to clutter events on the assumption that scrolling with
the wheel is always vertical.

https://bugzilla.gnome.org/show_bug.cgi?id=705710
2013-08-14 16:50:45 +02:00
Giovanni Campagna
7b780b0c38 evdev: don't update xkb state for autorepeated keys
xkb_state_update_key() needs to be called only on state transitions,
otherwise the state tracking gets confused and locks certain modifiers
forever.

https://bugzilla.gnome.org/show_bug.cgi?id=705710
2013-08-13 18:11:12 +02:00
Giovanni Campagna
8c358f18b1 evdev: allow hooking directly into libxkbcommon
A wayland compositor needs to have more keyboard state than
ClutterModifierState exposes, so it makes sense for it to use
xkb_state directly. Also, it makes sense for it to provide
it's own keymap, to ensure a consistent view between the compositor
and the wayland clients.

https://bugzilla.gnome.org/show_bug.cgi?id=705710
2013-08-13 17:51:33 +02:00
Giovanni Campagna
786532213b evdev: add master / slave device handling
All evdev devices are slave devices, which means that xkb state
and pointer position must be shared by emulating a core keyboard
and a core pointer. Also, we must make sure to add all modifier
state (keyboard and button) to our events.

https://bugzilla.gnome.org/show_bug.cgi?id=705710
2013-08-13 17:42:43 +02:00
Giovanni Campagna
f749858df3 evdev: remove dead code
ClutterDeviceManager uses g_object_new directly, to pass the
necessary properties down.

https://bugzilla.gnome.org/show_bug.cgi?id=705710
2013-08-13 09:41:45 +02:00
Giovanni Campagna
d844cf5462 evdev: fix xkb_state handling
We must pass X11 keycodes, not evdev ones, to libxkbcommon,
otherwise the modifier state is wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=705710
2013-08-13 09:41:44 +02:00