platform/upstream/weston.git
12 years agowindow: Set opaque region after child widget adjusts size
Kristian Høgsberg [Wed, 29 Feb 2012 02:52:12 +0000 (21:52 -0500)]
window: Set opaque region after child widget adjusts size

12 years agoweston: Change path for default terminal launcher to ${prefix}/bin
Rodney Lorrimar [Wed, 29 Feb 2012 16:31:03 +0000 (17:31 +0100)]
weston: Change path for default terminal launcher to ${prefix}/bin

If you don't have anything at ~/.config/weston-desktop-shell.ini and
have weston installed somewhere other than /usr, then this patch will
help.

Cheers,

Signed-off-by: Rodney Lorrimar <rodney@rodney.id.au>
12 years agoclients: Use wl_display_disconnect()
Kristian Høgsberg [Tue, 28 Feb 2012 19:29:19 +0000 (14:29 -0500)]
clients: Use wl_display_disconnect()

12 years agocompositor: make the input region of drag surfaces empty
Ander Conselvan de Oliveira [Tue, 28 Feb 2012 15:59:33 +0000 (17:59 +0200)]
compositor: make the input region of drag surfaces empty

With the input region changes, drag surfaces were being picked and
receiving events which led to problems on the client side.

12 years agoshell: Mark geometry dirty when we change surface alpha
Kristian Høgsberg [Tue, 28 Feb 2012 14:20:21 +0000 (09:20 -0500)]
shell: Mark geometry dirty when we change surface alpha

We need to recompute the opaque region when the alpha changes.

12 years agocompositor: Dont set the opaque region if we have an overall surface alpha
Kristian Høgsberg [Tue, 28 Feb 2012 14:19:39 +0000 (09:19 -0500)]
compositor: Dont set the opaque region if we have an overall surface alpha

12 years agoterminal: Don't queue a resize after setting fullscreen
Kristian Høgsberg [Tue, 28 Feb 2012 14:17:32 +0000 (09:17 -0500)]
terminal: Don't queue a resize after setting fullscreen

We end up doing an attach at the non-fullscreen size before resizing to
fullscreen, causing the terminal to jump to the center for a frame before we
render the fullscreen image.

12 years agocompositor: Export functions and add weston_suface::force_configure for fullscreen
Alex Wu [Tue, 28 Feb 2012 10:07:54 +0000 (18:07 +0800)]
compositor: Export functions and add weston_suface::force_configure for fullscreen

This will facilitate the implementation of fullscreen.

Signed-off-by: Alex Wu <zhiwen.wu@linux.intel.com>
12 years agoRestructure output zoom key handling.
Scott Moreau [Fri, 24 Feb 2012 05:28:37 +0000 (22:28 -0700)]
Restructure output zoom key handling.

This effectively eats the keybinding events, as we don't want them sent
to clients.

12 years agodrm: Remove redundant cursor region math
Kristian Høgsberg [Fri, 24 Feb 2012 16:03:27 +0000 (11:03 -0500)]
drm: Remove redundant cursor region math

We already check this in weston_output_set_cursor().

12 years agodrm: Remove redundant weston_surface_update_transform() call
Kristian Høgsberg [Fri, 24 Feb 2012 04:07:45 +0000 (23:07 -0500)]
drm: Remove redundant weston_surface_update_transform() call

12 years agocompositor: Remove surface overlapped attribute
Kristian Høgsberg [Fri, 24 Feb 2012 04:06:13 +0000 (23:06 -0500)]
compositor: Remove surface overlapped attribute

We need to compute this as we assign surfaces to overlays, so that
if we assign a surface to an overlay, it isn't considered overlapping.

12 years agoMove weston_output_set_cursor into compositor-drm.c
Kristian Høgsberg [Fri, 24 Feb 2012 04:03:14 +0000 (23:03 -0500)]
Move weston_output_set_cursor into compositor-drm.c

First step towards moving hw cursor handling into compositor-drm.c a its
general overlay handling.

12 years agocompositor-drm: Destroy sprites on shutdown, turn off on vt switch
Kristian Høgsberg [Fri, 24 Feb 2012 02:45:32 +0000 (21:45 -0500)]
compositor-drm: Destroy sprites on shutdown, turn off on vt switch

12 years agocompositor: Remove unused compositor vfunc create_cursor_image
Kristian Høgsberg [Fri, 24 Feb 2012 02:29:55 +0000 (21:29 -0500)]
compositor: Remove unused compositor vfunc create_cursor_image

12 years agocompositor-drm: Add sprite support
Jesse Barnes [Thu, 23 Feb 2012 14:45:49 +0000 (09:45 -0500)]
compositor-drm: Add sprite support

Add support for assigning surfaces to overlay sprites using the new
assign_planes hook.

12 years agocompositor: add an assign_planes hook to the output
Jesse Barnes [Thu, 9 Feb 2012 21:12:57 +0000 (13:12 -0800)]
compositor: add an assign_planes hook to the output

This allows each output back end to optimize drawing using overlay planes
and cursors (yet to be integrated).  If a surface is assigned to a
plane, the back end should clear its damage field so that the later
repaint code won't look at it.

12 years agoFix pointer position clipping.
Scott Moreau [Wed, 22 Feb 2012 20:57:51 +0000 (13:57 -0700)]
Fix pointer position clipping.

12 years agoIntroduce output zoom.
Scott Moreau [Wed, 22 Feb 2012 21:21:41 +0000 (14:21 -0700)]
Introduce output zoom.

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.

12 years agocompositor: Initialize destroy_listener_list for internal surfaces too
Kristian Høgsberg [Thu, 23 Feb 2012 22:38:33 +0000 (17:38 -0500)]
compositor: Initialize destroy_listener_list for internal surfaces too

We use this to look up user data on the surface, so make sure the list is
always valid.

12 years agowindow: Track and report input and opaque regions
Kristian Høgsberg [Thu, 23 Feb 2012 22:30:45 +0000 (17:30 -0500)]
window: Track and report input and opaque regions

We just set the input region to the bounding box of the window frame
and set the opaque region to be the opaque rectangle inside the window
if the child widget is opaque.

12 years agosimple-touch: Update to enter/leave changes
Kristian Høgsberg [Thu, 23 Feb 2012 21:20:38 +0000 (16:20 -0500)]
simple-touch: Update to enter/leave changes

12 years agocompositor: Implement opqaue and input regions
Kristian Høgsberg [Thu, 23 Feb 2012 21:11:59 +0000 (16:11 -0500)]
compositor: Implement opqaue and input regions

12 years agocompositor: assign output to drag surfaces
Ander Conselvan de Oliveira [Thu, 23 Feb 2012 11:29:26 +0000 (13:29 +0200)]
compositor: assign output to drag surfaces

Otherwise we endup with a surface that is mapped but with outtup nil.

12 years agoshell: don't assign output for surface of type none
Ander Conselvan de Oliveira [Thu, 23 Feb 2012 11:29:25 +0000 (13:29 +0200)]
shell: don't assign output for surface of type none

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.

12 years agoUpdate to enter/leave events for pointer and keyboard
Kristian Høgsberg [Thu, 23 Feb 2012 14:59:05 +0000 (09:59 -0500)]
Update to enter/leave events for pointer and keyboard

12 years agoshell: Fix never map fullscreen/transient surface.
Alex Wu [Wed, 22 Feb 2012 06:50:46 +0000 (14:50 +0800)]
shell: Fix never map fullscreen/transient surface.

       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

12 years agocompositor: Remove redundant weston_surface_damage_below() calls
Kristian Høgsberg [Mon, 20 Feb 2012 03:46:13 +0000 (22:46 -0500)]
compositor: Remove redundant weston_surface_damage_below() calls

In the attach case we always end up calling weston_surface_damage_below()
through weston_surface_update_transform() if and only if we need it.

12 years agocompositor: Surface is unmapped when surface->output is NULL
Kristian Høgsberg [Mon, 20 Feb 2012 03:15:21 +0000 (22:15 -0500)]
compositor: Surface is unmapped when surface->output is NULL

surface->buffer can be NULL, which happens when a client destroys the
attached buffer.  Fixes list corruption on resize.

12 years agoshell: Revive super-tab application switcher
Kristian Høgsberg [Sun, 19 Feb 2012 23:52:44 +0000 (18:52 -0500)]
shell: Revive super-tab application switcher

We can do this right, now that we have keyboard grabs.

12 years agocompositor: Don't run keybindings if we have a key grab
Kristian Høgsberg [Sun, 19 Feb 2012 23:50:55 +0000 (18:50 -0500)]
compositor: Don't run keybindings if we have a key grab

12 years agocompositor: Setup for keyboard grabs.
Scott Moreau [Sat, 18 Feb 2012 12:05:30 +0000 (05:05 -0700)]
compositor: Setup for keyboard grabs.

12 years agoTrack server changes.
Scott Moreau [Sat, 18 Feb 2012 12:05:29 +0000 (05:05 -0700)]
Track server changes.

12 years agocompositor: Move fullscreen_output to shell_surface
Kristian Høgsberg [Sat, 18 Feb 2012 04:49:07 +0000 (23:49 -0500)]
compositor: Move fullscreen_output to shell_surface

12 years agocompositor: Make weston_surface_damage_below_noupdate() the default
Kristian Høgsberg [Fri, 17 Feb 2012 17:45:43 +0000 (12:45 -0500)]
compositor: Make weston_surface_damage_below_noupdate() the default

We never want to update the transform and then damage below.  Damage
below is always used to trigger a repaint where the surface used to be
so we need to record the damage before updating the transform.

12 years agocompositor: Move unmap logic to new function weston_surface_unmap()
Kristian Høgsberg [Fri, 17 Feb 2012 17:43:56 +0000 (12:43 -0500)]
compositor: Move unmap logic to new function weston_surface_unmap()

12 years agocompositor: Only delete surface texture if we have one
Kristian Høgsberg [Fri, 17 Feb 2012 17:15:27 +0000 (12:15 -0500)]
compositor: Only delete surface texture if we have one

12 years agocompositor: Get rid of surface->visual
Kristian Høgsberg [Fri, 17 Feb 2012 15:45:16 +0000 (10:45 -0500)]
compositor: Get rid of surface->visual

12 years agoshell: Set geometry directly in configure
Kristian Høgsberg [Fri, 17 Feb 2012 04:43:59 +0000 (23:43 -0500)]
shell: Set geometry directly in configure

We already set half of it directly, and overwrite it in other cases, so
just skip weston_surface_configure().

12 years agoshell: Restore basic fullscreen functionality
Kristian Høgsberg [Fri, 17 Feb 2012 04:38:14 +0000 (23:38 -0500)]
shell: Restore basic fullscreen functionality

This just fixes the default case.

12 years agowindow: Don't draw decorations in fullscreen mode
Kristian Høgsberg [Fri, 17 Feb 2012 03:57:21 +0000 (22:57 -0500)]
window: Don't draw decorations in fullscreen mode

12 years agowindow: Set window type as it changes, not on every attach
Kristian Høgsberg [Fri, 17 Feb 2012 03:56:12 +0000 (22:56 -0500)]
window: Set window type as it changes, not on every attach

It was always a bit sloppy, and the new fullscreen request doesn't work
that way.

12 years agoview: Don't schedule resize after setting fullscreen
Kristian Høgsberg [Fri, 17 Feb 2012 03:51:33 +0000 (22:51 -0500)]
view: Don't schedule resize after setting fullscreen

window_set_fullscreen will schedule a resize or wait for the configure
event as needed.

12 years agowindow: Use constant keycode offset of 8
Daniel Stone [Thu, 16 Feb 2012 12:48:00 +0000 (12:48 +0000)]
window: Use constant keycode offset of 8

The X11 compositor currently posts its key presses as keycode - 8; this
is due to X11 having a historical minimum keycode of 8, whereas evdev is
numbered starting from 1.  So while the KEY_* constants begin with
KEY_ESC at 1, the corresponding keycode in both X11 and the XKB keymaps
is 9.

window, on the other hand, was relying on xkb->min_key_code being 8 to
translate its keycodes back to useful values in the XKB 'evdev' keycode
map.  min_key_code may not always be 8, for restricted subsets of the
keycode map.

Perhaps not the best solution, but at least consistent.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agowindow: Use new xkbcommon include path
Daniel Stone [Wed, 15 Feb 2012 16:33:21 +0000 (16:33 +0000)]
window: Use new xkbcommon include path

xkbcommon in current git has moved its include files.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agoprotocol: remove absolute coordinates from pointer
Pekka Paalanen [Tue, 14 Feb 2012 12:59:18 +0000 (14:59 +0200)]
protocol: remove absolute coordinates from pointer

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>
12 years agowindow: do not store absolute coordinates
Pekka Paalanen [Mon, 13 Feb 2012 13:33:28 +0000 (15:33 +0200)]
window: do not store absolute coordinates

These were not used for anything, anyway.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoclients/dnd: adapt to new data_device icon protocol
Ander Conselvan de Oliveira [Wed, 15 Feb 2012 15:02:58 +0000 (17:02 +0200)]
clients/dnd: adapt to new data_device icon protocol

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
12 years agocompositor: implement drag'n'drop icons
Ander Conselvan de Oliveira [Wed, 15 Feb 2012 15:02:57 +0000 (17:02 +0200)]
compositor: implement drag'n'drop icons

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
12 years agoshell: update position of surfaces with type none on map()
Ander Conselvan de Oliveira [Wed, 15 Feb 2012 15:02:56 +0000 (17:02 +0200)]
shell: update position of surfaces with type none on map()

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>
12 years agocompositor: add a way to disable picking of client surfaces
Ander Conselvan de Oliveira [Wed, 15 Feb 2012 15:02:55 +0000 (17:02 +0200)]
compositor: add a way to disable picking of client surfaces

Surfaces like drag'n'drop icons shouldn't receive events as a normal
surface but are still created by the client so add a way for the
compositor to enable or disable the picking of a client surface.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
12 years agoshell: don't map surfaces with type NONE
Ander Conselvan de Oliveira [Wed, 15 Feb 2012 15:02:54 +0000 (17:02 +0200)]
shell: don't map surfaces with type NONE

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
12 years agocompositor: fix two crashs on surface_attach() with null buffer
Ander Conselvan de Oliveira [Wed, 15 Feb 2012 15:02:53 +0000 (17:02 +0200)]
compositor: fix two crashs on surface_attach() with null buffer

The condition to return from surface_attach with a null buffer involves
es->output being non-null. However if a surface was just created this
field would be null and an attach of a null buffer would cause the
compositor to crash.

The other crash happened if surface_attach was called twice with a
null buffer after a valid buffer was attached to the surface. Since
es->buffer was not being set to NULL, surface_attach() would call
wl_list_remove(&es->buffer_destroy_listener.link) twice for the same
surface.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
12 years agoFollow set_fullscreen protocol change
Kristian Høgsberg [Thu, 16 Feb 2012 20:58:14 +0000 (15:58 -0500)]
Follow set_fullscreen protocol change

12 years agowindow: Toggle maximized with super-f5
Kristian Høgsberg [Thu, 16 Feb 2012 20:53:46 +0000 (15:53 -0500)]
window: Toggle maximized with super-f5

12 years agoshell: Add the set_maximized implementation
Juan Zhao [Tue, 7 Feb 2012 00:45:41 +0000 (08:45 +0800)]
shell: Add the set_maximized implementation

12 years agocompositor, shell: add and use weston_surface_set_position()
Pekka Paalanen [Mon, 13 Feb 2012 11:03:59 +0000 (13:03 +0200)]
compositor, shell: add and use weston_surface_set_position()

Another shorthand like weston_surface_configure().

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoshell: remove two redundant statements from map()
Pekka Paalanen [Fri, 10 Feb 2012 14:40:22 +0000 (16:40 +0200)]
shell: remove two redundant statements from map()

I stared at this function for some time, and these were the only lines
I could sanely remove.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agocompositor: make functions static
Tiago Vignatti [Fri, 10 Feb 2012 14:26:19 +0000 (16:26 +0200)]
compositor: make functions static

I know it's hard to figure out what the shells or backends will be
using as internal API at this point but we can try to minimize the
amount of WL_EXPORT being used anyway.

[pq: redone due to my earlier changes]

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoshell: remove duplicated code
Tiago Vignatti [Fri, 10 Feb 2012 14:17:23 +0000 (16:17 +0200)]
shell: remove duplicated code

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>
12 years agoclients: fix spelling
Tiago Vignatti [Thu, 9 Feb 2012 17:06:56 +0000 (19:06 +0200)]
clients: fix spelling

Signed-off-by: Tiago Vignatti <vignatti@freedesktop.org>
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agowindow: simplify a bit widget_set_size and widget_set_allocation
Tiago Vignatti [Thu, 9 Feb 2012 17:06:55 +0000 (19:06 +0200)]
window: simplify a bit widget_set_size and widget_set_allocation

Signed-off-by: Tiago Vignatti <vignatti@freedesktop.org>
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agowindow: explicitly set TYPE_TOPLEVEL for new windows
Tiago Vignatti [Thu, 9 Feb 2012 17:06:54 +0000 (19:06 +0200)]
window: explicitly set TYPE_TOPLEVEL for new windows

Signed-off-by: Tiago Vignatti <vignatti@freedesktop.org>
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoshell: do not apply damage on window type set
Pekka Paalanen [Mon, 13 Feb 2012 09:04:30 +0000 (11:04 +0200)]
shell: do not apply damage on window type set

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>
12 years agocompositor: remove redundant cursor damage calls
Pekka Paalanen [Mon, 13 Feb 2012 09:01:59 +0000 (11:01 +0200)]
compositor: remove redundant cursor damage calls

As weston_surface_update_transform() automatically applies before and
after damage on surface geometry change, we don't need to explicitly add
the same damage in motion_notify() for the cursor surface.

We still need the side-effect, that is scheduling a repaint.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agocompositor: round off fractions
Pekka Paalanen [Mon, 13 Feb 2012 08:34:04 +0000 (10:34 +0200)]
compositor: round off fractions

Round off fractions from non-transformed surface position coordinates.

Transformed surface moved by a client may have non-integer position
coordinates. That is required to prevent drifting on continuous
resizing.

We can round the position to integers when the surface is not (anymore)
transformed.

This change may fix a rounding inconsistency in the opaque region setup,
where the rectangle is initialised from the coordinates without explicit
rounding operation.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoshell: replace identity calls to weston_surface_configure()
Pekka Paalanen [Fri, 10 Feb 2012 13:33:10 +0000 (15:33 +0200)]
shell: replace identity calls to weston_surface_configure()

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>
12 years agocompositor: move output assignment to update_transform
Pekka Paalanen [Fri, 10 Feb 2012 11:34:36 +0000 (13:34 +0200)]
compositor: move output assignment to update_transform

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>
12 years agocompositor: move opaque tracking into transform
Pekka Paalanen [Thu, 9 Feb 2012 14:39:38 +0000 (16:39 +0200)]
compositor: move opaque tracking into transform

Move the surface opaque region setup from weston_surface_configure() to
weston_surface_update_transform(), so we have less reason to call
update_transform from configure. Opaque region depends on geometry,
after all.

Also move the opaque field from weston_surface to
weston_surface::transform to make this obvious.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agocompositor: clarify update_transform vs. repaint
Pekka Paalanen [Thu, 9 Feb 2012 13:58:44 +0000 (15:58 +0200)]
compositor: clarify update_transform vs. repaint

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>
12 years agocompositor: let update_transform deal damage
Pekka Paalanen [Thu, 9 Feb 2012 13:32:15 +0000 (15:32 +0200)]
compositor: let update_transform deal damage

weston_surface_update_transform() is similar to
weston_surface_configure() in that it changes the surface region on
screen. Unlike configure, update_transform forgets to deal damage at
all, yet it is the only place where we can do damage_below() as needed.

Add a damage_below call to deal damage for the old surface region only
when needed. This uses the cached state from surface->transform to get
the old region.

Add a damage call to deal damage for the new surface region, after
updating the cached state.

Add a repaint call, since we have changed the scene and should render it
out.

This change fixes the rotation not updating the screen properly.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agocompositor: simplify weston_surface_damage_rectangle()
Pekka Paalanen [Thu, 9 Feb 2012 13:27:45 +0000 (15:27 +0200)]
compositor: simplify weston_surface_damage_rectangle()

The non-transformed case looked a little odd, calling
weston_surface_to_global(), since it already tests for transform.enabled
and simply uses width, height for the box.

Streamline it, by open-coding weston_surface_to_global(), and avoiding
another call into weston_surface_update_transform(). This way it does
not look suspicious to me.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agocompositor: use floats in computing bounding box
Pekka Paalanen [Wed, 8 Feb 2012 13:38:37 +0000 (15:38 +0200)]
compositor: use floats in computing bounding box

In surface_compute_bbox(), call surface_to_global_float() instead of
weston_surface_to_global(). This avoids the recursion:

weston_surface_update_transform()
  weston_surface_update_transform_enable()
    surface_compute_bbox()
       weston_surface_to_global()
         weston_surface_update_transform()

which might be non-obvious when reading the code.

Computing the min and max coordinates in floats, we can have a tight
rounding margin by using floor() and ceil().

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agocompositor: move surface_to_global_float() definition
Pekka Paalanen [Wed, 8 Feb 2012 13:23:15 +0000 (15:23 +0200)]
compositor: move surface_to_global_float() definition

Move surface_to_global_float() definition earlier in the file. No code
changes.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agocompositor: split weston_surface_update_transform()
Pekka Paalanen [Wed, 8 Feb 2012 13:14:17 +0000 (15:14 +0200)]
compositor: split weston_surface_update_transform()

Split two helper functions out of weston_surface_update_transform() to:
- make the code clearer
- update the bounding box properly even if transformation fails
- unify the return point

Also add a comment on what matrix.d[12] is.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agocompositor: split weston_surface_damage_below()
Pekka Paalanen [Wed, 8 Feb 2012 12:49:37 +0000 (14:49 +0200)]
compositor: split weston_surface_damage_below()

Extract the core into a function that does not call
weston_surface_update_transform() or schedule repaint.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoshell: remove excessive damage from rotating
Pekka Paalanen [Wed, 8 Feb 2012 12:19:18 +0000 (14:19 +0200)]
shell: remove excessive damage from rotating

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>
12 years agoconfigure: Fix build on debian by avoiding bashisms in the test command.
Eric Anholt [Thu, 9 Feb 2012 16:36:03 +0000 (08:36 -0800)]
configure: Fix build on debian by avoiding bashisms in the test command.

12 years agoUse dist-xz for tarballs
Kristian Høgsberg [Thu, 9 Feb 2012 16:18:16 +0000 (11:18 -0500)]
Use dist-xz for tarballs

12 years agoDisable setuid install for distcheck
Kristian Høgsberg [Thu, 9 Feb 2012 14:20:44 +0000 (09:20 -0500)]
Disable setuid install for distcheck

12 years agoconfigure: Change project to weston, set version to 0.89
Kristian Høgsberg [Wed, 8 Feb 2012 21:35:12 +0000 (16:35 -0500)]
configure: Change project to weston, set version to 0.89

12 years agocompositor: Don't destroy sprite surface, just hide it
Kristian Høgsberg [Wed, 8 Feb 2012 21:33:57 +0000 (16:33 -0500)]
compositor: Don't destroy sprite surface, just hide it

12 years agosmoke: Use normal window resize mechanism
Kristian Høgsberg [Wed, 8 Feb 2012 19:47:53 +0000 (14:47 -0500)]
smoke: Use normal window resize mechanism

12 years agowindow: Don't set the window size in widget_set_size()
Kristian Høgsberg [Wed, 8 Feb 2012 19:45:02 +0000 (14:45 -0500)]
window: Don't set the window size in widget_set_size()

We propagate the toplevel widget size to the window size in the
window.c resize code.

12 years agosmoke: fix the segment fault error
Juan Zhao [Fri, 3 Feb 2012 00:02:06 +0000 (16:02 -0800)]
smoke: fix the segment fault error

Add widget_set_size in the initiate time to allow smoke get the
correct surface later. Or it will report segment fault error because
of the null surface.

Also add resize_handler to not allow resizing just like flower.

Signed-off-by: Juan Zhao <juan.j.zhao@linux.intel.com>
12 years agoAdd support for webp image format
Kristian Høgsberg [Wed, 8 Feb 2012 17:46:57 +0000 (12:46 -0500)]
Add support for webp image format

12 years agocairo-util: Only look at first two bytes for jpegs
Kristian Høgsberg [Wed, 8 Feb 2012 15:11:42 +0000 (10:11 -0500)]
cairo-util: Only look at first two bytes for jpegs

The next two bytes aren't fixed.

12 years agoterminal: run $SHELL if set
Peter Hutterer [Fri, 3 Feb 2012 10:58:19 +0000 (20:58 +1000)]
terminal: run $SHELL if set

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
12 years agoconfigure.ac: fix cairo-glesv2 help text
Jesse Barnes [Tue, 7 Feb 2012 20:42:28 +0000 (12:42 -0800)]
configure.ac: fix cairo-glesv2 help text

Finally figured out why --enable-cairo-gles2 wasn't working like
configure --help said it should.

12 years agoMerge remote-tracking branch 'pq/transform-fixes2'
Kristian Høgsberg [Tue, 7 Feb 2012 16:04:11 +0000 (11:04 -0500)]
Merge remote-tracking branch 'pq/transform-fixes2'

12 years agocompositor-wayland: Add window border
Kristian Høgsberg [Wed, 1 Feb 2012 12:45:51 +0000 (07:45 -0500)]
compositor-wayland: Add window border

12 years agocompositor-wayland: Add display sub-option for wayland backend
Kristian Høgsberg [Tue, 7 Feb 2012 14:57:25 +0000 (09:57 -0500)]
compositor-wayland: Add display sub-option for wayland backend

This lets us launch the compositor on a separate wayland socket that
what we're listening on.

12 years agocompositor-wayland: Hide cursor for compositor surfaces
Kristian Høgsberg [Tue, 7 Feb 2012 14:56:51 +0000 (09:56 -0500)]
compositor-wayland: Hide cursor for compositor surfaces

12 years agocompositor-wayland: Destroy wl_callback in callback function
Kristian Høgsberg [Tue, 7 Feb 2012 14:56:15 +0000 (09:56 -0500)]
compositor-wayland: Destroy wl_callback in callback function

12 years agocompositor: Drop setuid when launching clients
Kristian Høgsberg [Wed, 1 Feb 2012 03:17:25 +0000 (22:17 -0500)]
compositor: Drop setuid when launching clients

12 years agocompositor: simple menu transform
Pekka Paalanen [Tue, 7 Feb 2012 12:19:01 +0000 (14:19 +0200)]
compositor: simple menu transform

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>
12 years agocompositor: add weston_surface transformation doc
Pekka Paalanen [Tue, 7 Feb 2012 11:18:00 +0000 (13:18 +0200)]
compositor: add weston_surface transformation doc

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agocompositor: fix transformed opaque surface repainting
Pekka Paalanen [Mon, 6 Feb 2012 14:26:57 +0000 (16:26 +0200)]
compositor: fix transformed opaque surface repainting

Computing the real maximal opaque screen aligned rectangle of a
transformed surface is hard. Let's drop the opaque optimisation
instead.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agocompositor: q&d solution for surface drift
Pekka Paalanen [Mon, 6 Feb 2012 12:54:20 +0000 (14:54 +0200)]
compositor: q&d solution for surface drift

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.

12 years agocompositor: clear surface damage on draw
Pekka Paalanen [Mon, 6 Feb 2012 10:16:07 +0000 (12:16 +0200)]
compositor: clear surface damage on draw

Commit a0d6dc4f26c95ae08ffff7d5f1ee7c1f53bdf545 lost one line of code in
the refactoring, and so did not reset the surface damage on repaint
anymore. This causes damage to only accumulate, leading to a full
display redraw every cycle and hiding damage tracking issues.

Put the damage clear back.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>