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 690608 - Fixes for BoxPointer
Fixes for BoxPointer
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: 2012-12-21 14:21 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2012-12-21 17:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
boxpointer: Clean up reposition (2.09 KB, patch)
2012-12-21 14:21 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
boxpointer: Update flip on setPosition as well as allocate (2.52 KB, patch)
2012-12-21 14:21 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
boxpointer: Rework how flipping works (4.14 KB, patch)
2012-12-21 14:21 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
boxpointer: Don't use the box allocation when calculating the arrow side (2.53 KB, patch)
2012-12-21 14:21 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
boxpointer: Defer re-allocation after a flip (1.09 KB, patch)
2012-12-21 14:21 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
boxpointer: Rework how flipping works (4.07 KB, patch)
2012-12-21 15:40 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2012-12-21 14:21:19 UTC
Found this while trying to make a wallpaper context menu.
Not entirely tested with input sources; tested with PopupMenu.
Comment 1 Jasper St. Pierre (not reading bugmail) 2012-12-21 14:21:21 UTC
Created attachment 232052 [details] [review]
boxpointer: Clean up reposition

Given that it's modifying state, there's no reason it can't be
using it instead. This makes it easier to use, so we aren't passing
in a bunch of instance variables every time.
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-12-21 14:21:24 UTC
Created attachment 232053 [details] [review]
boxpointer: Update flip on setPosition as well as allocate

This is needed for popup menus like ShellEntry and the soon-to-be-introduced
BackgroundMenu to flip automatically correctly.
Comment 3 Jasper St. Pierre (not reading bugmail) 2012-12-21 14:21:27 UTC
Created attachment 232054 [details] [review]
boxpointer: Rework how flipping works

Make sure we re-allocate after we flip sides, to ensure that
padding around the child actor is updated correctly.
Comment 4 Jasper St. Pierre (not reading bugmail) 2012-12-21 14:21:30 UTC
Created attachment 232055 [details] [review]
boxpointer: Don't use the box allocation when calculating the arrow side

Depending on the current state of arrowSide, the box allocation may be
wrong; e.g. if the user requested a TOP, but we flipped to a BOTTOM, the
next request would look to the y2 value of the flipped BOTTOM, which is
wrong.

Instead, use the origin, plus the calculated preferred size of the box.
Comment 5 Jasper St. Pierre (not reading bugmail) 2012-12-21 14:21:33 UTC
Created attachment 232056 [details] [review]
boxpointer: Defer re-allocation after a flip

As we may be flipping the box pointer in response to re-allocation,
like the addition of a new actor to the boxpointer, we can't queue
a re-layout while in a re-layout, so defer.
Comment 6 Rui Matos 2012-12-21 14:56:31 UTC
Review of attachment 232052 [details] [review]:

sure
Comment 7 Rui Matos 2012-12-21 15:34:27 UTC
Review of attachment 232056 [details] [review]:

Ok
Comment 8 Rui Matos 2012-12-21 15:34:36 UTC
Review of attachment 232055 [details] [review]:

Looks good.
Comment 9 Rui Matos 2012-12-21 15:34:51 UTC
Review of attachment 232054 [details] [review]:

::: js/ui/boxpointer.js
@@ -524,3 @@
         this._yPosition = Math.floor(y);
         this._shiftActor();
-        this._updateFlip();

This got added here on the previous patch and is removed now - correctly, I think, so I'd squash these two patches.
Comment 10 Rui Matos 2012-12-21 15:35:01 UTC
Review of attachment 232053 [details] [review]:

::: js/ui/boxpointer.js
@@ +524,3 @@
         this._yPosition = Math.floor(y);
         this._shiftActor();
+        this._updateFlip();

Potentially an endless loop here.

@@ +597,3 @@
+                break;
+            }
+            this._reposition(this._sourceActor, this._arrowAlignment);

Arguments - something funny with the patch ordering?
Comment 11 Jasper St. Pierre (not reading bugmail) 2012-12-21 15:40:04 UTC
Created attachment 232065 [details] [review]
boxpointer: Rework how flipping works

Make sure we re-allocate after we flip sides, to ensure that
padding around the child actor is updated correctly. Additionally,
ensure that we flip after we setPosition, as we won't get re-allocated
auotmatically by just changing the position.



Merge the two? Something like this?
Comment 12 Rui Matos 2012-12-21 16:57:47 UTC
Review of attachment 232065 [details] [review]:

Yes.
Comment 13 Jasper St. Pierre (not reading bugmail) 2012-12-21 17:25:19 UTC
Attachment 232052 [details] pushed as b14b3ab - boxpointer: Clean up reposition
Attachment 232055 [details] pushed as d6cace3 - boxpointer: Don't use the box allocation when calculating the arrow side
Attachment 232056 [details] pushed as 43876a9 - boxpointer: Defer re-allocation after a flip
Attachment 232065 [details] pushed as 2388de4 - boxpointer: Rework how flipping works