Commit Graph

1596 Commits

Author SHA1 Message Date
Kristian Høgsberg
010f98b083 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.
2012-02-23 17:30:54 -05:00
Kristian Høgsberg
dd631c1c36 simple-touch: Update to enter/leave changes 2012-02-23 16:20:38 -05:00
Kristian Høgsberg
5e7e6f2a22 compositor: Implement opqaue and input regions 2012-02-23 16:14:27 -05:00
Ander Conselvan de Oliveira
a2f1129d13 compositor: assign output to drag surfaces
Otherwise we endup with a surface that is mapped but with outtup nil.
2012-02-23 16:12:30 -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
Kristian Høgsberg
06d58b74af Update to enter/leave events for pointer and keyboard 2012-02-23 09:59:05 -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
31f9d0e8de 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.
2012-02-19 22:46:13 -05:00
Kristian Høgsberg
d0e2ef7779 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.
2012-02-19 22:15:21 -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
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