Simon Ser
7fc58e704a
surface: don't unref the current buffer on failure
...
If wlr_buffer_create fails, keep the previous buffer.
5 years ago
Alynx Zhou
aa9ea95e1f
Skip assign when sub_x or sub_y is NULL in wlr_surface_surface_at
5 years ago
Antonin Décimo
8f3d73e3a3
wlr_surface: condition is always false
5 years ago
Simon Ser
ca45f4490c
Remove all wayland-server.h includes
...
The documentation for wayland-server.h says:
> Use of this header file is discouraged. Prefer including
> wayland-server-core.h instead, which does not include the server protocol
> header and as such only defines the library PI, excluding the deprecated API
> below.
Replacing wayland-server.h with wayland-server-core.h allows us to drop the
WL_HIDE_DEPRECATED declaration.
5 years ago
emersion
943e918a96
subsurface: add map/unmap events
...
Fixes https://github.com/swaywm/wlroots/issues/1414
6 years ago
emersion
d238cc9f56
surface: error out on invalid transform
6 years ago
Sebastian Krzyszkowiak
69b9e2ae8f
Post protocol error on invalid wl_surface scale
...
Letting the scale be set to 0 causes division by zero errors.
6 years ago
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
6 years ago
Drew DeVault
d7b010024a
Merge pull request #1261 from arandomhuman/damage-control
...
Fix damage tracking for surfaces with transforms
6 years ago
emersion
dec303bea6
surface: fix wlr_surface_get_effective_damage to give surface coords
...
Transforms were applied, but scale wasn't.
6 years ago
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.
6 years ago
random human
84ecfb546b
wlr_surface: more consistent argument naming in surface_update_damage
6 years ago
random human
5eca5d8946
wlr_surface: remove duplicated damage calculation
...
The damage is already calculated and stored in surface->buffer_damage
by surface_update_damage().
6 years ago
random human
3fd5da58a0
wlr_surface: fix surface damage on resize
...
Instead of damaging the buffer, damage only the surface on surface (not
buffer) resize.
6 years ago
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.
6 years ago
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.
6 years ago
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.
6 years ago
emersion
16d7e09d99
surface: add wlr_surface_role.precommit
...
This allows to emit the unmap event before the surface becomes
actually unmapped for most shells.
7 years ago
emersion
5bb272d7f3
surface: add wlr_surface.opaque_region
7 years ago
Drew DeVault
c0b4217fce
Merge pull request #1116 from emersion/surface-role
...
surface: replace wlr_surface_set_role_committed with wlr_surface_role
7 years ago
emersion
7cbef15206
util: add wlr_ prefix to log symbols
7 years ago
emersion
deeca53e33
Rename wl_resources to resource, wl_global to global
7 years ago
emersion
33db4263a0
surface: replace wlr_surface_set_role_committed with wlr_surface_role
7 years ago
emersion
515d682312
surface: fix damage when moving subsurfaces with scale > 1
7 years ago
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.
7 years ago
emersion
226306ed45
surface: rename wlr_surface_state.buffer to buffer_resource
7 years ago
emersion
68c133da2f
surface: fix crash on NULL commit
7 years ago
emersion
6f0eb11024
surface: fix previous state eating current state resources
7 years ago
emersion
012e38fbe5
surface: add wlr_surface.previous
7 years ago
emersion
78555abba3
surface: move position and scale out of wlr_surface_state
7 years ago
emersion
233bfe2f4f
surface: do not monkey-patch state damage
7 years ago
emersion
adf0423f7c
surface: better buffer position handling
7 years ago
emersion
3c0d672ebd
surface: make pending and current embedded structs
7 years ago
emersion
64836ddfe7
surface: remove wlr_surface_state.subsurface_position
7 years ago
emersion
3ee86b6105
surface: rename invalid state
7 years ago
Ilia Bozhinov
00ccf5c3ae
properly check if the point is inside the surface in wlr_surface_point_accepts_input
7 years ago
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.
7 years ago
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.
7 years ago
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()
7 years ago
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.
7 years ago
emersion
e4933ab445
Introduce wlr_buffer
7 years ago
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.
7 years ago
Dominique Martinet
cf9b8c0a8c
wlr_surface_get_root_surface: walk up parent
...
This would dead-loop and never walk up if called on a subsurface
7 years ago
Markus Ongyerth
7b07b3f95d
Fix type in wlr_surface_get_extends
7 years ago
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.
7 years ago
Genki Sky
d1cf9acbd5
cleanup: Use void for zero-parameter functions
...
Signed-off-by: Genki Sky <sky@genki.is>
7 years ago
emersion
28020ff577
Only allow one modifier per DMA-BUF, split attributes struct in render/
7 years ago
emersion
da504f9253
surface: remove wl_resource_post_event
7 years ago
emersion
6d569def6d
compositor, surface: correctly destroy resources
7 years ago
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.
7 years ago