[Sugar-devel] [DESIGN] Double clicks on Journal, Favorites view and Activity List view launches 2 or more instances
Hello everyone, As the subject says, there is a multiple instancing problem while double clicking on Journal entries, Favorite Act icons and Act List entries. The problem is hard to reproduce on desktop PCs, but extremely easy on less powerful computers like XOs. I think the problem is that, the code handling the icon click events runs way faster than the Activity launching process, therefore many instances are being called before the Activity windows open, grabbing the focus. In the practice, an aggressive clicking period just saturate the system and make Sugar freeze. 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. Here is the code for the Journal Entries, http://oficina.paraguayeduca.org/~mabente/patches/sugar/journaliconsclick/0001-Click-on-journal-icons-with-a-exclusive-time-frame.patch Any other ideas on how to approach this problem (hopefully more general or elegant) ? ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [DESIGN] Double clicks on Journal, Favorites view and Activity List view launches 2 or more instances
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/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [DESIGN] Double clicks
On Sat, Mar 6, 2010 at 6:34 AM, Sascha Silbe sascha-ml-ui-sugar-de...@silbe.org wrote: On Sat, Mar 06, 2010 at 10:27:37AM +, Aleksey Lim wrote: But looks like sugar doesn't use double clicks somewhere, was it done by intention e.g. double clicks are too complicated to reproduce? Please don't require multi-clicks (double, triple) anywhere (or for that matter, any operation where timing is critical). Even I sometimes have trouble doing those, not to mention lots of adults I've watched using Windows. They also don't seem to understand the distinction between single and double clicks, usually doing double or even triple clicks for virtually any operation that doesn't provide instant ( 100ms) response. I'm planing to use double clicks in Library activity e.g. for [1] when [a user] wants to select all entries he needs to double click on checkbox What actions would be sensible to do on all entries? How often would a user want to execute it on all entries? Depending on the answers to those questions a viable option might be to just split up the action into [action] on selected entries and [action] on all entries. Maybe even a submenu [action] - on this entry, on selected entries, on all entries. (can't find better method, Traditional UIs provide Select All and Select None in a menu. So one option would be to add Select all entries to the contextual toolbar in [1]. add toolbar button looks redundant, popup menu requires several clicks (but could be present anyway to have explicit method)). All of those sound much better to me than requiring timing constraints to be met. [1] http://wiki.sugarlabs.org/go/Design_Team/Designs/Journal#06 CU Sascha -- http://sascha.silbe.org/ http://www.infra-silbe.de/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) I agree with Sascha that double clicking should be avoided... Perhaps kids can learn it, but we will immediately make the interface unusable for the elderly. We already use modifier keys in the interface to switch to an advanced behavior. Why not the usual shift and ctrl clicks? -walter iQEcBAEBAgAGBQJLkj20AAoJELpz82VMF3DaiC4H/06TUXkgVNTGQBbo9GCbpABB fpnTp6s2bsSikltUXLlhNiNyWFrxPnbW8kdYpVWIasEKY7RxacnRA7eLjjdmDNIm 2XKL0KeP53VVsZe1xk9A1s9OMOJ7errQ2p87c/pXIuHMEhM2bxwtG0cbaC7tnIT1 dkmSiCW3rRXAg8kFJPDa4Yc6T+MoeissRCO1+oa0qqbZq7yhytPrT81X4P7f9m+d Pd74VcSf8j9Y9HrqPmCUVQfn9UYGnBTt2FOrrVkEy2boiebjy4b5QNiCS+HDCSjn BBzzDZCfBraATcykI0/qj0U0rusCRb6oBUg5pUEf+2A5wINiM1RYBWCVAy/1Ibg= =XUwk -END PGP SIGNATURE- ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel -- Walter Bender Sugar Labs http://www.sugarlabs.org ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [DESIGN] Double clicks
On Sat, Mar 6, 2010 at 07:39, Walter Bender walter.ben...@gmail.com wrote: On Sat, Mar 6, 2010 at 6:34 AM, Sascha Silbe sascha-ml-ui-sugar-de...@silbe.org wrote: On Sat, Mar 06, 2010 at 10:27:37AM +, Aleksey Lim wrote: But looks like sugar doesn't use double clicks somewhere, was it done by intention e.g. double clicks are too complicated to reproduce? Please don't require multi-clicks (double, triple) anywhere (or for that matter, any operation where timing is critical). [snip] CU Sascha -- http://sascha.silbe.org/ http://www.infra-silbe.de/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) I agree with Sascha that double clicking should be avoided... Perhaps kids can learn it, but we will immediately make the interface unusable for the elderly. Double- and triple-clicking are in a number of Sugar activities now, with no explanation. Triple-click usually selects a whole line or a whole paragraph. Many adults are unaware that this function is available in their word processors or e-mail editors. For more on such issues, see http://wiki.sugarlabs.org/go/The_Undiscoverable We already use modifier keys in the interface to switch to an advanced behavior. Why not the usual shift and ctrl clicks? I don't mind which mouse behavior you use, as long as you provide a way to discover it. For example, you can put the action in a menu item along with a hint giving the keyboard shortcut. For example, Firefox puts this on the Edit menu along with many others. Undo Ctrl+Z This is not strictly correct, since this notation sometimes means Shift+Ctrl+z. The actual shortcut for Undo in many programs is Ctrl+z. The most common shortcut for Select All is Ctrl+a. -walter iQEcBAEBAgAGBQJLkj20AAoJELpz82VMF3DaiC4H/06TUXkgVNTGQBbo9GCbpABB fpnTp6s2bsSikltUXLlhNiNyWFrxPnbW8kdYpVWIasEKY7RxacnRA7eLjjdmDNIm 2XKL0KeP53VVsZe1xk9A1s9OMOJ7errQ2p87c/pXIuHMEhM2bxwtG0cbaC7tnIT1 dkmSiCW3rRXAg8kFJPDa4Yc6T+MoeissRCO1+oa0qqbZq7yhytPrT81X4P7f9m+d Pd74VcSf8j9Y9HrqPmCUVQfn9UYGnBTt2FOrrVkEy2boiebjy4b5QNiCS+HDCSjn BBzzDZCfBraATcykI0/qj0U0rusCRb6oBUg5pUEf+2A5wINiM1RYBWCVAy/1Ibg= =XUwk -END PGP SIGNATURE- ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel -- Walter Bender Sugar Labs http://www.sugarlabs.org ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel -- Edward Mokurai (默雷/धर्ममेघशब्दगर्ज/دھرممیگھشبدگر ج) Cherlin Silent Thunder is my name, and Children are my nation. The Cosmos is my dwelling place, the Truth my destination. http://www.earthtreasury.org/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel