diff options
author | 2016-07-05 08:09:22 -0400 | |
---|---|---|
committer | 2016-07-05 08:09:22 -0400 | |
commit | 58804a044f782a397302173deb1416e47b3c3357 (patch) | |
tree | 9e155febd82e37ba6cb7b9e1b8ee7fda044d5147 /wayland/window.c | |
parent | Merge pull request #737 from zandrmartin/fix-bar-on-reload (diff) | |
parent | Fix formatting guide violations (spaces instead of tabs) (diff) | |
download | sway-58804a044f782a397302173deb1416e47b3c3357.tar.gz sway-58804a044f782a397302173deb1416e47b3c3357.tar.zst sway-58804a044f782a397302173deb1416e47b3c3357.zip |
Merge pull request #738 from deklov/panel-as-shell-02
Make swaybar and swaybg shell surfaces, take 2
Diffstat (limited to 'wayland/window.c')
-rw-r--r-- | wayland/window.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/wayland/window.c b/wayland/window.c index ba64cb60..7ca9e4ec 100644 --- a/wayland/window.c +++ b/wayland/window.c | |||
@@ -59,6 +59,12 @@ static const struct wl_shell_surface_listener surface_listener = { | |||
59 | .configure = shell_surface_configure | 59 | .configure = shell_surface_configure |
60 | }; | 60 | }; |
61 | 61 | ||
62 | void window_make_shell(struct window *window) { | ||
63 | window->shell_surface = wl_shell_get_shell_surface(window->registry->shell, window->surface); | ||
64 | wl_shell_surface_add_listener(window->shell_surface, &surface_listener, window); | ||
65 | wl_shell_surface_set_toplevel(window->shell_surface); | ||
66 | } | ||
67 | |||
62 | struct window *window_setup(struct registry *registry, uint32_t width, uint32_t height, bool shell_surface) { | 68 | struct window *window_setup(struct registry *registry, uint32_t width, uint32_t height, bool shell_surface) { |
63 | struct window *window = malloc(sizeof(struct window)); | 69 | struct window *window = malloc(sizeof(struct window)); |
64 | memset(window, 0, sizeof(struct window)); | 70 | memset(window, 0, sizeof(struct window)); |
@@ -69,9 +75,7 @@ struct window *window_setup(struct registry *registry, uint32_t width, uint32_t | |||
69 | 75 | ||
70 | window->surface = wl_compositor_create_surface(registry->compositor); | 76 | window->surface = wl_compositor_create_surface(registry->compositor); |
71 | if (shell_surface) { | 77 | if (shell_surface) { |
72 | window->shell_surface = wl_shell_get_shell_surface(registry->shell, window->surface); | 78 | window_make_shell(window); |
73 | wl_shell_surface_add_listener(window->shell_surface, &surface_listener, window); | ||
74 | wl_shell_surface_set_toplevel(window->shell_surface); | ||
75 | } | 79 | } |
76 | if (registry->pointer) { | 80 | if (registry->pointer) { |
77 | wl_pointer_add_listener(registry->pointer, &pointer_listener, window); | 81 | wl_pointer_add_listener(registry->pointer, &pointer_listener, window); |