[PATCH v2] shell: moving drag surface refine

Bill Spitzak spitzak at gmail.com
Fri Aug 3 11:50:37 PDT 2012

Kristian Høgsberg wrote:

> The idea was to use the bounding box of the surface
> 	pixman_region32_intersect(&region,
> 	                          &shsurf->surface->transform.boundingbox,
> 				  &shell->active_regions);

This seems to be conflicting with what you said earlier.

The surface's region should have NO effect on where the surface is 
placed by a drag.

Instead what is wanted is to intersect a small square around the cursor, 
and require that that small square be inside the active_region.

On the assumption that that small square will still initiate a drag, it 
means the window will always be able to be dragged back.

The scheme you describe I think has big problems with resize of windows. 
Either resizing a window will be able to get into states that are not 
allowed by the drag, or certain resizes will not be possible. Your 
drawing shows one:

>      +------------+-------------------------------+
>      |            |                               |
>      |  LVDS1     |      DP1                      |
>      |            |                               |
>      |     +------++                              |
>      +-----|------+|                              |
>            | SURF ||                              |
>            |      ||                              |
>            +------++                              |
>                   |                               |
>                   +-------------------------------+

Attempting to resize SURF by dragging the upper-right corner up and left 
or down and right will get stuck, even if the user is aiming for a size 
that would be allowed.

In what I think is wanted, resize will be allowed because it will only 
prevent the upper-right corner from being placed outside the active 
region. Even if this makes dragging the window impossible (that would 
require some unconventional window design) the user can still grab the 
resize corner, move it back, and get drag back.

More information about the wayland-devel mailing list