From 52420cc24d61db8d22cf0d391f1f84b37bf087d5 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Mon, 16 Apr 2018 20:36:40 +1000 Subject: Implement fullscreen. --- include/sway/ipc-server.h | 1 + include/sway/tree/container.h | 4 ++++ include/sway/tree/view.h | 9 +++++++++ 3 files changed, 14 insertions(+) (limited to 'include') diff --git a/include/sway/ipc-server.h b/include/sway/ipc-server.h index c3389fe8..dd16a175 100644 --- a/include/sway/ipc-server.h +++ b/include/sway/ipc-server.h @@ -1,6 +1,7 @@ #ifndef _SWAY_IPC_SERVER_H #define _SWAY_IPC_SERVER_H #include +#include "sway/config.h" #include "sway/tree/container.h" #include "ipc.h" diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 2a8b8aba..22bd7240 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h @@ -72,9 +72,13 @@ struct sway_container { // For C_OUTPUT, this is the output position in layout coordinates // For other types, this is the position in output-local coordinates double x, y; + double saved_x, saved_y; // does not include borders or gaps. double width, height; + // For C_WORKSPACE only + struct sway_view *fullscreen; + list_t *children; struct sway_container *parent; diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index b51c54b5..73d5f6c7 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h @@ -28,6 +28,7 @@ struct sway_view_impl { void (*configure)(struct sway_view *view, double ox, double oy, int width, int height); void (*set_activated)(struct sway_view *view, bool activated); + void (*set_fullscreen)(struct sway_view *view, bool fullscreen); void (*for_each_surface)(struct sway_view *view, wlr_surface_iterator_func_t iterator, void *user_data); void (*close)(struct sway_view *view); @@ -41,6 +42,8 @@ struct sway_view { struct sway_container *swayc; // NULL for unmanaged views struct wlr_surface *surface; // NULL for unmapped views int width, height; + int saved_width, saved_height; + bool is_fullscreen; union { struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6; @@ -63,6 +66,7 @@ struct sway_xdg_shell_v6_view { struct wl_listener request_move; struct wl_listener request_resize; struct wl_listener request_maximize; + struct wl_listener request_fullscreen; struct wl_listener new_popup; struct wl_listener map; struct wl_listener unmap; @@ -79,6 +83,7 @@ struct sway_xwayland_view { struct wl_listener request_resize; struct wl_listener request_maximize; struct wl_listener request_configure; + struct wl_listener request_fullscreen; struct wl_listener map; struct wl_listener unmap; struct wl_listener destroy; @@ -93,6 +98,7 @@ struct sway_xwayland_unmanaged { int lx, ly; struct wl_listener request_configure; + struct wl_listener request_fullscreen; struct wl_listener commit; struct wl_listener map; struct wl_listener unmap; @@ -106,6 +112,7 @@ struct sway_wl_shell_view { struct wl_listener request_move; struct wl_listener request_resize; struct wl_listener request_maximize; + struct wl_listener request_fullscreen; struct wl_listener destroy; int pending_width, pending_height; @@ -155,6 +162,8 @@ void view_configure(struct sway_view *view, double ox, double oy, int width, void view_set_activated(struct sway_view *view, bool activated); +void view_set_fullscreen(struct sway_view *view, bool fullscreen); + void view_close(struct sway_view *view); void view_damage(struct sway_view *view, bool whole); -- cgit v1.2.3 From bfd5834f4c1046c234ceaae212e65e045cd51460 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Tue, 17 Apr 2018 08:11:50 +1000 Subject: Feedback for fullscreen. --- include/sway/tree/container.h | 1 - include/sway/tree/view.h | 1 - 2 files changed, 2 deletions(-) (limited to 'include') diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 22bd7240..0283584b 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h @@ -72,7 +72,6 @@ struct sway_container { // For C_OUTPUT, this is the output position in layout coordinates // For other types, this is the position in output-local coordinates double x, y; - double saved_x, saved_y; // does not include borders or gaps. double width, height; diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 73d5f6c7..9dfd171f 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h @@ -42,7 +42,6 @@ struct sway_view { struct sway_container *swayc; // NULL for unmanaged views struct wlr_surface *surface; // NULL for unmapped views int width, height; - int saved_width, saved_height; bool is_fullscreen; union { -- cgit v1.2.3 From c685ef081f090d1e15428f55426e02f2274312d0 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Tue, 17 Apr 2018 09:31:34 +1000 Subject: Create sway_workspace struct. --- include/sway/tree/container.h | 5 ++--- include/sway/tree/workspace.h | 7 +++++++ 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 0283584b..6efda72f 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h @@ -45,6 +45,7 @@ enum sway_container_border { struct sway_root; struct sway_output; +struct sway_workspace; struct sway_view; struct sway_container { @@ -52,6 +53,7 @@ struct sway_container { // TODO: Encapsulate state for other node types as well like C_CONTAINER struct sway_root *sway_root; struct sway_output *sway_output; + struct sway_workspace *sway_workspace; struct sway_view *sway_view; }; @@ -75,9 +77,6 @@ struct sway_container { // does not include borders or gaps. double width, height; - // For C_WORKSPACE only - struct sway_view *fullscreen; - list_t *children; struct sway_container *parent; diff --git a/include/sway/tree/workspace.h b/include/sway/tree/workspace.h index 8d49fefb..35e1df3b 100644 --- a/include/sway/tree/workspace.h +++ b/include/sway/tree/workspace.h @@ -3,6 +3,13 @@ #include "sway/tree/container.h" +struct sway_view; + +struct sway_workspace { + struct sway_container *swayc; + struct sway_view *fullscreen; +}; + extern char *prev_workspace_name; char *workspace_next_name(const char *output_name); -- cgit v1.2.3 From 72beae209b03815e39d0aaa11348fa17c8a7bca9 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Wed, 18 Apr 2018 00:10:32 +1000 Subject: Fullscreen fixes. --- include/sway/tree/view.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 9dfd171f..648a74c4 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h @@ -112,6 +112,7 @@ struct sway_wl_shell_view { struct wl_listener request_resize; struct wl_listener request_maximize; struct wl_listener request_fullscreen; + struct wl_listener set_state; struct wl_listener destroy; int pending_width, pending_height; -- cgit v1.2.3