Commit Graph
31 Commits
Author SHA1 Message Date
Carlos Garnacho 3596e8c6cb palettemenuwidget: Ensure the widget is realized before popping it up, SL #4388
Otherwise the internal state is messed up, GTK+ grabs may be held on
unrealized widgets.

Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2013-01-17 18:17:43 +01:00
Carlos Garnacho a22d4ee50d keygrabber: Handle XI2 key events, part of SL #3895
XInput2 events are coerced by active grabs on the alt-tab handling
code in sugar shell, even if the keygrabber itself does core events.

Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-12-14 13:39:14 +01:00
Carlos Garnacho 297cd72757 window: Avoid odd scrolling on OSK presence
Now it suffices to have the widget and osk rectangles intersect,
to have "clear-request-area" emitted, so cater for the situations
where the focus rect lies outside the osk area.

Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-11-27 19:07:16 +01:00
Carlos Garnacho b2df135844 Reset event controllers on GdkEventGrabBroken
This event means that the widget being listened won't receive
further input events as something else grabbed devices, reset
event controllers in this case.

This helps with SL #4128 where we did reset the long press
controller manually.

Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-11-08 10:30:17 +01:00
Carlos Garnacho 5ce0273900 gestures: Fix silly typo on get_center() implementation
Don't mix up coordinates when calculating the bounding box center

Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
Tested-by: Manuel Kaufmann <[email protected]>
2012-10-22 12:44:20 +02:00
Carlos Garnacho 4682e49823 Prevent crash if the controller didn't handle TOUCH_BEGIN
Fixes http://bugs.sugarlabs.org/ticket/4024

Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-10-16 10:02:48 +02:00
Carlos Garnacho c546aaaf7c gestures: Add remove() call to SugarGestureGrabber
Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-10-08 13:03:15 +02:00
Carlos Garnacho fe0022cd8f swipe: Allow setting allowed directions as a set of flags
The allowed swipe directions can be specified now at construct time,
so the swipe-ended signal is only emitted for those directions.

Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-10-05 20:41:40 +02:00
Carlos Garnacho 78ae2459e3 LongPressController: add 'pressed' signal with x and y coordinates
The 'pressed' signal does emit the x and y coordinates
of the position where the event occurred. This can be used
for example in the Browser where we need to know at which
exact position the long-press event occurred.

Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-10-05 00:39:45 +02:00
Carlos Garnacho b79a391902 Put an error trap around XIAllowTouchEvents()
These calls are occasionally failing with BadAccess on seemingly
still valid (not yet notified upon) touch sequences. Workaround
this Xorg bug with error traps at the moment, those would catch
no error when this is working properly.

Fixing this bug will be tracked at SL #3981

Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-10-04 18:27:49 +02:00
Carlos Garnacho 81ee0632c9 gesture-grabber: Ignore events not meant for the root window
The passive touch grab is set on the root window, so if touch
events get to a different window it's best to leave those for
GTK+ to handle.

Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-10-03 14:48:57 +02:00
Carlos Garnacho c635ee5dd7 Include SugarGestureGrabber in .gir generation
Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-10-02 16:22:57 +02:00
Carlos Garnacho 470d14a749 swipe: enter into "recognized" state when there is a motion directionality
This allows for checking the controller state as events are fed into it
without connecting to begin/end signals

Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-10-02 16:22:57 +02:00
Carlos Garnacho c5fe8a26f6 Add API to allow for tracking global gestures
The new API is added to SugarExt. Similar to the
KeyGrabber we listen on the root window for the
events. We then filter for gestures recognized by
an event controller.

You can add any event controller of the ones recently
added to the toolkit to be tracked and can pass a
specific area where the starting point of the gesture
should be, it's then allowed to go out of bounds as
it moves.

Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-10-02 16:12:12 +02:00
Carlos Garnacho fe4667f0f5 event-controller: For the long-press notification animation check on the screen being actually composited
Fixes the notification being a black rectangle on screens with an alpha colormap,
but with no compositing manager.

Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-09-18 16:48:35 +02:00
Carlos Garnacho 282ccc7734 event-controller: Rename gir to SugarGestures
Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-09-16 12:23:15 +02:00
Carlos Garnacho 495a9f43d1 event-controller: Document SugarTouchController
Also set up introspection annotations wherever it's needed

Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-09-16 12:23:15 +02:00
Carlos Garnacho 1a0ddf4d54 event-controller: Use "scale" to refer to the current value in the zoom-controller
This changed both the emitted signal and the getter

Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-09-16 12:23:15 +02:00
Carlos Garnacho aa652b8754 event-controller: Implement zoom-controller on top of SugarTouchController
Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-09-16 12:23:15 +02:00
Carlos Garnacho 1fe3d4234d event-controller: Implement rotate-controller on top of SugarTouchController
Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-09-16 12:23:15 +02:00
Carlos Garnacho 1ba68fa120 event-controller: Add SugarTouchController
This is a base class for gesture recognizers using possibly more
than a single touch.

Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-09-16 12:23:15 +02:00
Carlos Garnacho 1ecc0f5e1d event-controller: Rename emitted progress signals
started/finished was renamed to began/ended, and "updated" signal
has been added too to complete the semantics

Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-09-16 12:23:15 +02:00
Carlos Garnacho 64a759e2dc event-controller: Improve rendering/themeability of the UI notification for the long-press controller
Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-09-16 12:23:15 +02:00
Carlos Garnacho 73c0688689 event-controller: in the long-press controller rename "timeout" property to "trigger-delay"
Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-09-16 12:23:15 +02:00
Carlos Garnacho ec42f63630 event-controller: rename notification signal "swipe" to "swipe-ended"
Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-09-16 12:22:55 +02:00
Carlos Garnacho a2b77a2166 event-controler: Add UI feedback for long-press
style and colors of the progress feedback are subject to change

Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-09-16 12:22:19 +02:00
Carlos Garnacho 63ff76b95f event-controller: Add widget property to SugarEventController
controllers were already intrinsically related to a widget, so
set a property so controllers have a back reference to the widget
they attach to

Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-09-16 12:12:45 +02:00
Carlos Garnacho 7d0a6e25af event-controller: Add documentation/g-i annotations
This makes the .gir correct

Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-09-16 12:12:29 +02:00
Carlos Garnacho 239ecdfbcd event-controller: Enable introspection
Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-09-16 12:12:09 +02:00
Carlos Garnacho ade02f958b event-controller: Add separate library for event controllers
SugarEventController is an abstract object that attaches to a widget
and interprets an arbitrary set of events. Implementations of that
object get to define the sequence of events that trigger these.

The basic touch gestures (long press, rotate, swipe, zoom) have
been implemented on top of that object.

Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-09-16 12:10:30 +02:00
Carlos Garnacho f36fc4ae85 Tray: set a minimum size in the viewport so that it allows scrolling
The minimum height/width requested by the GtkViewport still tries to cater
for all contained children, which makes the [VH]Tray widgets to grow as
new items are added. Instead, request a minimum width/height of 0 to avoid
the Tray from growing, and having scrolling kick in instead.

Also, fixed what seemed to be a typo in do_get_preferred_height(), where
the viewport width was requested instead.

http://bugs.sugarlabs.org/ticket/3522

Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-05-04 16:26:48 +02:00