mirror of
https://github.com/labwc/labwc.git
synced 2025-11-30 06:59:52 -05:00
Remove view_impl->map and view_impl->unmap
jlindgren: data parameter to handle_unmap() is NULL
This commit is contained in:
parent
e96f4a032b
commit
3c0e010c58
4 changed files with 17 additions and 38 deletions
11
src/xdg.c
11
src/xdg.c
|
|
@ -743,8 +743,9 @@ set_initial_position(struct view *view)
|
|||
}
|
||||
|
||||
static void
|
||||
xdg_toplevel_view_map(struct view *view)
|
||||
handle_map(struct wl_listener *listener, void *data)
|
||||
{
|
||||
struct view *view = wl_container_of(listener, view, mappable.map);
|
||||
if (view->mapped) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -807,8 +808,9 @@ xdg_toplevel_view_map(struct view *view)
|
|||
}
|
||||
|
||||
static void
|
||||
xdg_toplevel_view_unmap(struct view *view)
|
||||
handle_unmap(struct wl_listener *listener, void *data)
|
||||
{
|
||||
struct view *view = wl_container_of(listener, view, mappable.unmap);
|
||||
if (view->mapped) {
|
||||
view->mapped = false;
|
||||
view_impl_unmap(view);
|
||||
|
|
@ -832,11 +834,9 @@ xdg_view_get_pid(struct view *view)
|
|||
static const struct view_impl xdg_toplevel_view_impl = {
|
||||
.configure = xdg_toplevel_view_configure,
|
||||
.close = xdg_toplevel_view_close,
|
||||
.map = xdg_toplevel_view_map,
|
||||
.set_activated = xdg_toplevel_view_set_activated,
|
||||
.set_fullscreen = xdg_toplevel_view_set_fullscreen,
|
||||
.notify_tiled = xdg_toplevel_view_notify_tiled,
|
||||
.unmap = xdg_toplevel_view_unmap,
|
||||
.maximize = xdg_toplevel_view_maximize,
|
||||
.minimize = xdg_toplevel_view_minimize,
|
||||
.get_parent = xdg_toplevel_view_get_parent,
|
||||
|
|
@ -1006,7 +1006,8 @@ handle_new_xdg_toplevel(struct wl_listener *listener, void *data)
|
|||
view->surface = xdg_surface->surface;
|
||||
view->surface->data = tree;
|
||||
|
||||
view_connect_map(view, xdg_surface->surface);
|
||||
mappable_connect(&view->mappable, xdg_surface->surface,
|
||||
handle_map, handle_unmap);
|
||||
|
||||
struct wlr_xdg_toplevel *toplevel = xdg_surface->toplevel;
|
||||
CONNECT_SIGNAL(toplevel, view, destroy);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue