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 690313 - Overview window arrangement is not optimal
Overview window arrangement is not optimal
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2012-12-16 22:19 UTC by Giovanni Campagna
Modified: 2013-02-18 11:02 UTC
See Also:
GNOME target: 3.8
GNOME version: ---


Attachments
Screencast showing the suboptimal layout (487.19 KB, video/webm)
2012-12-16 22:20 UTC, Giovanni Campagna
  Details
overview: Sort windows by x coordinate (991 bytes, patch)
2012-12-25 13:04 UTC, drago01
none Details | Review
overview: Sort windows by travel distance within rows (2.94 KB, patch)
2013-02-17 11:16 UTC, drago01
none Details | Review
overview: Sort windows by travel distance within rows (2.51 KB, patch)
2013-02-17 11:18 UTC, drago01
committed Details | Review

Description Giovanni Campagna 2012-12-16 22:19:58 UTC
Look at the attached screencast. There is one right tiled Emacs, and one maximized Terminal.
Yet, my emacs ends on the left of the terminal, meaning that it travels all the screen horizontally when I open the overview. And it looks weird.
Comment 1 Giovanni Campagna 2012-12-16 22:20:49 UTC
Created attachment 231678 [details]
Screencast showing the suboptimal layout
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-12-16 22:23:48 UTC
Right now windows are sorted by serial. Adding a sort by distance would complicate matters, but feel free to try.
Comment 3 Giovanni Campagna 2012-12-16 22:30:27 UTC
Oh really?
That's not how it used to be before the refactoring...
Comment 4 Jasper St. Pierre (not reading bugmail) 2012-12-16 22:59:49 UTC
Yes, that functionality was removed during overview relayout. Before, we had a set of predetermined slots, so it was only factorial combinations.

I suppose you could try to have a hint to the strategy about positions, so it would favor a LEFT, CENTER or RIGHT-influenced window based on where it is on the screen
Comment 5 Allan Day 2012-12-17 10:00:58 UTC
I've also noticed this bug since the window thumbnails were redone. It is mostly noticeable when you have two windows open and they switch positions for the overview, and is at its worst when you have two half-maximised windows.

Considering the latter, it would be good to present half-screen snapped windows as a single thumbnail - which would solve that particular instance of this bug.
Comment 6 Jasper St. Pierre (not reading bugmail) 2012-12-17 10:09:49 UTC
(In reply to comment #5)
> I've also noticed this bug since the window thumbnails were redone. It is
> mostly noticeable when you have two windows open and they switch positions for
> the overview, and is at its worst when you have two half-maximised windows.
> 
> Considering the latter, it would be good to present half-screen snapped windows
> as a single thumbnail - which would solve that particular instance of this bug.

What do we do if you have two windows snapped to the right, and one snapped to the left?
Comment 7 drago01 2012-12-25 13:04:15 UTC
Created attachment 232213 [details] [review]
overview: Sort windows by x coordinate

Use the x coordinate instead of the stable sequence so that the
ordering / moving feels more natural.

-----

This is a very simple patch, but the results look much better then just using
the stable_sequence ... and seems to fix the half maximized window issue as
well.

I didn't really read the surounding code so I might be missing something but
given that the sequence was kind of arbitary and this seems to be better
in testing ...
Comment 8 Allan Day 2013-01-16 10:17:58 UTC
(In reply to comment #6)
> > Considering the latter, it would be good to present half-screen snapped windows
> > as a single thumbnail - which would solve that particular instance of this bug.
> 
> What do we do if you have two windows snapped to the right, and one snapped to
> the left?

The idea would be that the first two windows that are visible and half-screen snapped would be counted as a single unit. Subsequent half-screen snapped windows would not be "joined" on. To remove a window from the joined unit, you would un-snap them.
Comment 9 Allan Day 2013-01-16 10:19:32 UTC
It should be said that, due to the complexities to the approach I've described, a simpler solution would certainly make sense. The patch in comment 7 sounds promising.
Comment 10 Alexander Larsson 2013-01-25 15:27:43 UTC
Or you could just pick a layout as right now, but then after layout sort each row so that its in the order that minimizes the total distance traveled during the animation.
Comment 11 drago01 2013-02-17 11:16:49 UTC
Created attachment 236442 [details] [review]
overview: Sort windows by travel distance within rows

Sort windows inside the rows by there travel distance.


OK here is a new try at improving this.
Comment 12 drago01 2013-02-17 11:18:41 UTC
Created attachment 236443 [details] [review]
overview: Sort windows by travel distance within rows

Sort windows inside the rows by there travel distance.


Removed useless whitespace.
Comment 13 Jasper St. Pierre (not reading bugmail) 2013-02-18 09:41:24 UTC
Review of attachment 236443 [details] [review]:

Second half of the patch seems unrelated? Seems like a good cleanup, but unrelated...
Comment 14 drago01 2013-02-18 10:50:39 UTC
(In reply to comment #13)
> Review of attachment 236443 [details] [review]:
> 
> Second half of the patch seems unrelated? Seems like a good cleanup, but
> unrelated...

Not really the windows are assigned to the slots when creating the slots "slots.push([x, y, s, window]);" so we have to iterate over the slots and not the clones when placing them. Otherwise we would still place the windows based on the stable sequence.
Comment 15 Jasper St. Pierre (not reading bugmail) 2013-02-18 10:57:14 UTC
Review of attachment 236443 [details] [review]:

Ah, OK.
Comment 16 drago01 2013-02-18 11:02:49 UTC
Attachment 236443 [details] pushed as 9936f97 - overview: Sort windows by travel distance within rows