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 692997 - Take _NET_WM_ICON_GEOMETRY into account when minimizing
Take _NET_WM_ICON_GEOMETRY into account when minimizing
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-02-01 11:31 UTC by Florian Müllner
Modified: 2013-02-01 16:41 UTC
See Also:
GNOME target: 3.8
GNOME version: ---


Attachments
window: Fix get_icon_geometry() annotation (1.16 KB, patch)
2013-02-01 11:31 UTC, Florian Müllner
committed Details | Review
window: Cache _NET_WM_ICON_GEOMETRY (5.18 KB, patch)
2013-02-01 11:31 UTC, Florian Müllner
committed Details | Review
window: Add set_icon_geometry() method (3.38 KB, patch)
2013-02-01 11:31 UTC, Florian Müllner
committed Details | Review
windowManager: Respect icon geometry when minimizing (1.88 KB, patch)
2013-02-01 11:31 UTC, Florian Müllner
reviewed Details | Review
windowManager: Respect icon geometry when minimizing (2.31 KB, patch)
2013-02-01 14:22 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2013-02-01 11:31:10 UTC
This has been a "potential TODO" for ages, but now we actually want this for the (classic mode) window-list extension ...
Comment 1 Florian Müllner 2013-02-01 11:31:17 UTC
Created attachment 234964 [details] [review]
window: Fix get_icon_geometry() annotation

gjs has had support for (out) parameters for quite some time now ...
Comment 2 Florian Müllner 2013-02-01 11:31:26 UTC
Created attachment 234965 [details] [review]
window: Cache _NET_WM_ICON_GEOMETRY

Rather than doing a servcer round trip each time when retrieving the
icon geometry, use the existing property mechanism to cache it.
Comment 3 Florian Müllner 2013-02-01 11:31:33 UTC
Created attachment 234966 [details] [review]
window: Add set_icon_geometry() method

Using a public method for setting the (cached) icon geometry rather
than accessing the struct members directly allows setting the icon
geometry from extensions.
Comment 4 Florian Müllner 2013-02-01 11:31:49 UTC
Created attachment 234967 [details] [review]
windowManager: Respect icon geometry when minimizing

When using a dock or window-list with the shell, it makes sense for
us to minimize to the location requested rather than the activities
button.
Comment 5 Rui Matos 2013-02-01 14:04:50 UTC
Review of attachment 234964 [details] [review]:

indeed
Comment 6 Rui Matos 2013-02-01 14:07:04 UTC
Review of attachment 234965 [details] [review]:

Looks fine. "servcer" typo in the commit message
Comment 7 Rui Matos 2013-02-01 14:07:51 UTC
Review of attachment 234966 [details] [review]:

Yup. Not only from extensions even.
Comment 8 Florian Müllner 2013-02-01 14:12:53 UTC
(In reply to comment #7)
> Yup. Not only from extensions even.

Mmmh, you think we'll end up using it in core? Anything else needs to go the XChangeProperty route ...
Comment 9 Rui Matos 2013-02-01 14:14:07 UTC
Review of attachment 234967 [details] [review]:

Do we want to make it scale to the icon width/height instead of 0x0?
Comment 10 Rui Matos 2013-02-01 14:18:53 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > Yup. Not only from extensions even.
> 
> Mmmh, you think we'll end up using it in core? Anything else needs to go the
> XChangeProperty route ...

Which core? I'm just saying that this makes the method generally accessible from instrospection.
Comment 11 Florian Müllner 2013-02-01 14:22:46 UTC
Created attachment 234982 [details] [review]
windowManager: Respect icon geometry when minimizing

(In reply to comment #9)
> Do we want to make it scale to the icon width/height instead of 0x0?

Oh, that makes sense to me
Comment 12 Florian Müllner 2013-02-01 14:24:53 UTC
(In reply to comment #10)
> Which core?

Oh sorry, I use "core" to refer to gnome-shell (without extensions) ...
Comment 13 Rui Matos 2013-02-01 14:54:38 UTC
Review of attachment 234982 [details] [review]:

::: js/ui/windowManager.js
@@ +244,2 @@
         actor.set_scale(1.0, 1.0);
         actor.move_anchor_point_from_gravity(Clutter.Gravity.CENTER);

Not sure why we had this here but it is messing with the math below. Removing it makes the positioning accurate and doesn't seem to have any bad side-effects. (besides, it's using deprecated clutter API)
Comment 14 Florian Müllner 2013-02-01 16:24:40 UTC
(In reply to comment #13)
> Review of attachment 234982 [details] [review]:
> 
actor.move_anchor_point_from_gravity(Clutter.Gravity.CENTER);
> 
> Not sure why we had this here but it is messing with the math below.

I'll try look into it, but off-hand the animation looks more correct to me with the patch in its current form (at least when ignoring that the window-list should probably use a different geometry)
Comment 15 Rui Matos 2013-02-01 16:32:18 UTC
Review of attachment 234982 [details] [review]:

Seems to me that the animation doesn't really end at the retrieved x,y but instead at x+width/2,y+height/2 . But if it looks good, go for it.
Comment 16 Florian Müllner 2013-02-01 16:36:44 UTC
Comment on attachment 234982 [details] [review]
windowManager: Respect icon geometry when minimizing

Nevermind, I'm doing something inexplicably weird in the window-list ...
Comment 17 Florian Müllner 2013-02-01 16:39:52 UTC
Attachment 234964 [details] pushed as c388ccf - window: Fix get_icon_geometry() annotation
Attachment 234965 [details] pushed as 30bdadb - window: Cache _NET_WM_ICON_GEOMETRY
Attachment 234966 [details] pushed as 4d9d66d - window: Add set_icon_geometry() method
Comment 18 Florian Müllner 2013-02-01 16:41:40 UTC
Attachment 234982 [details] pushed as 89a49ce - windowManager: Respect icon geometry when minimizing

Pushed with the call to move_anchor_point removed as originally suggested, sorry for the confusion ...