From 51204b33c18b6f7c248f558fbaeb7198efb32900 Mon Sep 17 00:00:00 2001 From: David Eklov Date: Mon, 4 Jul 2016 16:53:03 -0500 Subject: Enable backgrounds and panels to be shell surfaces Prior to this commit all windows (e.g. shell surfaces) were handled the same way in handle_view_created. Since backgrounds and panels have to be treated differently, they could not be shell surfaces. This changes checks whether a client is a background or a panel in handle_view_created and exists to let them be dealt with elsewhere. --- include/extensions.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/extensions.h b/include/extensions.h index 158a40a2..dbd8f625 100644 --- a/include/extensions.h +++ b/include/extensions.h @@ -11,6 +11,8 @@ struct background_config { wlc_resource surface; // we need the wl_resource of the surface in the destructor struct wl_resource *wl_surface_res; + // used to determine if client is a background + struct wl_client *client; }; struct panel_config { @@ -21,6 +23,8 @@ struct panel_config { // we need the wl_resource of the surface in the destructor struct wl_resource *wl_surface_res; enum desktop_shell_panel_position panel_position; + // used to determine if client is a panel + struct wl_client *client; }; struct desktop_shell_state { -- cgit v1.2.3 From bb35960e652f98a882ed3cd2d1968b860942b896 Mon Sep 17 00:00:00 2001 From: David Eklov Date: Mon, 4 Jul 2016 17:01:37 -0500 Subject: Move code to make a window a shell surface into seperate function --- include/client/window.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/client/window.h b/include/client/window.h index eff9032d..e48ec4f3 100644 --- a/include/client/window.h +++ b/include/client/window.h @@ -42,5 +42,6 @@ struct window *window_setup(struct registry *registry, uint32_t width, uint32_t void window_teardown(struct window *state); int window_prerender(struct window *state); int window_render(struct window *state); +void window_make_shell(struct window *window); #endif -- cgit v1.2.3 From d9bcea381a69ebc6367aede7816b8e27d5fc9417 Mon Sep 17 00:00:00 2001 From: David Eklov Date: Mon, 4 Jul 2016 22:18:56 -0500 Subject: Fix formatting guide violations (spaces instead of tabs) --- include/extensions.h | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'include') diff --git a/include/extensions.h b/include/extensions.h index dbd8f625..7c508b5e 100644 --- a/include/extensions.h +++ b/include/extensions.h @@ -7,37 +7,37 @@ #include "list.h" struct background_config { - wlc_handle output; - wlc_resource surface; - // we need the wl_resource of the surface in the destructor - struct wl_resource *wl_surface_res; - // used to determine if client is a background + wlc_handle output; + wlc_resource surface; + // we need the wl_resource of the surface in the destructor + struct wl_resource *wl_surface_res; + // used to determine if client is a background struct wl_client *client; }; struct panel_config { - // wayland resource used in callbacks, is used to track this panel - struct wl_resource *wl_resource; - wlc_handle output; - wlc_resource surface; - // we need the wl_resource of the surface in the destructor - struct wl_resource *wl_surface_res; - enum desktop_shell_panel_position panel_position; - // used to determine if client is a panel + // wayland resource used in callbacks, is used to track this panel + struct wl_resource *wl_resource; + wlc_handle output; + wlc_resource surface; + // we need the wl_resource of the surface in the destructor + struct wl_resource *wl_surface_res; + enum desktop_shell_panel_position panel_position; + // used to determine if client is a panel struct wl_client *client; }; struct desktop_shell_state { - list_t *backgrounds; - list_t *panels; - list_t *lock_surfaces; - bool is_locked; + list_t *backgrounds; + list_t *panels; + list_t *lock_surfaces; + bool is_locked; }; struct swaylock_state { - bool active; - wlc_handle output; - wlc_resource surface; + bool active; + wlc_handle output; + wlc_resource surface; }; extern struct desktop_shell_state desktop_shell; -- cgit v1.2.3