Commit Graph

111 Commits

Author SHA1 Message Date
Kirill Primak c09d3450d4 compositor: enforce surface destruction order 2022-11-06 17:00:00 +03:00
Kirill Primak 099b9de752 compositor: drop role object NULL checks in handlers
Instead, move the check to the caller.
2022-11-06 17:00:00 +03:00
Kirill Primak 756260ac05 compositor: introduce wlr_surface_destroy_role_object() 2022-11-06 14:16:05 +03:00
Kirill Primak 3abedaf211 subcompositor: move+rename subsurface_parent_commit() 2022-09-12 18:44:36 +00:00
Alexander Orzechowski 138d21464d wlr_compositor: Don't leak region32 when calculating opaque region 2022-08-30 03:03:21 -04:00
Alexander Orzechowski 525506559a wlr_compositor: Use wlr_fbox_equal 2022-08-25 19:00:13 -04:00
Alexander Orzechowski ef4baea0e2 Use wl_signal_emit_mutable 2022-08-18 07:16:16 -04:00
Simon Ser c2359d0321 surface: implement wl_surface.offset
References: https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/123
2022-08-12 11:27:33 +02:00
Simon Ser 42d68d7532 surface: add WLR_SURFACE_STATE_OFFSET
This indicates whether the surface offset has changed.
2022-08-12 11:20:44 +02:00
Simon Ser 29291cb47c render/texture: drop wlr_texture_is_opaque
Whether a texture is opaque or not doesn't depend on the renderer
at all, it just depends on the source buffer. Instead of forcing
all renderers to implement wlr_texture_impl.is_opaque, let's move
this in common code and use the wlr_buffer format to know whether
a texture will be opaque.
2022-06-16 14:43:24 +02:00
Simon Ser 18595000f3 compositor: send WL_SURFACE_ERROR_INVALID_SIZE for non-cursor surfaces
See the discussion at [1]: there's no easy way to fix libwayland-cursor
without a new API. Sending the error for other roles will prevent the
same client bug from appearing elsewhere.

[1]: https://gitlab.freedesktop.org/wayland/wayland/-/issues/194
2022-06-01 12:56:42 +00:00
Simon Ser 6c350799b2 Zero-initialize structs in init functions
Ensures there is no field left to its previous undefined value after
calling an init function.
2022-04-28 10:09:50 +02:00
Kirill Primak da2491d416 compositor: damage the whole buffer on viewport src change
wp_viewporter protocol doesn't seem to say anything about damage, but
Firefox assumes that wp_viewport::set_source alone is enough to damage
the whole surface, and that assumption kinda makes sense, so let's do
that.
2022-01-22 12:09:48 +03:00
Simon Ser 1d1b845410 subcompositor: destroy subsurface with parent
When the parent surface is destroyed, also destroy the child
wl_subsurface. No need to handle the wlr_subsurface.parent == NULL
case anymore.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/1709
2022-01-20 15:18:10 +00:00
Kirill Primak 50827ed7f5 surface: improve role precommit hook
Now the role precommit hook is called before the commit, not on
wl_surface.commit request, and takes a state which is to be applied.
2022-01-13 15:15:54 +03:00
Kirill Primak 617eb4fb93 surface: deprecate wlr_surface.h 2022-01-13 10:06:41 +00:00
Kirill Primak 36b5d5888c surface: move impl to types/wlr_{sub,}compositor.c 2022-01-13 10:06:41 +00:00
Kirill Primak b6f43ab2e1 subcompositor: split out from compositor 2022-01-13 10:06:41 +00:00
Simon Ser 7cbcc65ad0 surface: make wlr_subsurface_create private
Same as [1], but for wlr_subsurface.

[1]: https://github.com/swaywm/wlroots/pull/2814
2021-06-29 10:32:17 -04:00
Simon Ser a9e5df44d8 surface: remove resource_list arg from surface_create
This is never used.
2021-04-06 14:57:44 +02:00
Simon Ser c430cd7d53 surface: make wlr_surface_create private
This is not meant to be exposed in the public API, just like
wlr_region_create [1].

[1]: https://github.com/swaywm/wlroots/pull/2662
2021-04-06 14:57:44 +02:00
Simon Ser a39dc1f7a8 region: remove resource_list arg from region_create
This is never used.
2021-02-02 23:42:53 +01:00
Simon Ser 45f992b27b region: make wlr_region_create private
This function should only be called from the handler for
wl_compositor.create_region requests.
2021-02-02 23:42:53 +01:00
Antonin Décimo d9bb792794 Fix incorrect format parameters 2020-07-27 10:49:19 +02:00
Simon Ser 5cde35923c Simplify globals implementation by removing destructors
Some globals are static and it doesn't make sense to destroy them before
the wl_display. For instance, wl_compositor should be created before the
display is started and shouldn't be destroyed.

For these globals, we can simplify the code by removing the destructor
and stop keeping track of wl_resources (these will be destroyed with the
wl_display by libwayland).
2019-11-25 09:01:46 -05:00
Simon Ser c808613287 compositor: disconnect client on OOM in create_surface 2019-09-18 11:28:15 +12:00
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.
2019-07-27 15:49:32 -04: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
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 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
emersion d47713ac0f
compositor: destroy subsurface resources with wlr_subcompositor 2018-04-25 23:53:44 +01:00
emersion 89a9c96fab
compositor: make wlr_compositor_destroy destroy resources 2018-04-25 23:53:44 +01:00
emersion 38064f1d18
Fix protocol error when a client destroys and re-creates a subsurface 2018-04-23 21:50:15 +01:00
emersion bfcd3f3707
Add wlr_subcompositor 2018-04-21 19:02:39 +01:00
emersion fa84b267e0
Remove wlr_surface::subsurface 2018-04-21 18:40:25 +01:00
emersion aced024819
Add wlr_surface_is_subsurface and wlr_subsurface_from_surface 2018-04-05 14:00:53 -04:00
emersion d16127b3cb
Fix wlr_surface_subsurface_at, change it to be wlr_surface_surface_at 2018-04-04 16:48:23 -04:00
emersion b1e2718dd7
xwayland: fix some use-after-free in xwm 2018-02-23 10:20:53 +01:00
Drew DeVault 1d9be89e2d
Revert "ELF Visibility" 2018-02-19 18:01:27 -05:00
Scott Anderson 86269052eb Explicitly export EFL symbols 2018-02-19 14:26:40 +13:00
emersion 392d54a35d
Wrap wl_resource_get_user_data into safer helper functions
This ensures we're not incorrectly casting a resource.

Fixes #628
2018-02-13 23:48:46 +01:00
emersion c2e1474010
Reformat all #include directives 2018-02-12 21:29:23 +01:00
emersion 36ead80cd1
Make wlr_signal_emit_safe private 2018-02-12 19:52:47 +01:00
emersion 5e58d46cc1
Add wlr_signal_emit_safe 2018-02-12 09:12:31 +01:00
emersion eeffe11337
surface: add wlr_surface new_subsurface and wlr_subsurface destroy events 2018-01-21 14:22:33 +01:00
emersion c7900663bc
Add display destroy listener to data device 2017-12-07 00:50:55 +01:00
emersion e6d2e72401
Remove display destroy listeners, add compositor listener 2017-12-07 00:44:45 +01:00
emersion f8de7aa0fd
Add checks for wl_resource_create 2017-11-02 23:14:24 +01:00
emersion 4952a633ca
Remove interface version checks 2017-10-22 11:18:27 +02:00
Tony Crisci 19e30aab9b subcompositor protocol errors 2017-09-30 08:55:40 -04:00
Tony Crisci 68eeebc647 subsurface implementation stubs 2017-09-30 08:55:40 -04:00
Tony Crisci 78cd62a663 publish subcompositor global 2017-09-30 08:55:40 -04:00
Tony Crisci a4196fd9c9 cleanup wlr_compositor.c 2017-09-30 08:55:40 -04:00
Dominique Martinet 3391e5b634 xwayland: fix style issues 2017-08-23 22:03:49 +02:00
Dominique Martinet 3cc5b1acc6 wlr_compositor: add signal for create_surface 2017-08-23 22:03:49 +02:00
Dominique Martinet 1ca08dc4cb wlr_compositor: change _init/finish to _create/destroy 2017-08-19 23:17:39 +02:00
Dominique Martinet 4110788159 move wl_compositor into wlroots as wlr_compositor 2017-08-19 21:56:51 +02:00
Renamed from examples/compositor/wl_compositor.c (Browse further)