After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 636650 - AppSwitcher: Delay activating appIcons when the thumbnail list is open
AppSwitcher: Delay activating appIcons when the thumbnail list is open
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Dan Winship
gnome-shell-maint
: 613050 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-12-06 21:05 UTC by drago01
Modified: 2011-01-24 18:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
AppSwitcher: Delay activating appIcons when the thumbnail list is open (3.18 KB, patch)
2010-12-06 21:05 UTC, drago01
needs-work Details | Review
AppSwitcher: Delay activating appIcons when the thumbnail list is open (3.98 KB, patch)
2011-01-06 14:15 UTC, drago01
needs-work Details | Review
AppSwitcher: Delay activating appIcons when the thumbnail list is open (4.52 KB, patch)
2011-01-06 17:30 UTC, drago01
none Details | Review
AppSwitcher: Delay activating appIcons when the thumbnail list is open (4.68 KB, patch)
2011-01-06 17:57 UTC, drago01
none Details | Review
AppSwitcher: Delay activating appIcons when the thumbnail list is open (4.19 KB, patch)
2011-01-06 18:16 UTC, drago01
none Details | Review
AppSwitcher: Delay activating appIcons when the thumbnail list is open (6.11 KB, patch)
2011-01-06 19:22 UTC, drago01
committed Details | Review

Description drago01 2010-12-06 21:05:00 UTC
Quote from IRC:

----
<mccann> this worst alt tab bug is the behavior of the mouse crossing when the window box is up
..
<mccann> drago01: you aim for the window box and hit an app icon and you get mad
----
Comment 1 drago01 2010-12-06 21:05:20 UTC
Created attachment 175957 [details] [review]
AppSwitcher: Delay activating appIcons when the thumbnail list is open

When aiming for the thumbnails with the mouse one might cross an
icon by accident which causes the thumbnail list to be closed, which is
frustrating.

Fix this by delaying the icon activation when the thumbnail list is
open.
Comment 2 Dan Winship 2010-12-15 09:18:52 UTC
*** Bug 613050 has been marked as a duplicate of this bug. ***
Comment 3 Dan Winship 2010-12-15 09:46:10 UTC
Comment on attachment 175957 [details] [review]
AppSwitcher: Delay activating appIcons when the thumbnail list is open

>+    // We override SwitcherList's addItem to be able to use a custom enter-event handler

that seems unnecessarily messy... there ought to be a simpler way

>+        if (this._thumbnailsFocused) {
>+            this._mouseTimeOutId = Mainloop.timeout_add(APP_ICON_HOVER_TIMEOUT,
>+                                                            Lang.bind(this, function () {
>+                                                                                this._itemEntered(n);
>+                                                            }));
>+        }

It looks like this will get triggered after the timeout regardless of whether or not the pointer is still in the icon?

>     highlight : function(n, justOutline) {
>+        // Sync the thumbnail focus state
>+        this._thumbnailsFocused = justOutline;
>+

it's actually "n != 1 && justOutline && this.icons[n].cachedWindows.length > 1". You should sync the _thumbnailFocused setting with the code that shows/hides the arrow.
Comment 4 drago01 2010-12-15 16:05:17 UTC
(In reply to comment #3)
> (From update of attachment 175957 [details] [review])
> >+    // We override SwitcherList's addItem to be able to use a custom enter-event handler
> 
> that seems unnecessarily messy... there ought to be a simpler way

Suggestions? I might be missing something obvious but everything else which I can think of is even worse ...

> >+        if (this._thumbnailsFocused) {
> >+            this._mouseTimeOutId = Mainloop.timeout_add(APP_ICON_HOVER_TIMEOUT,
> >+                                                            Lang.bind(this, function () {
> >+                                                                                this._itemEntered(n);
> >+                                                            }));
> >+        }
> 
> It looks like this will get triggered after the timeout regardless of whether
> or not the pointer is still in the icon?

Indeed ...

> >     highlight : function(n, justOutline) {
> >+        // Sync the thumbnail focus state
> >+        this._thumbnailsFocused = justOutline;
> >+
> 
> it's actually "n != 1 && justOutline && this.icons[n].cachedWindows.length >
> 1". You should sync the _thumbnailFocused setting with the code that
> shows/hides the arrow.

OK
Comment 5 drago01 2011-01-06 14:15:58 UTC
Created attachment 177658 [details] [review]
AppSwitcher: Delay activating appIcons when the thumbnail list is open

When aiming for the thumbnails with the mouse one might cross an
icon by accident which causes the thumbnail list to be closed, which is
frustrating.

Fix this by delaying the icon activation when the thumbnail list is
open.
Comment 6 Dan Winship 2011-01-06 15:29:31 UTC
Comment on attachment 177658 [details] [review]
AppSwitcher: Delay activating appIcons when the thumbnail list is open

>+            this._mouseTimeOutId = Mainloop.timeout_add(APP_ICON_HOVER_TIMEOUT,
>+                                                            Lang.bind(this, function () {

second line is indented too far

>+        }
>+        else
>+           this._itemEntered(index);

"}" and "else" should be on the same line (and some people would say to use {}s on the else body too, since you have them on the if body, though I don't care).

>+        if (this.icons[index].icon == pickedActor)
>+            this._itemEntered(index);

That will only trigger if the pointer is over the icon itself, but the original enter-event covered a larger actor (including the icon's label and various padding and spacing as well). I think you want "if (this._items[index].contains(pickedActor))"

>+        // Sync the thumbnail focus state
>+        this._thumbnailsFocused  = n != -1 && justOutline && this.icons[n].cachedWindows.length >= 1;

No, what I meant before was that there's no reason to try to recompute this state from scratch a second time, because (a) it's complicated, and (b) it corresponds exactly to whether or not we're displaying a down-arrow. So add "this._thumbnailsFocused = false;" after "this._arrows[this._curApp].hide();" and "this._thumbnailsFocused = true" after "this._arrows[this._curApp].show();".
Comment 7 drago01 2011-01-06 17:30:27 UTC
Created attachment 177676 [details] [review]
AppSwitcher: Delay activating appIcons when the thumbnail list is open

When aiming for the thumbnails with the mouse one might cross an
icon by accident which causes the thumbnail list to be closed, which is
frustrating.

Fix this by delaying the icon activation when the thumbnail list is
open.
Comment 8 drago01 2011-01-06 17:57:23 UTC
Created attachment 177680 [details] [review]
AppSwitcher: Delay activating appIcons when the thumbnail list is open

When aiming for the thumbnails with the mouse one might cross an
icon by accident which causes the thumbnail list to be closed, which is
frustrating.

Fix this by delaying the icon activation when the thumbnail list is
open.

---

*) Fix _thumbnailsFocused bug
Comment 9 drago01 2011-01-06 18:16:07 UTC
Created attachment 177687 [details] [review]
AppSwitcher: Delay activating appIcons when the thumbnail list is open

When aiming for the thumbnails with the mouse one might cross an
icon by accident which causes the thumbnail list to be closed, which is
frustrating.

Fix this by delaying the icon activation when the thumbnail list is
open.

----

The last version didn't actually work either, so fix it again.
Comment 10 drago01 2011-01-06 19:22:06 UTC
Created attachment 177692 [details] [review]
AppSwitcher: Delay activating appIcons when the thumbnail list is open

When aiming for the thumbnails with the mouse one might cross an
icon by accident which causes the thumbnail list to be closed, which is
frustrating.

Fix this by delaying the icon activation when the thumbnail list is
open.

----

*) Changed thumbnail state tracking as discussed on IRC
Comment 11 Dan Winship 2011-01-24 17:55:25 UTC
Comment on attachment 177692 [details] [review]
AppSwitcher: Delay activating appIcons when the thumbnail list is open

sorry, forgot about this one. looks good
Comment 12 drago01 2011-01-24 18:33:36 UTC
Attachment 177692 [details] pushed as 75d1230 - AppSwitcher: Delay activating appIcons when the thumbnail list is open