mirror of
https://github.com/labwc/labwc.git
synced 2026-04-07 08:21:20 -04:00
view: manage view->surface lifetime via common view_set_surface()
- add new commit() function to view->impl table - add view_set_surface() which encapsulates: - setting view->surface - connecting/disconnecting map, unmap, and commit handlers For xwayland, view_set_surface() is called from associate/dissociate() handlers. This means that view->surface is now set slightly earlier, in associate() rather than map(). It's no longer necessary to have two separate cleanup paths depending on whether the wlr_surface or wlr_xwayland_surface is destroyed first, because wlroots calls dissociate() beforehand in either case. Also, view->content_tree is now destroyed and set to NULL at unmap. Previously, we relied on wlr_scene to destroy it automatically when the surface was destroyed, but kept a potentially dangling pointer in view->content_tree until next map. Similar change for unmanaged. v2: add assert v3: synthesize dissociate in set_override_redirect v4: rework scene node lifetimes v5: reduce asserts
This commit is contained in:
parent
b5e2eb216e
commit
21f425f11e
5 changed files with 60 additions and 63 deletions
|
|
@ -111,6 +111,7 @@ struct view_impl {
|
|||
void (*set_fullscreen)(struct view *view, bool fullscreen);
|
||||
void (*notify_tiled)(struct view *view);
|
||||
void (*unmap)(struct view *view);
|
||||
void (*commit)(struct view *view);
|
||||
void (*maximize)(struct view *view, enum view_axis maximized);
|
||||
void (*minimize)(struct view *view, bool minimize);
|
||||
struct view *(*get_parent)(struct view *self);
|
||||
|
|
@ -239,7 +240,6 @@ struct view {
|
|||
struct mappable mappable;
|
||||
|
||||
struct wl_listener destroy;
|
||||
struct wl_listener surface_destroy;
|
||||
struct wl_listener commit;
|
||||
struct wl_listener request_move;
|
||||
struct wl_listener request_resize;
|
||||
|
|
@ -584,7 +584,7 @@ void view_adjust_size(struct view *view, int *w, int *h);
|
|||
|
||||
void view_evacuate_region(struct view *view);
|
||||
void view_on_output_destroy(struct view *view);
|
||||
void view_connect_map(struct view *view, struct wlr_surface *surface);
|
||||
void view_set_surface(struct view *view, struct wlr_surface *surface);
|
||||
void view_update_visibility(struct view *view);
|
||||
|
||||
void view_init(struct view *view);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue