Page MenuHomePhabricator

ctxpopup doesn't report accurate size with evas_object_geometry_get()
Closed, WontfixPublic

Description

It appears that this widget calls ELM_CTXPOPUP_EVENT_GEOMETRY_UPDATE, and then the user is supposed to manually update the geometry using the passed event info? There's no documentation about this so I can only speculate, but it's impossible to acquire the size of the ctxpopup outside of this function.

This is unintuitive and different from every other widget, it should probably be corrected.

zmike created this task.Oct 2 2016, 6:25 AM
zmike triaged this task as High priority.Oct 2 2016, 6:31 AM

Update: attempting to manually resize the ctxpopup using the event info geometry breaks the entire widget, so it's actually impossible to retrieve the size of a ctxpopup outside of this callback using efl functions.

Marking as high since this is a pretty serious usability issue in a commonly-used widget.

jpeg claimed this task.Oct 13 2016, 1:27 AM

I'll have a look at this.

jpeg added a comment.Oct 25 2016, 11:04 PM

Here's my understanding:

  1. we can easily override geometry_get and return the edje size,
  2. we don't want to let users set the geometry of the object, as this is a widget that sizes itself based on its contents.

So I'm not sure what you intent was in this comment:

Update: attempting to manually resize the ctxpopup using the event info geometry breaks the entire widget, so it's actually impossible to retrieve the size of a ctxpopup outside of this callback using efl functions.

jpeg removed jpeg as the assignee of this task.Oct 25 2016, 11:15 PM

The patch to override geometry_get is absolutely trivial, but it comes with a problem: evas_object_move() is used to position the ctxpopup point of origin, but then evas_object_geometry_get() would return something entirely different.
So, really, I'm not sure what to do here?

shouldnt it be possible to just get the main content of the ctxpopup and fetch the geometry of that part?

zmike added a comment.Oct 26 2016, 7:25 AM
In T4687#73719, @jpeg wrote:

The patch to override geometry_get is absolutely trivial, but it comes with a problem: evas_object_move() is used to position the ctxpopup point of origin, but then evas_object_geometry_get() would return something entirely different.
So, really, I'm not sure what to do here?

I am confused by this; I just want to get the geometry of the ctxpopup on the canvas. I don't care where I have tried to position it, I only care about the object's visible geometry.

jpeg added a comment.Nov 7 2016, 9:05 PM

(sorry for the delay)

shouldnt it be possible to just get the main content of the ctxpopup and fetch the geometry of that part?

I don't think this is the geometry mike is interested in.

In T4687#73746, @zmike wrote:

I am confused by this; I just want to get the geometry of the ctxpopup on the canvas. I don't care where I have tried to position it, I only care about the object's visible geometry.

What is the geometry? Test ctxpopup in elm_test and you'll see the bg covering the entire parent (window, usually). So is it the bg geometry? Or the frame geometry? Or the content geometry?

Even if we agree on the geometry being that of the frame, we still have a difference between what we pass in evas_object_move() (to set the starting point of the ctxpopup) and what we get from evas_object_geometry_get(). So yeah, it's a bit confusing. Maybe in the EO API we could clarify that by having an explicit popup position property (where we click), that is then different from the object geometry?
For legacy changing the result of geometry_get() would be a behaviour break, I think...?

jpeg closed this task as Wontfix.Feb 16 2017, 4:19 AM
jpeg claimed this task.

There is no perfect definition of the geometry of a ctxpopup, as set (with move) and get refer to different things.
If someone has a strong opinion on this, feel free to send a patch!