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 651092 - Avoid two-step animation when going to the overview with mouse over workspace selector
Avoid two-step animation when going to the overview with mouse over workspace...
Status: RESOLVED OBSOLETE
Product: gnome-shell
Classification: Core
Component: general
3.0.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-05-25 20:29 UTC by Owen Taylor
Modified: 2021-07-05 14:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
This should fix it. (1.56 KB, patch)
2012-03-09 01:11 UTC, Joost
needs-work Details | Review
workspacesView: Refactored the private workspacesDisplay._control to public workspacesDisplay.control, to allow outside accessing. (4.42 KB, patch)
2012-03-11 23:09 UTC, Joost
reviewed Details | Review
overview: Don't show workspaces when the overview is entered and the user has the pointer on the right-side of the screen. This usually doesn't mean the user wants to open the workspaces view. (1.92 KB, patch)
2012-03-11 23:13 UTC, Joost
reviewed Details | Review
overview: Don't show workspaces when entering the overview (2.45 KB, patch)
2012-03-13 00:59 UTC, Joost
none Details | Review
overview: Don't show workspaces when entering the overview (2.41 KB, patch)
2012-03-13 15:11 UTC, Joost
none Details | Review
overview: Don't show workspaces when entering the overview (2.62 KB, patch)
2012-03-13 17:21 UTC, Joost
reviewed Details | Review
overview: Don't show workspaces when entering the overview (2.63 KB, patch)
2012-03-16 10:01 UTC, Joost
committed Details | Review

Description Owen Taylor 2011-05-25 20:29:31 UTC
If someone:

 - Moves the mouse to the right side of the screen
 - Hits the logo key

They shouldn't have to wait for two separate animations before seeing the workspaces.
Comment 1 Allan Day 2011-11-30 15:55:56 UTC
Or don't slide in the workspace switcher, perhaps?
Comment 2 Jeremy Newton 2012-01-10 01:01:41 UTC
@Allan Day
Agreed: if the mouse is already on the right side, I would agree that the work space switcher should not slide but just appear, along with the overview. Though it's not all that much to cry about on higher end systems, its also just a waste of power/resources.
Comment 3 Allan Day 2012-01-10 09:20:34 UTC
(In reply to comment #2)
> @Allan Day
> Agreed: if the mouse is already on the right side, I would agree that the work
> space switcher should not slide but just appear, along with the overview.
> Though it's not all that much to cry about on higher end systems, its also just
> a waste of power/resources.

I should have been more elaborate in my original comment. What I meant was that the switcher should remain in its retracted state if the pointer is at the right hand side of the screen when the overview is opened. To open the workspace switcher, you would have to move the pointer away from the right hand side and then back again.

The pointer being at the right hand side will often have nothing to do with the workspace switcher, and the switcher opening will be unintentional. It's confusing to have the switcher open when you don't intend it to.
Comment 4 Joost 2012-03-09 01:11:14 UTC
Created attachment 209293 [details] [review]
This should fix it.
Comment 5 Jasper St. Pierre (not reading bugmail) 2012-03-09 01:23:30 UTC
Review of attachment 209293 [details] [review]:

Thanks for working on this!

We try to add "useful" commit messages, see http://lists.cairographics.org/archives/cairo/2008-September/015092.html for more information on what that is. They also really shouldn't be more than around 74-75 characters. Try something like:

    overview: Don't show workspaces when entering the overview

    If the user has their mouse over the workspace thumbnails while
    entering the overview, it's more likely that it's a coincidence
    that their mouse pointer is in the area. Avoid expanding the
    thumbnails box in that case.

::: js/ui/overview.js
@@ +622,3 @@
         this.emit('showing');
+        
+        let [mouse_x, mouse_y, mouse_mods] = global.get_pointer();         

We try to use camelCase in JS, e.g. mouseX, mouseY. We're not entirely consistent, though.

@@ +631,3 @@
+        
+        if(mouse_x > ws_x && mouse_y > ws_y && mouse_y < ws_bottom) {
+            this._workspacesDisplay._skipHover = true;

We try not to access "private" properties of other objects.

::: js/ui/workspacesView.js
@@ +998,3 @@
     _onControlsHoverChanged: function() {
+        if(!this._controls.hover)
+            this._skipHover = false;

_skipHover was never initialized in _init. We try to initialize all variables that we use.
Comment 6 Joost 2012-03-10 09:03:00 UTC
Hey Jasper,

Thanks again for your review. I've fixed most of the issues you pointed out, however as I mentioned on irc, I haven't been able to do it without accessing workspacesview._control. Do you have any ideas about this? 

Regards Joost
Comment 7 Jasper St. Pierre (not reading bugmail) 2012-03-10 09:29:02 UTC
(In reply to comment #6)
> Hey Jasper,
> 
> Thanks again for your review. I've fixed most of the issues you pointed out,
> however as I mentioned on irc, I haven't been able to do it without accessing
> workspacesview._control. Do you have any ideas about this? 

Make it into a public property in a separate commit.
Comment 8 Joost 2012-03-11 23:09:07 UTC
Created attachment 209454 [details] [review]
workspacesView: Refactored the private workspacesDisplay._control to public workspacesDisplay.control, to allow outside accessing.

This is a patch refactoring the private workspacesDisplay._controls to be a public property.
Comment 9 Joost 2012-03-11 23:13:27 UTC
Created attachment 209456 [details] [review]
overview: Don't show workspaces when the overview is entered and the user has the pointer on the right-side of the screen. This usually doesn't mean the user wants to open the workspaces view.

overview: Don't show workspaces when the overview is entered
    and the user has the pointer on the right-side of the screen.
    This usually doesn't mean the user wants to open the workspaces 
    view, but probably just a coincidence.

This patch has to be applied in combination with the previously submitted patch to refactor workspacesDisplay._controls to workspacesDisplay.controls.
Comment 10 Jasper St. Pierre (not reading bugmail) 2012-03-11 23:24:57 UTC
Review of attachment 209454 [details] [review]:

> Author: Joost Verdoorn <joost@Monster.(none)>

You need to fix that.

Besides that, your commit message is a bit lacking. Let's try:

    workspacesView: Publicly expose _controls

    In order to properly prevent the thumbnails box from expanding while going
    to the overview, we first need to make it public.

Again, your first line should explain the basic mechanism of the changes, while the rest of the commit message should go into more detail and explain the motivation behind the changes. Additionally, we like to add bug URLs as the last line in the commit message so we know what bug the patch came from. The easiest way to do this is with git-bz.
Comment 11 Jasper St. Pierre (not reading bugmail) 2012-03-12 00:04:14 UTC
Review of attachment 209456 [details] [review]:

::: js/ui/overview.js
@@ +621,3 @@
         this._coverPane.show();
         this.emit('showing');
+        

Remove whitespace.

@@ +625,3 @@
+        let [wsX, wsY] = this._workspacesDisplay.controls.get_transformed_position();        
+        let [vsX, vsY] = this._viewSelector.actor.get_transformed_position();
+        let [vsW, vsH] = this._viewSelector.actor.get_transformed_size();        

Since you're checking the viewselector's position/size which includes everything, if you're in the correct horizontal position (like the search box), hit the windows key, and then move over the thumbnails box, it wouldn't expand until hover changed twice more, right?

@@ +626,3 @@
+        let [vsX, vsY] = this._viewSelector.actor.get_transformed_position();
+        let [vsW, vsH] = this._viewSelector.actor.get_transformed_size();        
+        

Remove whitespace.

@@ +627,3 @@
+        let [vsW, vsH] = this._viewSelector.actor.get_transformed_size();        
+        
+        if(mouseX > wsX && mouseY > wsY && mouseY < vsY + vsH)

This will break if the user had another monitor to the right and their cursor was in the right position on that monitor.

::: js/ui/workspacesView.js
@@ +508,3 @@
 
+        this.skipHover = false;        
+        

Remove whitespace.

@@ +1001,3 @@
+        if(!this.controls.hover)
+            this.skipHover = false;
+            

Remove whitespace.
Comment 12 Joost 2012-03-12 16:06:34 UTC
> @@ +625,3 @@
> +        let [wsX, wsY] =
> this._workspacesDisplay.controls.get_transformed_position();        
> +        let [vsX, vsY] = this._viewSelector.actor.get_transformed_position();
> +        let [vsW, vsH] = this._viewSelector.actor.get_transformed_size();      
> 
> Since you're checking the viewselector's position/size which includes
> everything, if you're in the correct horizontal position (like the search box),
> hit the windows key, and then move over the thumbnails box, it wouldn't expand
> until hover changed twice more, right?

No, that shouldn't happen. As you can see I use the viewselector's vertical position, which aligns perfectly with the workspacesView's vertical position.

> @@ +627,3 @@
> +        let [vsW, vsH] = this._viewSelector.actor.get_transformed_size();      
> +        
> +        if(mouseX > wsX && mouseY > wsY && mouseY < vsY + vsH)
> 
> This will break if the user had another monitor to the right and their cursor
> was in the right position on that monitor.

I've tested this, but I believe default behavior when the user is using more than one monitor is to always show the workspacesview.
Comment 13 Joost 2012-03-13 00:59:37 UTC
Created attachment 209554 [details] [review]
overview: Don't show workspaces when entering the overview

    If the user has their mouse over the workspace thumbnails while
    entering the overview, it's more likely that it's a coincidence
    that their mouse pointer is in the area. Avoid expanding the
    thumbnails box in that case.
Comment 14 Joost 2012-03-13 15:11:01 UTC
Created attachment 209612 [details] [review]
overview: Don't show workspaces when entering the overview

    If the user has their mouse over the workspace thumbnails while
    entering the overview, it's more likely that it's a coincidence
    that their mouse pointer is in the area. Avoid expanding the
    thumbnails box in that case.
Comment 15 Joost 2012-03-13 17:21:12 UTC
Created attachment 209629 [details] [review]
overview: Don't show workspaces when entering the overview

If the user has their mouse over the workspace thumbnails while
entering the overview, it's more likely that it's a coincidence
that their mouse pointer is in the area. Avoid expanding the
thumbnails box in that case.
Comment 16 Florian Müllner 2012-03-14 00:29:19 UTC
Review of attachment 209629 [details] [review]:

This is getting very close!

The comments below are mostly style comments. Apart from those, there's a fair share of trailing whitespace in the patch (apparently Linus really hates that, so by default git is very verbose about it). On a higher level, I don't think it is quite clear enough what's going on. The obvious option would be to add a comment, and maybe something like _controlsInitiallyHovered instead of _skipZoom makes the general idea clearer?

::: js/ui/workspacesView.js
@@ +549,3 @@
+            let [x, y] = this._controls.get_transformed_position();
+            let width = this._controls.get_theme_node().get_length('visible-width');
+            let height = this.actor.allocation.y2 - this.actor.allocation.y1;

Not sure why you use this.actor for the height and not this._controls - they match, but you really want to test that the controls are hovered.
I'd probably write that as

let visibleWidth = this._controls.get_theme_node().get_length('visible-width');
let [width, height] = this._controls.get_transformed_size();

@@ +552,3 @@
+            let rtl = (Clutter.get_default_text_direction () == Clutter.TextDirection.RTL);
+            if(rtl) {
+                let [fullWidth, _] = this._controls.get_transformed_size();

Eeeks, don't overwrite _ (which we use for gettext); if you want to make clear that you are not interested in one of the return values, you can use

let fullWidth = this._controls.get_transformed_size()[0];

But then I'd just use the height as well, see previous comment :)

@@ +555,3 @@
+                x = x + fullWidth - width;
+            } 
+            if(mouseX > x && mouseX < x + width && mouseY > y && mouseY < y + height) 

Not quite - we do want to include edge cases like mouseX == x. Note that the clutter position/size functions return floating point numbers, so it is probably safer to do checks like
  mouseX > x - 0.5 && mouseX < x + width + 0.5
(rather than using >=)
Comment 17 Joost 2012-03-16 10:01:32 UTC
Created attachment 209906 [details] [review]
overview: Don't show workspaces when entering the overview

If the user has their mouse over the workspace thumbnails while
entering the overview, it's more likely that it's a coincidence
that their mouse pointer is in the area. Avoid expanding the
thumbnails box in that case.
Comment 18 Joost 2012-03-16 10:02:35 UTC
Florian, thank you for you patch review. The above patch should fix all the issues you pointed out. :)
Comment 19 Florian Müllner 2012-03-16 14:35:26 UTC
Comment on attachment 209906 [details] [review]
overview: Don't show workspaces when entering the overview

Thanks again, let's get this committed!
Comment 20 Florian Müllner 2012-03-16 16:21:56 UTC
Attachment 209906 [details] pushed as 4f87e86 - overview: Don't show workspaces when entering the overview
Comment 21 Allan Day 2012-03-16 16:51:51 UTC
Awesome work Joost!
Comment 22 Allan Day 2015-10-12 17:09:10 UTC
Seems like this regressed - I can see the original behaviour in 3.18.
Comment 23 GNOME Infrastructure Team 2021-07-05 14:06:22 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of  gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/

Thank you for your understanding and your help.