Merge pull request #458 from acrisci/refactor/wlr-decoration-modes

wrap server decoration modes
This commit is contained in:
Drew DeVault 2017-12-03 14:13:27 -05:00 committed by GitHub
commit 3f70043d00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 4 deletions

View File

@ -3,12 +3,35 @@
#include <wayland-server.h> #include <wayland-server.h>
/**
* Possible values to use in request_mode and the event mode. Same as
* org_kde_kwin_server_decoration_manager_mode.
*/
enum wlr_server_decoration_manager_mode {
/**
* Undecorated: The surface is not decorated at all, neither server nor
* client-side. An example is a popup surface which should not be
* decorated.
*/
WLR_SERVER_DECORATION_MANAGER_MODE_NONE = 0,
/**
* Client-side decoration: The decoration is part of the surface and the
* client.
*/
WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT = 1,
/**
* Server-side decoration: The server embeds the surface into a decoration
* frame.
*/
WLR_SERVER_DECORATION_MANAGER_MODE_SERVER = 2,
};
struct wlr_server_decoration_manager { struct wlr_server_decoration_manager {
struct wl_global *wl_global; struct wl_global *wl_global;
struct wl_list wl_resources; struct wl_list wl_resources;
struct wl_list decorations; // wlr_server_decoration::link struct wl_list decorations; // wlr_server_decoration::link
uint32_t default_mode; // enum org_kde_kwin_server_decoration_manager_mode uint32_t default_mode; // enum wlr_server_decoration_manager_mode
struct { struct {
struct wl_signal new_decoration; struct wl_signal new_decoration;
@ -22,7 +45,7 @@ struct wlr_server_decoration {
struct wlr_surface *surface; struct wlr_surface *surface;
struct wl_list link; struct wl_list link;
uint32_t mode; // enum org_kde_kwin_server_decoration_manager_mode uint32_t mode; // enum wlr_server_decoration_manager_mode
struct { struct {
struct wl_signal destroy; struct wl_signal destroy;

View File

@ -13,7 +13,6 @@
#include <wlr/types/wlr_xcursor_manager.h> #include <wlr/types/wlr_xcursor_manager.h>
#include <wlr/types/wlr_xdg_shell_v6.h> #include <wlr/types/wlr_xdg_shell_v6.h>
#include <wlr/util/log.h> #include <wlr/util/log.h>
#include <server-decoration-protocol.h>
#include "rootston/server.h" #include "rootston/server.h"
#include "rootston/seat.h" #include "rootston/seat.h"
#include "rootston/xcursor.h" #include "rootston/xcursor.h"
@ -468,7 +467,7 @@ struct roots_desktop *desktop_create(struct roots_server *server,
wlr_server_decoration_manager_create(server->wl_display); wlr_server_decoration_manager_create(server->wl_display);
wlr_server_decoration_manager_set_default_mode( wlr_server_decoration_manager_set_default_mode(
desktop->server_decoration_manager, desktop->server_decoration_manager,
ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_CLIENT); WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT);
return desktop; return desktop;
} }