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 610049 - workspaceswitcher popup should have same proportions as actual screen
workspaceswitcher popup should have same proportions as actual screen
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: 2010-02-15 23:15 UTC by maxx
Modified: 2010-02-22 19:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make the workspace switcher use a scaled representation of the actual screen (1.56 KB, patch)
2010-02-15 23:15 UTC, maxx
needs-work Details | Review
Make the width of the workspace switcher popup dynamic in order to make it have the same proportions as the actual screen. (1.99 KB, patch)
2010-02-16 21:43 UTC, maxx
reviewed Details | Review
Make width of workspace switcher popup dynamic (2.03 KB, patch)
2010-02-16 22:31 UTC, maxx
needs-work Details | Review
Make width of workspace switcher popup dynamic (2.64 KB, patch)
2010-02-17 22:50 UTC, maxx
none Details | Review
Make width of workspace switcher popup dynamic (2.37 KB, patch)
2010-02-18 19:26 UTC, maxx
committed Details | Review

Description maxx 2010-02-15 23:15:19 UTC
Created attachment 153879 [details] [review]
Make the workspace switcher use a scaled representation of the actual screen

When changing desktops the workspaceswitcher popup should use the actual screen proportions for its small representations of desktops.

Attached patch tries to solve that issue while also making the popup a fixed scale of the actual screen so that it will behave sensibly on both low and high resolution screens.
Comment 1 drago01 2010-02-16 16:20:04 UTC
This makes sense to me, we need input from the designers though.
Comment 2 drago01 2010-02-16 16:25:18 UTC
Review of attachment 153879 [details] [review]:

+        this._indicatorWidth = Math.round(global.screen_width * INDICATOR_SCALE);
+        this._indicatorHeight = Math.round(global.screen_height * INDICATOR_SCALE);

Would make sense to have the width/height ratio the same as the current screen,
but changing the size depending on the screen resolution breaks the idea of having it using the same layout / position as the alt-tab switcher.

So keep the height fixed and just adjust the width. 

+           
+           indicator.set_style("width: " + this._indicatorWidth + "px;" + 
+                               "height: " + this._indicatorHeight + "px;");

I'd just use set_width instead.

+               spacer.set_style("height: " + this._indicatorHeight + "px;");

This seems unnecessary, even if we want to change the height, the height of the spacer shouldn't really matter.
Comment 3 drago01 2010-02-16 16:28:52 UTC
(In reply to comment #2)
> Review of attachment 153879 [details] [review]:
> 
> +        this._indicatorWidth = Math.round(global.screen_width *
> INDICATOR_SCALE);
> +        this._indicatorHeight = Math.round(global.screen_height *
> INDICATOR_SCALE);
> 
> Would make sense to have the width/height ratio the same as the current screen,
> but changing the size depending on the screen resolution breaks the idea of
> having it using the same layout / position as the alt-tab switcher.
> 
> So keep the height fixed and just adjust the width. 
> 
> +           
> +           indicator.set_style("width: " + this._indicatorWidth + "px;" + 
> +                               "height: " + this._indicatorHeight + "px;");
> 
> I'd just use set_width instead.
> 
> +               spacer.set_style("height: " + this._indicatorHeight + "px;");
> 
> This seems unnecessary, even if we want to change the height, the height of the
> spacer shouldn't really matter.

One more note: commit message is missing, just commit it locally and use git format-patch or git-bz to get a patch with the commit message included.
Comment 4 maxx 2010-02-16 21:43:41 UTC
Created attachment 153967 [details] [review]
Make the width of the workspace switcher popup dynamic in order to make it have the same proportions as the actual screen.

This time only the width of each switcher box is adjusted.

I have also removed the hard-coded widths from the css as they are longer needed.
Comment 5 drago01 2010-02-16 21:54:58 UTC
Review of attachment 153967 [details] [review]:

The subject line is way to long; use a shorter subject line and put the detailed description in the body of the message.

Besides that it looks good.

Design input still needed.

::: js/ui/workspaceSwitcherPopup.js
@@ +28,3 @@
         global.stage.add_actor(this.actor);
 
+        this._scaleWidth = global.screen_width / global.screen_height

Missing ; at the end (should be causing a warning)
Comment 6 maxx 2010-02-16 22:31:02 UTC
Created attachment 153972 [details] [review]
Make width of workspace switcher popup dynamic

Sorry. This is my first time actually using git.

I have fixed the missing semi-colon (couldn't find out where the warning went, though) and rebased the patch.
Comment 7 drago01 2010-02-16 22:33:51 UTC
Review of attachment 153972 [details] [review]:

Looks good, thanks.
Comment 8 drago01 2010-02-16 22:34:44 UTC
(In reply to comment #6)

> Sorry. This is my first time actually using git.

I just was telling you how to do it not "your an idiot and doing it wrong" ;)
Comment 9 Dan Winship 2010-02-17 16:17:53 UTC
Comment on attachment 153972 [details] [review]
Make width of workspace switcher popup dynamic

this produces lots of:

(mutter:25077): St-WARNING **: st_widget_get_theme_node called on a widget not in a stage

because you're doing:

>+           indicator.set_width(Math.round(indicator.get_height() * this._scaleWidth));

and in order to figure out how tall the indicator is, it needs to know what CSS rules are going to be applied to it, but it can only figure that out after adding it to the stage.

So you either need to:

    a) redo it to not need to call get_height()
    b) change it to to all the width/height adjustments during the size
       allocation rather than ahead of time
    c) change the code so that the switcher has already been added to the
       stage (but hidden) at that point
Comment 10 maxx 2010-02-17 22:50:52 UTC
Created attachment 154089 [details] [review]
Make width of workspace switcher popup dynamic

I have tried using the style-changed signal to calculate the new size. It works and the warning is gone, but I am not entirely sure that style-changed is an elegant way of doing this. Comments?
Comment 11 maxx 2010-02-17 23:56:44 UTC
Just ignore the attempt to use style-changed - it messes up the initial placement of the workspace switcher. Sorry for the noise.
Comment 12 maxx 2010-02-18 19:26:50 UTC
Created attachment 154163 [details] [review]
Make width of workspace switcher popup dynamic

This patch should not give any warnings or strange visual effects - at least it doesn't on my system.

I moved the call to redraw down after the call to add, and that appears to have fixed the warning.
Comment 13 Dan Winship 2010-02-22 19:13:30 UTC
Comment on attachment 154163 [details] [review]
Make width of workspace switcher popup dynamic

ok
Comment 14 drago01 2010-02-22 19:31:21 UTC
Comment on attachment 154163 [details] [review]
Make width of workspace switcher popup dynamic

Pushed as b8a9eec.