diff options
author | Tony Crisci <tony@dubstepdish.com> | 2018-03-17 10:00:54 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-17 10:00:54 -0400 |
commit | 09413aa7f1eab176c12675217a17ebe367fa7d8f (patch) | |
tree | d97059ac24cefd144db7c7789461106a1f70b9c5 /include | |
parent | 9cc875429b40e2567b219f8e9ffd23316d136204 (diff) | |
parent | 303883ce49b81438c8653991f40e72b0481e27cf (diff) |
Merge pull request #711 from emersion/map-unmap
Add map/unmap to xdg-shell
Diffstat (limited to 'include')
-rw-r--r-- | include/rootston/desktop.h | 6 | ||||
-rw-r--r-- | include/rootston/seat.h | 1 | ||||
-rw-r--r-- | include/rootston/view.h | 7 | ||||
-rw-r--r-- | include/wlr/types/wlr_xdg_shell.h | 33 | ||||
-rw-r--r-- | include/wlr/types/wlr_xdg_shell_v6.h | 33 |
5 files changed, 37 insertions, 43 deletions
diff --git a/include/rootston/desktop.h b/include/rootston/desktop.h index db8a088e..5986c96f 100644 --- a/include/rootston/desktop.h +++ b/include/rootston/desktop.h @@ -73,14 +73,16 @@ struct roots_output *desktop_output_from_wlr_output( struct roots_view *desktop_view_at(struct roots_desktop *desktop, double lx, double ly, struct wlr_surface **surface, double *sx, double *sy); -void view_init(struct roots_view *view, struct roots_desktop *desktop); -void view_finish(struct roots_view *view); +struct roots_view *view_create(struct roots_desktop *desktop); +void view_destroy(struct roots_view *view); void view_activate(struct roots_view *view, bool activate); void view_apply_damage(struct roots_view *view); void view_damage_whole(struct roots_view *view); void view_update_position(struct roots_view *view, double x, double y); void view_update_size(struct roots_view *view, uint32_t width, uint32_t height); void view_initial_focus(struct roots_view *view); +void view_map(struct roots_view *view, struct wlr_surface *surface); +void view_unmap(struct roots_view *view); void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data); void handle_xdg_shell_surface(struct wl_listener *listener, void *data); diff --git a/include/rootston/seat.h b/include/rootston/seat.h index cc0293b5..0b1dbe2d 100644 --- a/include/rootston/seat.h +++ b/include/rootston/seat.h @@ -39,6 +39,7 @@ struct roots_seat_view { struct wl_list link; // roots_seat::views + struct wl_listener view_unmap; struct wl_listener view_destroy; }; diff --git a/include/rootston/view.h b/include/rootston/view.h index ff5ef44a..775f3d11 100644 --- a/include/rootston/view.h +++ b/include/rootston/view.h @@ -27,6 +27,8 @@ struct roots_xdg_surface_v6 { struct wl_listener destroy; struct wl_listener new_popup; + struct wl_listener map; + struct wl_listener unmap; struct wl_listener request_move; struct wl_listener request_resize; struct wl_listener request_maximize; @@ -42,6 +44,8 @@ struct roots_xdg_surface { struct wl_listener destroy; struct wl_listener new_popup; + struct wl_listener map; + struct wl_listener unmap; struct wl_listener request_move; struct wl_listener request_resize; struct wl_listener request_maximize; @@ -128,6 +132,7 @@ struct roots_view { struct wl_listener new_subsurface; struct { + struct wl_signal unmap; struct wl_signal destroy; } events; @@ -140,6 +145,7 @@ struct roots_view { void (*maximize)(struct roots_view *view, bool maximized); void (*set_fullscreen)(struct roots_view *view, bool fullscreen); void (*close)(struct roots_view *view); + void (*destroy)(struct roots_view *view); }; struct roots_view_child { @@ -181,7 +187,6 @@ struct roots_xdg_popup { struct wl_listener new_popup; }; -struct roots_view *view_create(); void view_get_box(const struct roots_view *view, struct wlr_box *box); void view_activate(struct roots_view *view, bool active); void view_move(struct roots_view *view, double x, double y); diff --git a/include/wlr/types/wlr_xdg_shell.h b/include/wlr/types/wlr_xdg_shell.h index 8422863c..ad0a626f 100644 --- a/include/wlr/types/wlr_xdg_shell.h +++ b/include/wlr/types/wlr_xdg_shell.h @@ -62,19 +62,10 @@ enum wlr_xdg_surface_role { }; struct wlr_xdg_toplevel_state { - bool maximized; - bool fullscreen; - bool resizing; - bool activated; - - uint32_t width; - uint32_t height; - - uint32_t max_width; - uint32_t max_height; - - uint32_t min_width; - uint32_t min_height; + bool maximized, fullscreen, resizing, activated; + uint32_t width, height; + uint32_t max_width, max_height; + uint32_t min_width, min_height; }; struct wlr_xdg_toplevel { @@ -90,7 +81,8 @@ struct wlr_xdg_toplevel { struct wlr_xdg_surface_configure { struct wl_list link; // wlr_xdg_surface::configure_list uint32_t serial; - struct wlr_xdg_toplevel_state state; + + struct wlr_xdg_toplevel_state *toplevel_state; }; struct wlr_xdg_surface { @@ -101,14 +93,13 @@ struct wlr_xdg_surface { enum wlr_xdg_surface_role role; union { - struct wlr_xdg_toplevel *toplevel_state; - struct wlr_xdg_popup *popup_state; + struct wlr_xdg_toplevel *toplevel; + struct wlr_xdg_popup *popup; }; struct wl_list popups; // wlr_xdg_popup::link - bool configured; - bool added; + bool added, configured, mapped; uint32_t configure_serial; struct wl_event_source *configure_idle; uint32_t configure_next_serial; @@ -118,8 +109,8 @@ struct wlr_xdg_surface { char *app_id; bool has_next_geometry; - struct wlr_box *next_geometry; - struct wlr_box *geometry; + struct wlr_box next_geometry; + struct wlr_box geometry; struct wl_listener surface_destroy_listener; @@ -127,6 +118,8 @@ struct wlr_xdg_surface { struct wl_signal destroy; struct wl_signal ping_timeout; struct wl_signal new_popup; + struct wl_signal map; + struct wl_signal unmap; struct wl_signal request_maximize; struct wl_signal request_fullscreen; diff --git a/include/wlr/types/wlr_xdg_shell_v6.h b/include/wlr/types/wlr_xdg_shell_v6.h index 7dc746ce..d8503d28 100644 --- a/include/wlr/types/wlr_xdg_shell_v6.h +++ b/include/wlr/types/wlr_xdg_shell_v6.h @@ -62,19 +62,10 @@ enum wlr_xdg_surface_v6_role { }; struct wlr_xdg_toplevel_v6_state { - bool maximized; - bool fullscreen; - bool resizing; - bool activated; - - uint32_t width; - uint32_t height; - - uint32_t max_width; - uint32_t max_height; - - uint32_t min_width; - uint32_t min_height; + bool maximized, fullscreen, resizing, activated; + uint32_t width, height; + uint32_t max_width, max_height; + uint32_t min_width, min_height; }; struct wlr_xdg_toplevel_v6 { @@ -90,7 +81,8 @@ struct wlr_xdg_toplevel_v6 { struct wlr_xdg_surface_v6_configure { struct wl_list link; // wlr_xdg_surface_v6::configure_list uint32_t serial; - struct wlr_xdg_toplevel_v6_state state; + + struct wlr_xdg_toplevel_v6_state *toplevel_state; }; struct wlr_xdg_surface_v6 { @@ -101,14 +93,13 @@ struct wlr_xdg_surface_v6 { enum wlr_xdg_surface_v6_role role; union { - struct wlr_xdg_toplevel_v6 *toplevel_state; - struct wlr_xdg_popup_v6 *popup_state; + struct wlr_xdg_toplevel_v6 *toplevel; + struct wlr_xdg_popup_v6 *popup; }; struct wl_list popups; // wlr_xdg_popup_v6::link - bool configured; - bool added; + bool added, configured, mapped; uint32_t configure_serial; struct wl_event_source *configure_idle; uint32_t configure_next_serial; @@ -118,8 +109,8 @@ struct wlr_xdg_surface_v6 { char *app_id; bool has_next_geometry; - struct wlr_box *next_geometry; - struct wlr_box *geometry; + struct wlr_box next_geometry; + struct wlr_box geometry; struct wl_listener surface_destroy_listener; @@ -127,6 +118,8 @@ struct wlr_xdg_surface_v6 { struct wl_signal destroy; struct wl_signal ping_timeout; struct wl_signal new_popup; + struct wl_signal map; + struct wl_signal unmap; struct wl_signal request_maximize; struct wl_signal request_fullscreen; |