If map is called with a surface of type none it will call
weston_surface_assign_output, even though the surface will
not be mapped.
This change was lost with the changes for using wl_layers.
This can happen for instance running a toytoolkit application, launching
the popup menu and then clicking on a surface that does not belong to
the client that create the popup surface.
When a client with fullscreen surface displayed was aborted by Ctrl-C, the
black surface still be there. Destroy the black surface in
destroy_shell_surface().
The surface data structure is now a list of list of surfaces. The core
compositor defines the fade and cursor layer, and it's up to the shell to
provide more layers for the various surface types it implements.
Undo fullscreen in shell_unset_fullscreen(), do all the stacking order
in shell_stack_fullscreen(), and configure black surface, method in
shell_configure_fullscreen().
Signed-off-by: Alex Wu <zhiwen.wu@linux.intel.com>
Signed-off-by: Juan Zhao <juan.j.zhao@linux.intel.com>
Undo fullscreen in shell_unset_fullscreen(), do all the stacking order
in shell_stack_fullscreen(), and configure black surface, method in
shell_configure_fullscreen().
Signed-off-by: Alex Wu <zhiwen.wu@linux.intel.com>
Signed-off-by: Juan Zhao <juan.j.zhao@linux.intel.com>
DPMS kicks in only when wscreensaver is launched, in the moment that shell
call lock() for the second time. Backlight control internals are managed by
libbacklight:
http://cgit.freedesktop.org/~vignatti/libbacklight/
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Ideally, we would want to use <modifier>+Scroll binding but that will have
to wait for axis events. For now we just use keybindings. Zoom in/out with
Super+Up/Down.
If client send set_fullscreen/set_transient request before the first attach,
compositor has no chance to map the surface due to "if (es->output == NULL)".
You can pull it from git://gitorious.org/wayland-for-krh/weston.git map-bug
This change depens on the Wayland core commit:
"protocol: remove absolute coordinates from pointer".
Remove the absolute coordinates from pointer motion and pointer_focus
events.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Needed for implementing drag'n'drop icons. When a drag starts, the
compositor will position the top-left corner of the client supplied
icon surface at the cursor hotspot. On the first attach to that
surface, the client may want to reposition it but shell->map did not
take sx and sy parameters.
This changes shell->map interface to take sx and sy parameters and
change dekstop shell implementation to update the position of a
surface of type none according to those parameters. Since a surface
of type none won't actually be mapped, the effect of this change is
only visible for surfaces that are made visible by the compositor.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
This clean-up seems alright, but someone with better knowledge has to
doublecheck this function. I guess there's a lot of space for clean-up
there.
[pq: looks ok, redone since did not apply after my changes]
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Setting a window type is a non-visual operation, it is not supposed to
affect the rendering immediately. Therefore it does not need to apply
surface damage.
The proper surface damage is applied on an attach request following a
window type change.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
In the past, weston_surface_configure() was used to change the geometry,
apply damage, and assign an output.
Remove all calls to weston_surface_configure() that do not change the
surface geometry. Add damage calls where needed to keep the wanted
configure side-effects.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Move the call to assign an output from weston_surface_configure() to
weston_surface_update_transform().
As update_transform takes new geometry into use, it should also reassign
the output for the surface, but only if an output was already assigned.
Add explicit assing output calls to where we relied on
weston_surface_configure() unconditionally assigning the output.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Remove redundant weston_surface_update_transform() calls from within
output repaint paths, and add a comment that we need to rely on
surface->geometry.dirty == 0 within the repaint sub-functions.
Now that weston_surface_update_transform() does damage as needed, and
weston_output_repaint() explicitly calls update_transform, we can reduce
the updates in rotate_grab_motion() to simply scheduling a repaint. This
will guarantee that the change in rotation ends up on screen ASAP.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Rotating a surface should not force a full display repaint, so remove
that.
This change exposes a bug: weston_surface_update_transform() does not
apply damage, but it does change surface geometry. While you rotate a
surface, repaints do not work.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Transform a menu popup the same as its parent surface.
The parent's transformation is snapshotted at the popup map() time, and
does not follow further parent motion.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
When a transformed (rotated) surface is continuously resized from its
top-left corner, its location will drift. This is due to accumulating
rounding errors in transforming an offset from surface-local to global
coordinates in surface_attach().
Diminish the drift down to unobservable level by changing the
weston_surface global position from integer to float.
The offset transformation is now done without rounding. To preserve the
precision, wl_shell::configure() interface must use floats, and so does
weston_surface_configure(), too.
The con of this patch is that it adds inconsistency to the surface
position coordinates: sometimes they are floats, sometimes integers.
This fixes the resize pointer motion vs. surface size mismatch for
right/bottom direction resizes. Top/left resizes need further fixes in
surface motion.
Additionally there is some clean-up in weston_surface_resize() to
eliminate a failure path, and fixing the Weston resize binding's resize
direction heuristic to follow transformations.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
In the stack of transformations, change the rotation to be applied
to the surface before the absolute positioning. Doing so avoids having
to undo and redo the absolute positioning, and we can simply use the
surface center in local coordinates as the origin.
This fixes the surface move. Before, the surface moved along the surface
local axis, but the user expects it to move along the global axis with
the pointer.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
weston_surface::transform.boundingbox depends on width and height, and
therefore geometry.dirty flag, so move width and height into geometry.
Fix all users and check that the dirty flag is set.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
weston_surface::transform.position depends on x,y, and therefore the
dirty flag, so move x and y into geometry.
Also add the missing dirty flags.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
For unifying the coordinate system handling, introduce functions for
converting explicitly between the global and the surface local
coordinate systems.
Use these functions in the input path, replacing
weston_surface_transform().
In the draw path, rewrite transform_vertex() to take in surface local
coordinates.
As shell now uses the new functions, the rotation origin is properly
placed in the middle of the surface.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Add the key binding Super+Alt+MouseLeftButton to start rotating a
surface by dragging. The rotation is removed, when the drag is near the
rotation origin.
Rotated surface are a stress test for input event coordinate
transformations, damage region tracking, draw transformations, and
window move and resize orientation.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>