Commit Graph

157 Commits

Author SHA1 Message Date
emersion a5b8ea90d2
surface: fix destroyed subsurfaces handling
wlr_subsurface_from_wlr_surface can return NULL if the wl_surface is still
alive and if the wl_subsurface has been destroyed. Make sure we check for NULL.

Fixes https://github.com/swaywm/sway/issues/3195
2018-11-26 23:17:52 +01:00
Drew DeVault d7b010024a
Merge pull request #1261 from arandomhuman/damage-control
Fix damage tracking for surfaces with transforms
2018-11-04 14:31:17 +01:00
emersion dec303bea6
surface: fix wlr_surface_get_effective_damage to give surface coords
Transforms were applied, but scale wasn't.
2018-11-04 11:13:10 +01:00
random human 3e0a0f3c3a
wlr_surface: add wlr_surface_get_effective_damage
This calculates and returns the effective damage of the surface in
surface coordinates, including the client damage (in buffer
coordinates), and damage induced by resize or move events.
2018-10-04 02:19:09 +05:30
random human 84ecfb546b
wlr_surface: more consistent argument naming in surface_update_damage 2018-09-25 02:06:02 +05:30
random human 5eca5d8946
wlr_surface: remove duplicated damage calculation
The damage is already calculated and stored in surface->buffer_damage
by surface_update_damage().
2018-09-25 01:38:09 +05:30
random human 3fd5da58a0
wlr_surface: fix surface damage on resize
Instead of damaging the buffer, damage only the surface on surface (not
buffer) resize.
2018-09-25 01:25:30 +05:30
random human 971cbeaa19
wlr_surface: fix surface damage transformation
Damage tracking on transformed surfaces now work (see
"weston-simple-damage --rotation=90"), using either of buffer or surface
damage.
2018-09-24 22:03:41 +05:30
Las afa2e399aa Fix implicit conversion of floats to ints in calls to pixman_region32_contains_point
I do not think the conversion is specifically defined, but on my system and SirCmpwn's
the floats are rounded instead of floored, which is incorrect in this case, since
for a range from 0 to 256, any value greater or equal to 0 and less than 256 is valid.
I.e. [0;256[, or 0 <= x < 256, but if x is e.g. -0.1, then it will be rounded to 0, which
is invalid. The correct behavior would be to floor to -1.
2018-09-18 13:05:44 +02:00
Las 6367e0bc93 Add wlr_surface::input_region member
This is analogous to the opaque_region member.

In addition the code for setting the opaque region is cleaned up.
2018-09-18 10:14:33 +02:00
emersion 16d7e09d99 surface: add wlr_surface_role.precommit
This allows to emit the unmap event before the surface becomes
actually unmapped for most shells.
2018-07-15 19:30:19 +01:00
emersion 5bb272d7f3 surface: add wlr_surface.opaque_region 2018-07-13 10:54:51 +01:00
Drew DeVault c0b4217fce
Merge pull request #1116 from emersion/surface-role
surface: replace wlr_surface_set_role_committed with wlr_surface_role
2018-07-11 15:27:42 -07:00
emersion 7cbef15206
util: add wlr_ prefix to log symbols 2018-07-09 22:49:54 +01:00
emersion deeca53e33
Rename wl_resources to resource, wl_global to global 2018-07-08 19:21:31 +01:00
emersion 33db4263a0
surface: replace wlr_surface_set_role_committed with wlr_surface_role 2018-07-07 22:45:16 +01:00
emersion 515d682312
surface: fix damage when moving subsurfaces with scale > 1 2018-07-04 19:16:16 +01:00
emersion e665a74122
surface: don't clip input and opaque regions
These can be set to e.g. regions larger than the surface. If the
surface resizes itself, it doesn't need to set again these regions.
2018-07-04 19:12:18 +01:00
emersion 226306ed45
surface: rename wlr_surface_state.buffer to buffer_resource 2018-07-04 19:12:18 +01:00
emersion 68c133da2f
surface: fix crash on NULL commit 2018-07-04 19:12:18 +01:00
emersion 6f0eb11024
surface: fix previous state eating current state resources 2018-07-04 19:12:18 +01:00
emersion 012e38fbe5
surface: add wlr_surface.previous 2018-07-04 19:12:18 +01:00
emersion 78555abba3
surface: move position and scale out of wlr_surface_state 2018-07-04 19:12:17 +01:00
emersion 233bfe2f4f
surface: do not monkey-patch state damage 2018-07-04 19:12:17 +01:00
emersion adf0423f7c
surface: better buffer position handling 2018-07-04 19:12:17 +01:00
emersion 3c0d672ebd
surface: make pending and current embedded structs 2018-07-04 19:12:17 +01:00
emersion 64836ddfe7
surface: remove wlr_surface_state.subsurface_position 2018-07-04 19:12:17 +01:00
emersion 3ee86b6105
surface: rename invalid state 2018-07-04 19:12:16 +01:00
Ilia Bozhinov 00ccf5c3ae properly check if the point is inside the surface in wlr_surface_point_accepts_input 2018-07-03 10:29:02 +03:00
Dominique Martinet c263f7ca29 s/wlr_subsurface_from_surface/wlr_subsurface_from_wlr_surface/
This was the only x_from_wlr_surface function that lacked the wlr_ prefix,
let's have an API as uniform as possible.
2018-06-30 21:21:13 +09:00
emersion a6c0e25d36
surface: remove wlr_frame_callback
This removes the need to allocate a structure for frame callbacks.
wl_resource_get_link is used instead.
2018-06-20 20:00:23 +01:00
emersion 843621714f
surface: fix double wl_buffer.release events
Prior to this commit, we re-uploaded the buffer even if a new one
wasn't attached. After uploading, we send wl_buffer.release. So,
this sequence of requests resulted in a double release:

    surface.attach(buffer, 0, 0)
    surface.commit()
    <- buffer.release()
    surface.commit()
    <- buffer.release()
2018-06-17 12:49:34 +01:00
emersion 0378d143d9
surface: remove wlr_surface.texture
The texture is managed by the surface's wlr_buffer now. In
particular, the buffer can destroy the texture early if it becomes
invalid.
2018-06-13 19:38:10 +01:00
emersion e4933ab445
Introduce wlr_buffer 2018-06-08 20:06:13 +01:00
Dominique Martinet c6821f3dd3 wlr_surface: insert subsurfaces in revert order
sibling surfaces were drawn in incorrect order (e.g. latest below).
This attempts to fix that by reverting the order of the list.
2018-06-05 21:02:42 +09:00
Dominique Martinet cf9b8c0a8c wlr_surface_get_root_surface: walk up parent
This would dead-loop and never walk up if called on a subsurface
2018-06-05 00:17:58 +09:00
Markus Ongyerth 7b07b3f95d Fix type in wlr_surface_get_extends 2018-06-01 16:36:04 +02:00
Markus Ongyerth 3994762ae0 Add wlr_surface_get_geometry
This function defaults and clips the xdg-surface geometry to the
bounding box of the surface + its subsurfaces, as specified by the
protocol spec.
2018-06-01 15:21:18 +02:00
Genki Sky d1cf9acbd5 cleanup: Use void for zero-parameter functions
Signed-off-by: Genki Sky <sky@genki.is>
2018-05-30 20:19:16 -04:00
emersion 28020ff577
Only allow one modifier per DMA-BUF, split attributes struct in render/ 2018-05-30 09:29:12 +01:00
emersion da504f9253
surface: remove wl_resource_post_event 2018-05-26 19:43:55 +01:00
emersion 6d569def6d
compositor, surface: correctly destroy resources 2018-05-03 18:45:30 +01:00
emersion 43012f3740
compositor: redesign how resources are managed
All public resource creators now take a new ID for the resource
and an optional list where the resource link is added. When the
resource is destroyed it is its own responsibility to remove
itself from the list. This removes the need for the caller to add
a destroy listener.

This commit fixes a few segfaults with resources not removed from
the list when destroyed.
2018-04-26 17:51:06 +01:00
Drew DeVault fecb971518
Merge pull request #902 from emersion/various-memory-leaks
Various memory leaks
2018-04-26 11:34:49 +02:00
emersion 449f06556a
Destroy wlr_surface with wlr_renderer 2018-04-26 00:11:36 +01:00
emersion d47713ac0f
compositor: destroy subsurface resources with wlr_subcompositor 2018-04-25 23:53:44 +01:00
emersion 625a7a48dc
Don't use the wlr_ prefix for static functions 2018-04-25 23:51:00 +01:00
emersion b0d99f5c67
Remove wlr_ prefix from local symbols 2018-04-25 23:00:46 +01:00
emersion fa84b267e0
Remove wlr_surface::subsurface 2018-04-21 18:40:25 +01:00
emersion 4a9a9eae9a
Add surface iterators 2018-04-05 14:18:17 -04:00