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 708009 - Cut off window thumbnails after changing monitor position
Cut off window thumbnails after changing monitor position
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2013-09-13 07:57 UTC by Florian Müllner
Modified: 2013-09-13 11:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
overviewControls: Update workspaces geometry on monitor changes (1.57 KB, patch)
2013-09-13 07:57 UTC, Florian Müllner
none Details | Review
overviewControls: Update workspaces geometry on monitor changes (1.37 KB, patch)
2013-09-13 11:08 UTC, Florian Müllner
none Details | Review
overviewControls: Use a custom layout to catch all geometry changes (2.55 KB, patch)
2013-09-13 11:40 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2013-09-13 07:57:22 UTC
See patch. Reported downstream at https://bugzilla.redhat.com/show_bug.cgi?id=1006900.
Comment 1 Florian Müllner 2013-09-13 07:57:25 UTC
Created attachment 254838 [details] [review]
overviewControls: Update workspaces geometry on monitor changes

We currently update workspaces geometry on allocation changes of
the overview group; however as the geometry is based on stage
coordinates, it can change without an allocation change as well
when the primary monitor's position changes but not its resolution.
Comment 2 Giovanni Campagna 2013-09-13 08:36:03 UTC
(In reply to comment #1)
> Created an attachment (id=254838) [details] [review]
> overviewControls: Update workspaces geometry on monitor changes
> 
> We currently update workspaces geometry on allocation changes of
> the overview group; however as the geometry is based on stage
> coordinates, it can change without an allocation change as well
> when the primary monitor's position changes but not its resolution.

Mh? If the primary monitor moves, then the overview moves, which triggers a new allocation.
Comment 3 Florian Müllner 2013-09-13 10:52:57 UTC
(In reply to comment #2)
> Mh? If the primary monitor moves, then the overview moves, which triggers a new
> allocation.

Yes, the overview does move. But none of the OverviewControl's actors move relative to their parent, so we are hitting a Clutter optimization[0].
I guess we can track Main.layoutManager.overviewGroup instead and hope no one changes the hierarchy again without updating this (or just use global.stage).

[0] https://git.gnome.org/browse/clutter/tree/clutter/clutter-actor.c#n2268
Comment 4 Florian Müllner 2013-09-13 11:08:24 UTC
Created attachment 254849 [details] [review]
overviewControls: Update workspaces geometry on monitor changes

For what it's worth, here's one of the alternatives ...
Comment 5 Giovanni Campagna 2013-09-13 11:15:06 UTC
Uhm, but that's because we're using notify::allocation instead of overriding the vfunc properly. I think we should use a custom actor that calls the appropriate update function.
Comment 6 Florian Müllner 2013-09-13 11:21:47 UTC
So you are suggesting to reimplement either ClutterBoxLayout or ClutterBinLayout? Why that overkill?
Comment 7 Giovanni Campagna 2013-09-13 11:29:45 UTC
(In reply to comment #6)
> So you are suggesting to reimplement either ClutterBoxLayout or
> ClutterBinLayout? Why that overkill?

You don't need that, you can call the layout manager from the allocate vfunc.
Comment 8 Florian Müllner 2013-09-13 11:40:50 UTC
Created attachment 254851 [details] [review]
overviewControls: Use a custom layout to catch all geometry changes

We currently update workspaces geometry when we are notified about
allocation changes of the overview group; however as the geometry
is based on stage coordinates, we miss notifications when the
allocation relative to the parent is unchanged, which happens when
the primary monitor's position changes but not its resolution.
Use a custom layout manager to give us a signal that is emitted
reliably.


Still feels like overkill to me, but here you are ...
Comment 9 Giovanni Campagna 2013-09-13 11:44:54 UTC
Review of attachment 254851 [details] [review]:

I think this way is more robust, and we don't need workarounds.

::: js/ui/overviewControls.js
@@ +517,3 @@
+    vfunc_allocate: function(container, box, flags) {
+        this.parent(container, box, flags);
+        this.emit('allocation-changed');

I was thinking more of calling the updateGeometry function directly, but yeah, this works too.
Comment 10 Florian Müllner 2013-09-13 11:50:46 UTC
Attachment 254851 [details] pushed as df09109 - overviewControls: Use a custom layout to catch all geometry changes