[Sugar-devel] [DESIGN] Double clicks on Journal, Favorites view and Activity List view launches 2 or more instances
James Cameron
quozl at laptop.org
Wed Jun 2 19:29:52 EDT 2010
Firstly, I don't think this is a DESIGN issue, it's simply an
implementation defect. Sugar should not launch two instances of
something that can have only one instance.
On Wed, Jun 02, 2010 at 09:59:19AM -0400, mabente wrote:
> My first approach (as matter of testing) was to give an exclusive time
> frame for each click event, ignoring any other click event during that time
> frame.
That means you are attempting to avoid a race by adding a delay. I
don't think that is the correct solution, since the amount of delay will
vary according to the performance and loading of the system that Sugar
is being used on.
> Any other ideas on how to approach this problem (hopefully more
> general or elegant) ?
Have a look at
http://dev.laptop.org/ticket/10016
http://bugs.sugarlabs.org/ticket/1719
Especially test the patch pushed overnight on SL #1719. Let us know if
that fixes the problem for you.
The OLPC #10016 contains several analyses by me ... and the most recent
I think is the most correct:
"The sugar-session process is accepting X events for user actions as
well as D-Bus events.
The logic that avoids resuming the same activity twice is built on the
shell's list of active activities: shell._activities[]
This list is added to when the shell receives a D-Bus NotifyLaunch
method call event from the activity factory. (It is also added to when a
launcher or activity window with an activity id property is created, but
the NotifyLaunch would normally happen first).
Now, the activity factory executes in the context of the same
sugar-session process ... as a result of the user clicking on an icon.
The race is between processing the D-Bus NotifyLaunch event and the X
events from the touchpad buttons. If the X events arrive before the
D-Bus event queue is checked, then the same journal entry will be
resumed more than once.
The race is only relevant for resumed activities, since these are given
the same activity id. "
--
James Cameron
http://quozl.linux.org.au/
More information about the Sugar-devel
mailing list