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 694902 - Fix some really bad thumbnail layout cases
Fix some really bad thumbnail layout cases
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 694901 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-02-28 21:26 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2013-03-03 02:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
workspace: Remove some additional features used for GridLayoutStrategy (2.58 KB, patch)
2013-02-28 21:26 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
workspace: Remove unused variable (882 bytes, patch)
2013-02-28 21:26 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
workspace: Separate out per-window scaling as a separate variable (2.68 KB, patch)
2013-02-28 21:26 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
workspace: Write a giant wall of text describing the algorithm (4.18 KB, patch)
2013-02-28 21:26 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
workspace: Use the scaled width when calculating the total width (1017 bytes, patch)
2013-02-28 21:26 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
workspace: Fix bad window positions with small windows (2.57 KB, patch)
2013-02-28 21:26 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2013-02-28 21:26:07 UTC
Steps:
  1. Open two terminal windows, make sure they're fairly small
  2. Enter overview

Expected result:
  Windows are not centered

Actual result:
  Windows are centered
Comment 1 Jasper St. Pierre (not reading bugmail) 2013-02-28 21:26:10 UTC
Created attachment 237652 [details] [review]
workspace: Remove some additional features used for GridLayoutStrategy

While we won't tear down the entire strategy infrastructure, we want to
rework some layout code in the future, so just tear this piece out for
now.
Comment 2 Jasper St. Pierre (not reading bugmail) 2013-02-28 21:26:15 UTC
Created attachment 237653 [details] [review]
workspace: Remove unused variable

This typo seems to have been here since the very beginning;
no "state" variable appears anywhere.
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-02-28 21:26:18 UTC
Created attachment 237654 [details] [review]
workspace: Separate out per-window scaling as a separate variable

Multiplication is linear, so we can split this out as a separate
component. This will make it easier to think of it as an additional
per-window scaling factor, rather than tweaking the scale a bit,
which is more correct to the model.
Comment 4 Jasper St. Pierre (not reading bugmail) 2013-02-28 21:26:21 UTC
Created attachment 237655 [details] [review]
workspace: Write a giant wall of text describing the algorithm

I wrote this for me to find solutions to some problems we were having
with the current situation, so why not check it in?
Comment 5 Jasper St. Pierre (not reading bugmail) 2013-02-28 21:26:24 UTC
Created attachment 237656 [details] [review]
workspace: Use the scaled width when calculating the total width

This is a small inconsistency I found in the code after review.
Comment 6 Jasper St. Pierre (not reading bugmail) 2013-02-28 21:26:27 UTC
Created attachment 237657 [details] [review]
workspace: Fix bad window positions with small windows

This can happen if you open two or three terminal windows, and then
open the overview -- they're not centered. The issue is that because
of the WINDOW_CLONE_MAXIMUM_SCALE clamping, the scale that is being
laid out is different from the scale that the layout was calculated
for.

Implement and document a hack-ish solution which simply keeps the
scale for the layout as originally calculated, but centers the
windows inside the cell.
Comment 7 Jasper St. Pierre (not reading bugmail) 2013-02-28 21:29:09 UTC
*** Bug 694901 has been marked as a duplicate of this bug. ***
Comment 8 Cosimo Cecchi 2013-02-28 22:19:46 UTC
Review of attachment 237652 [details] [review]:

OK
Comment 9 Cosimo Cecchi 2013-02-28 22:19:52 UTC
Review of attachment 237653 [details] [review]:

Sure.
Comment 10 Cosimo Cecchi 2013-02-28 22:19:59 UTC
Review of attachment 237654 [details] [review]:

OK
Comment 11 Cosimo Cecchi 2013-02-28 22:20:06 UTC
Review of attachment 237655 [details] [review]:

Nice!

::: js/ui/workspace.js
@@ +613,3 @@
+// input area or the layout scale or rows or anything else, and right
+// now just enlarges the window if it's too small. This constant factor
+// until we've added too many windows to a row, and then make a new row,

Did you mean computed instead of complicated?
Comment 12 Cosimo Cecchi 2013-02-28 22:25:03 UTC
Review of attachment 237656 [details] [review]:

Looks OK
Comment 13 Cosimo Cecchi 2013-02-28 22:25:14 UTC
Review of attachment 237657 [details] [review]:

::: js/ui/workspace.js
@@ +776,3 @@
                 s = Math.min(s, WINDOW_CLONE_MAXIMUM_SCALE);
+                let cloneWidth = window.actor.width * s;
+                let cloneHeight = window.actor.height * s;

You don't seem to use cloneHeight, nor center the offset vertically...doesn't that contradict the above comment?
Comment 14 Jasper St. Pierre (not reading bugmail) 2013-02-28 22:30:21 UTC
Review of attachment 237657 [details] [review]:

::: js/ui/workspace.js
@@ +776,3 @@
                 s = Math.min(s, WINDOW_CLONE_MAXIMUM_SCALE);
+                let cloneWidth = window.actor.width * s;
+                let cloneHeight = window.actor.height * s;

The offset isn't centered vertically -- to align it with the rest of the thumbnails, we vertically align it to the bottom of the row. cloneHeight is indeed unused.
Comment 15 Jasper St. Pierre (not reading bugmail) 2013-02-28 23:15:53 UTC
Attachment 237652 [details] pushed as d58b715 - workspace: Remove some additional features used for GridLayoutStrategy
Attachment 237653 [details] pushed as 6e15e2d - workspace: Remove unused variable
Attachment 237654 [details] pushed as 1a33de9 - workspace: Separate out per-window scaling as a separate variable
Attachment 237655 [details] pushed as e1ef14d - workspace: Write a giant wall of text describing the algorithm
Attachment 237656 [details] pushed as b24a10a - workspace: Use the scaled width when calculating the total width
Attachment 237657 [details] pushed as 083c37a - workspace: Fix bad window positions with small windows


Pushed with a clearer comment and suggested changes.