[PATCH weston 3/3] shell: constrain resize grabs so titlebars don't go under the panel

Bill Spitzak spitzak at gmail.com
Thu Aug 21 15:57:55 PDT 2014


Constrain it so that both the grabbed point and the nearest point on the 
edge cannot go under the panel.

A radius about the cursor does not work because if they grab the 
titlebar too close to the top they can't put the window all the way up 
against the edge (Unity has this bug and it triggers full-screen when 
you try to move windows, which is incredibly annoying!). Conversely if 
you grab too far away you can put the edge of the titlebar under the panel.

If the window is rotated it is possible the nearest point is already 
under the panel, in which case it is probably best to pretend it's 
position is the panel edge instead (ie the user can always drop the 
window back where they grabbed it, and move it horizontally).

I think this will work ok for windows that are rotated upside down, 
though the user can stick almost all the contents up under the panel.

All this applies to the output edges, too.

>> After comparing mine and Jonny's patches the more carefully, I found the
>> patches' idea are different. Jonny's patch puts a "hard requirement"
>> that when expanding in height on the top edge, titlebar shouldn't go
>> under top panel or the resizing won't take effect (quite tricky here).
>> While mine will clamp the y-coordinate of cursor position if it's on the
>> panel.
>>
>> I admit that my approach is somewhat too conservative. But there are
>> some tricky edge case under which Jonny's approach doesn't work very
>> well. Rotate a window clockwise 60-75 degrees, move it up until it can't
>> be moved further. You will find the top edge can't expand (actually
>> expanding the top edge here does no harm I think). More seriously,
>> You'll find that if you shrink the top edge a little, it can't resize
>> back! This behavior, in my opinion, is unacceptable, since too much
>> constraint is put on rotated windows.
>>
>> Also, if you rotate a window 90 degrees and expand the edge that is now
>> on the top. It will go under the panel. This behavior isn't change by
>> Jonny's patch but will be changed by mine since I believe the cursor
>> position in panel shouldn't be used in resizing, regardless of which
>> edge we are resizing, at least a clamped coordinate should be used.
>>
>> I think an ideal solution should surely ensure an unrotated window not
>> to be expanded under panel, but don't place too much restriction on
>> rotated windows.
>>
>> What's your idea?


More information about the wayland-devel mailing list