Commit Graph

59 Commits

Author SHA1 Message Date
Alex Wu 07b2606c7a shell: Fix 2 switcher crashes.
In case of no regular window, switcher will crash in switch_next()
due to "next == NULL" and in switcher_destroy() due to
"switcher->current == NULL".
2012-03-20 22:43:54 -04:00
Kristian Høgsberg aa6019e125 Fix picking crashes
The surface list is only valid after repaint, so we need to do picking and
input delivery there.
2012-03-12 01:28:50 -04:00
Ander Conselvan de Oliveira de56c311d9 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.

This change was lost with the changes for using wl_layers.
2012-03-08 13:10:18 -05:00
Alex Wu 9c35e6b47d shell: Fix segment fault when clicking to activate a NULL pointer_focus
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.
2012-03-08 13:08:00 -05:00
Alex Wu aa08e2d56d shell: Fix not destroy black surface when fullscreen surface exit abnomally.
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().
2012-03-08 12:57:54 -05:00
Kristian Høgsberg 60c4954b8a shell: Put popups and transients on top of their parent
In other words, don't map the panel menu under the panel.
2012-03-05 20:51:34 -05:00
Kristian Høgsberg abcef3cf7a compositor: Swallow binding key for bindings that don't set up a grab
This prevents passing the key press and release to the keyboard focus client.
2012-03-05 17:47:15 -05:00
Kristian Høgsberg 0b5cd0cb4c Use typesafe server-side stubs 2012-03-04 21:57:37 -05:00
Kristian Høgsberg b41c0810ea compositor: Add a repaint debugging mechanism
Toggle on/off with Super+SPACE.
2012-03-04 14:53:40 -05:00
Kristian Høgsberg 32bed57d5a shell: Don't launch a new screensaver if the old one is still running 2012-03-01 17:33:52 -05:00
Kristian Høgsberg 3be2ce9e49 compositor: Organize surface stack using new struct weston_layer
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.
2012-03-01 17:33:51 -05:00
Alex Wu 4539b0874f shell: Add implementation of fullscreen.
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>
2012-03-01 12:47:23 -05:00
Tiago Vignatti 8e53c7f566 compositor: add dpms and backlight support
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>
2012-02-29 14:01:56 -05:00
Kristian Høgsberg cacb7cd0f6 shell: Mark geometry dirty when we change surface alpha
We need to recompute the opaque region when the alpha changes.
2012-02-28 09:23:23 -05:00
Scott Moreau c6d7f60b19 Restructure output zoom key handling.
This effectively eats the keybinding events, as we don't want them sent
to clients.
2012-02-26 13:43:11 -05:00
Scott Moreau ccbf29dcb4 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.
2012-02-23 17:45:49 -05:00
Ander Conselvan de Oliveira ba727bd1d9 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.
2012-02-23 16:06:06 -05:00
Alex Wu 88277d1422 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
2012-02-22 12:33:43 -05:00
Kristian Høgsberg 0704539ec4 shell: Revive super-tab application switcher
We can do this right, now that we have keyboard grabs.
2012-02-19 21:04:08 -05:00
Scott Moreau 447013d718 Track server changes. 2012-02-18 11:55:51 -05:00
Kristian Høgsberg 1cbf3262dd compositor: Move fullscreen_output to shell_surface 2012-02-17 23:49:07 -05:00
Kristian Høgsberg 6a8b553119 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().
2012-02-16 23:43:59 -05:00
Kristian Høgsberg d5ae9f4f85 shell: Restore basic fullscreen functionality
This just fixes the default case.
2012-02-16 23:38:14 -05:00
Pekka Paalanen b29f412eb8 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>
2012-02-16 23:19:40 -05:00
Ander Conselvan de Oliveira 30eebc7c21 compositor: implement drag'n'drop icons
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2012-02-16 23:19:39 -05:00
Ander Conselvan de Oliveira e9e0515cec 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>
2012-02-16 23:19:39 -05:00
Ander Conselvan de Oliveira a1ff53b31a shell: don't map surfaces with type NONE
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2012-02-16 23:19:39 -05:00
Kristian Høgsberg f856fd2f93 Follow set_fullscreen protocol change 2012-02-16 23:19:38 -05:00
Juan Zhao 96879dfe52 shell: Add the set_maximized implementation 2012-02-16 16:00:02 -05:00
Pekka Paalanen 8fb8d3b1b5 compositor, shell: add and use weston_surface_set_position()
Another shorthand like weston_surface_configure().

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-02-13 13:03:59 +02:00
Pekka Paalanen d882779aa9 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>
2012-02-13 11:52:24 +02:00
Tiago Vignatti 0f997016a7 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>
2012-02-13 11:52:24 +02:00
Pekka Paalanen 8980f7c7d8 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>
2012-02-13 11:41:24 +02:00
Pekka Paalanen fc6d91a568 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>
2012-02-10 15:50:27 +02:00
Pekka Paalanen f07cb5d5f0 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>
2012-02-10 15:50:27 +02:00
Pekka Paalanen b45ac5eada 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>
2012-02-10 15:47:56 +02:00
Pekka Paalanen 25dacab718 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>
2012-02-10 15:47:55 +02:00
Pekka Paalanen 938269af21 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>
2012-02-07 14:19:01 +02:00
Pekka Paalanen ddae03cf9b 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.
2012-02-06 14:54:20 +02:00
Pekka Paalanen 5c97ae7b82 shell: fix resize for transformed surfaces
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>
2012-01-31 13:12:11 +02:00
Pekka Paalanen 7b3bd3d8b6 shell: fix move of transformed surfaces
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>
2012-01-31 13:12:11 +02:00
Kristian Høgsberg 765e27b9e2 shell: Rotate relative to current rotation
This avoids the surface jumping around when you start rotating it.
2012-01-27 13:36:13 -05:00
Pekka Paalanen d581a8fcc8 Collabora copyright updates
which I forgot to add while working on these files.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27 16:26:17 +02:00
Pekka Paalanen 60921e5787 compositor: move weston_surface::width,height into geometry
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>
2012-01-27 16:15:02 +02:00
Pekka Paalanen ba3cf95c0e compositor: move weston_surface::x,y into geometry
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>
2012-01-27 16:15:02 +02:00
Pekka Paalanen e0f3cb25e8 compositor: rewrite draw and input coordinate transformations
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>
2012-01-27 16:15:02 +02:00
Pekka Paalanen bc0b7e7756 compositor: restructure weston_surface::transform
Separate mutable data and cached immutable data in struct
weston_surface.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27 16:15:02 +02:00
Pekka Paalanen 460099f143 shell: add key binding for rotating a surface
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>
2012-01-27 16:15:02 +02:00
Kristian Høgsberg a82c4860a1 compositor: Compute overlapped early and base hw cursor decision on that 2012-01-26 01:03:58 -05:00
Kristian Høgsberg 6af8eb9c7f desktop-shell: Build in sensible defaults
This adds a default background pattern and a terminal launcher in case
we don't have a config file.
2012-01-25 20:53:08 -05:00