Commit Graph

1486 Commits

Author SHA1 Message Date
Kristian Høgsberg
afa264c6b6 compositor: Don't run keybindings if we have a key grab 2012-02-19 18:57:35 -05:00
Scott Moreau
ec286eb8e8 compositor: Setup for keyboard grabs. 2012-02-19 18:57:34 -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
323ee04505 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.
2012-02-17 12:45:43 -05:00
Kristian Høgsberg
3b5ea3bc6f compositor: Move unmap logic to new function weston_surface_unmap() 2012-02-17 12:43:56 -05:00
Kristian Høgsberg
12bbf81456 compositor: Only delete surface texture if we have one 2012-02-17 12:15:27 -05:00
Kristian Høgsberg
101cb6560c compositor: Get rid of surface->visual 2012-02-17 10:45:16 -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
Kristian Høgsberg
2675dc1c8d window: Don't draw decorations in fullscreen mode 2012-02-16 23:19:41 -05:00
Kristian Høgsberg
1517defe13 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.
2012-02-16 23:19:41 -05:00
Kristian Høgsberg
66c0880c58 view: Don't schedule resize after setting fullscreen
window_set_fullscreen will schedule a resize or wait for the configure
event as needed.
2012-02-16 23:19:41 -05:00
Daniel Stone
0d5a509ae5 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>
2012-02-16 23:19:41 -05:00
Daniel Stone
9d4f030c0b window: Use new xkbcommon include path
xkbcommon in current git has moved its include files.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-16 23:19:40 -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
Pekka Paalanen
dfb93a9e71 window: do not store absolute coordinates
These were not used for anything, anyway.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-02-16 23:19:40 -05:00
Ander Conselvan de Oliveira
e47c3a342b clients/dnd: adapt to new data_device icon protocol
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.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
d595f65fe2 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>
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
Ander Conselvan de Oliveira
b63e3e0201 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>
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
Kristian Høgsberg
d6bcd7daa7 window: Toggle maximized with super-f5 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
9d3935296c 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>
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
Tiago Vignatti
0a26641626 clients: fix spelling
Signed-off-by: Tiago Vignatti <vignatti@freedesktop.org>
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-02-13 11:52:24 +02:00
Tiago Vignatti
c5528d8dc8 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>
2012-02-13 11:52:24 +02:00
Tiago Vignatti
a571e75cc1 window: explicitly set TYPE_TOPLEVEL for new windows
Signed-off-by: Tiago Vignatti <vignatti@freedesktop.org>
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
f8c6aae688 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>
2012-02-13 11:40:39 +02:00
Pekka Paalanen
cc2f868b2e 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>
2012-02-13 10:34:04 +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
730d87e6a6 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>
2012-02-10 15:47:56 +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
9651678070 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>
2012-02-10 15:47:56 +02:00
Pekka Paalanen
1d5035c705 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>
2012-02-10 15:47:56 +02:00
Pekka Paalanen
219b982ed0 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>
2012-02-10 15:47:56 +02:00
Pekka Paalanen
ece8a016aa 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>
2012-02-10 15:47:56 +02:00
Pekka Paalanen
80fb08dc66 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>
2012-02-10 15:47:56 +02:00
Pekka Paalanen
9abf393bd8 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>
2012-02-10 15:47:55 +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
Eric Anholt
6f82cf5dc5 configure: Fix build on debian by avoiding bashisms in the test command. 2012-02-09 14:17:54 -05:00
Kristian Høgsberg
3b03b3d68e Use dist-xz for tarballs 2012-02-09 14:17:49 -05:00
Kristian Høgsberg
850f24c712 Disable setuid install for distcheck 2012-02-09 09:20:44 -05:00