[PATCH weston 6/6] zoom: Change how we select a zoom location

Derek Foreman derekf at osg.samsung.com
Tue Jan 20 07:44:05 PST 2015


On 19/01/15 07:24 PM, Bill Spitzak wrote:
> This seems excessively complicated compared to a version that just
> figures out an x/y pair to use instead of seat->pointer->x/y and leaves
> the rest of the code alone.

It's also more complicated than a patch that just removes the keybind
for zoom in/zoom out, which also does what I really care about:  stops
weston from segfaulting when there's no pointer in a seat and the
keybind is used to zoom.  :)

(I'm wondering if my other patch to kill the segfault should be merged
in the short term so we can kill that bug before 1.7 and we can worry
about "nice zoom semantics for multi-seat" later)

> On 01/09/2015 10:45 AM, Derek Foreman wrote:
>> Any time the zoom is updated the best zoom target will be calculated
>> with the following priority:
>>
>> 1) The current pointer location.
>>
>> 2) The last known location of the pointer that initiated the zoom.
>>
>> 3) The center of the current keyboard focus.  If the focus is split
>> across
>> heads, multiple heads may zoom.
> 
> This would have to be changed to only zoom the output containing the
> center of the current keyboard focus in my proposal, but I kind of feel
> that would be better anyway.

Why is that better?  I don't really have much of an opinion one way or
the other.  But this is all subjective.  I'll vote for my way because I
already wrote it like this, you vote for yours, someone else can break
the tie? ;)

>> -    wl_list_for_each(output, &compositor->output_list, link) {
>> -        if (pixman_region32_contains_point(&output->region,
>> -                           wl_fixed_to_double(seat->pointer->x),
>> -                           wl_fixed_to_double(seat->pointer->y),
>> -                           NULL)) {
> 
> So I propose that the above code refer to two local variables instead of
> using wl_fixed_to_double(seat->pointer->x/y). You set those two
> variables by calling some function (since it may want to be reused
> elsewhere) that turns a seat into an x/y location, using the rules you
> suggested.

I'm not sure I follow.  Are you saying we should have a
"weston_set_zoom_focus()" function and call that every time we change
the pointer location (or keyboard focus if there's no pointer)?


More information about the wayland-devel mailing list