Merge pull request #2268 from emersion/server-decoration-borders

Enable borders on floating SSD xdg-shell views
This commit is contained in:
Drew DeVault 2018-08-06 11:32:17 -04:00 committed by GitHub
commit d8b65193c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 153 additions and 11 deletions

17
include/sway/decoration.h Normal file
View file

@ -0,0 +1,17 @@
#ifndef _SWAY_DECORATION_H
#define _SWAY_DECORATION_H
#include <wlr/types/wlr_server_decoration.h>
struct sway_server_decoration {
struct wlr_server_decoration *wlr_server_decoration;
struct wl_list link;
struct wl_listener destroy;
struct wl_listener mode;
};
struct sway_server_decoration *decoration_from_surface(
struct wlr_surface *surface);
#endif

View file

@ -4,12 +4,13 @@
#include <wayland-server.h>
#include <wlr/backend.h>
#include <wlr/backend/session.h>
#include <wlr/render/wlr_renderer.h>
#include <wlr/types/wlr_compositor.h>
#include <wlr/types/wlr_data_device.h>
#include <wlr/types/wlr_layer_shell.h>
#include <wlr/types/wlr_server_decoration.h>
#include <wlr/types/wlr_xdg_shell_v6.h>
#include <wlr/types/wlr_xdg_shell.h>
#include <wlr/render/wlr_renderer.h>
// TODO WLR: make Xwayland optional
#include "list.h"
#include "config.h"
@ -42,11 +43,17 @@ struct sway_server {
struct wlr_xdg_shell *xdg_shell;
struct wl_listener xdg_shell_surface;
#ifdef HAVE_XWAYLAND
struct sway_xwayland xwayland;
struct wl_listener xwayland_surface;
struct wl_listener xwayland_ready;
#endif
struct wlr_server_decoration_manager *server_decoration_manager;
struct wl_listener server_decoration;
struct wl_list decorations; // sway_server_decoration::link
bool debug_txn_timings;
list_t *transactions;
@ -71,4 +78,6 @@ void handle_xdg_shell_surface(struct wl_listener *listener, void *data);
#ifdef HAVE_XWAYLAND
void handle_xwayland_surface(struct wl_listener *listener, void *data);
#endif
void handle_server_decoration(struct wl_listener *listener, void *data);
#endif

View file

@ -118,6 +118,8 @@ struct sway_view {
struct sway_xdg_shell_v6_view {
struct sway_view view;
enum wlr_server_decoration_manager_mode deco_mode;
struct wl_listener commit;
struct wl_listener request_move;
struct wl_listener request_resize;
@ -134,6 +136,8 @@ struct sway_xdg_shell_v6_view {
struct sway_xdg_shell_view {
struct sway_view view;
enum wlr_server_decoration_manager_mode deco_mode;
struct wl_listener commit;
struct wl_listener request_move;
struct wl_listener request_resize;