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 603078 - wrong sizing of 'all workspace' windows in overview
wrong sizing of 'all workspace' windows in overview
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: 2009-11-26 19:57 UTC by Raphael Freudiger
Modified: 2010-02-19 18:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wrong sizing of 'all workspace' windows (408.53 KB, image/png)
2009-11-26 19:57 UTC, Raphael Freudiger
  Details
work correct with 'all workspace' windows in overview (8.96 KB, patch)
2010-01-26 04:35 UTC, Maxim Ermilov
needs-work Details | Review
fix sizing of all-workspace windows in the overview (6.66 KB, patch)
2010-01-27 00:41 UTC, Maxim Ermilov
none Details | Review
fix selection of all-workspace windows (3.10 KB, patch)
2010-01-27 00:42 UTC, Maxim Ermilov
none Details | Review
fix sizing of all-workspace windows in the overview (6.34 KB, patch)
2010-02-19 16:51 UTC, Maxim Ermilov
committed Details | Review
fix selection of all-workspace windows (1.69 KB, patch)
2010-02-19 16:52 UTC, Maxim Ermilov
committed Details | Review

Description Raphael Freudiger 2009-11-26 19:57:13 UTC
Created attachment 148548 [details]
wrong sizing  of 'all workspace' windows

1) open to workspaces
2) open two windows on the first workspace
3) enable visible on all workspace for one of the two windows
4) go to overview mode

result: the 'all workspace' window on the first workspace has wrong size. It looks like it has the same size as on the second workspace.
Comment 1 Maxim Ermilov 2010-01-26 04:35:39 UTC
Created attachment 152286 [details] [review]
work correct with 'all workspace' windows in overview
Comment 2 Dan Winship 2010-01-26 16:14:43 UTC
Comment on attachment 152286 [details] [review]
work correct with 'all workspace' windows in overview

This patch seems to do at least two things (fix sizing of all-workspace windows in the overview, and fix selection of all-workspace windows), and maybe a third (see below), and so ought to be split into separate patches.

>     let windowWorkspaceNum = window.get_workspace().index();
> 
>+    if (workspaceNum !== undefined)
>+        windowWorkspaceNum = workspaceNum;

we generally haven't used "!== undefined" as an idiom. Also there's no need for a duplicate assignment here. I'd say:

    let windowWorkspaceNum = workspaceNum ? workspaceNum : window.get_workspace().index();

>@@ -346,11 +346,15 @@ MosaicView.prototype = {
>             lostWorkspaces = this._workspaces.splice(newNumWorkspaces);
>         }
> 
>-        // The new last workspace may be removable
>-        let newLastWorkspace = this._workspaces[this._workspaces.length - 1];
>-
>         // Figure out the new layout
>         this._positionWorkspaces();
>+
>+        if (newNumWorkspaces > oldNumWorkspaces) {
>+            for (let w = oldNumWorkspaces; w < newNumWorkspaces; w++) {
>+                this._workspaces[w].positionWindows(0);
>+            }
>+        }
>+
>         let newScale = this._workspaces[0].scale;
>         let newGridWidth = Math.ceil(Math.sqrt(newNumWorkspaces));
>         let newGridHeight = Math.ceil(newNumWorkspaces / newGridWidth);

what does this do? (This is the part I thought might be a 3rd bugfix.)
Comment 3 Maxim Ermilov 2010-01-27 00:41:26 UTC
Created attachment 152370 [details] [review]
fix sizing of all-workspace windows in the overview

> let windowWorkspaceNum = workspaceNum ? workspaceNum : window.get_workspace().index();
Will not work (workspaceNum can be 0).
We can use (workspaceNum || workspaceNum === 0). But it more complex(and unclear), then !== undefined.

> what does this do? (This is the part I thought might be a 3rd bugfix.)

New workspaces can contain windows and we need position them.
Comment 4 Maxim Ermilov 2010-01-27 00:42:06 UTC
Created attachment 152371 [details] [review]
fix selection of all-workspace windows
Comment 5 Maxim Ermilov 2010-02-19 16:51:56 UTC
Created attachment 154222 [details] [review]
fix sizing of all-workspace windows in the overview

merge with HEAD
Comment 6 Maxim Ermilov 2010-02-19 16:52:43 UTC
Created attachment 154223 [details] [review]
fix selection of all-workspace windows

merge with HEAD
Comment 7 Dan Winship 2010-02-19 18:09:21 UTC
Comment on attachment 154222 [details] [review]
fix sizing of all-workspace windows in the overview

looks good except:

>+            // New workspaces can containt windows.
>+            for (let w = oldNumWorkspaces; w < newNumWorkspaces; w++) {
>+                this._workspaces[w].positionWindows(0);
>+            }
>             // Slide new workspaces in from offscreen
>             for (let w = oldNumWorkspaces; w < newNumWorkspaces; w++)
>                 this._workspaces[w].slideIn(oldScale);

typo ("containt"), and also, those two loops can be merged together

also, this is in the code for the grid view. Shouldn't a "positionWindows()" call be needed in the linear view case too?

(If it's not needed there for some reason, then go ahead and commit, with just the fix above.)