xdg-decoration support

This commit is contained in:
Keith Bowes 2022-01-30 09:24:04 -05:00
parent 87c32d58ab
commit 1bf513d9d6
11 changed files with 92 additions and 22 deletions

View file

@ -1,10 +1,9 @@
#ifndef CURSOR_H
#define CURSOR_H
#include <wayland-server.h>
#ifndef _WB_CURSOR_H
#define _WB_CURSOR_H
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_xcursor_manager.h>
#include "waybox/server.h"
struct wb_server;
enum wb_cursor_mode {
WB_CURSOR_PASSTHROUGH,
@ -32,4 +31,4 @@ struct wb_cursor {
struct wb_cursor *wb_cursor_create(struct wb_server *server);
void wb_cursor_destroy(struct wb_cursor *cursor);
#endif // cursor.h
#endif /* cursor.h */

View file

@ -1,5 +1,5 @@
#ifndef OUTPUT_H
#define OUTPUT_H
#ifndef _WB_OUTPUT_H
#define _WB_OUTPUT_H
#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200112L
@ -45,4 +45,4 @@ void output_frame_notify(struct wl_listener* listener, void *data);
void output_destroy_notify(struct wl_listener* listener, void *data);
void new_output_notify(struct wl_listener* listener, void *data);
#endif // output.h
#endif /* output.h */

View file

@ -6,7 +6,7 @@
#include <wlr/types/wlr_primary_selection_v1.h>
#include <wlr/types/wlr_seat.h>
#include "waybox/server.h"
struct wb_server;
struct wb_seat {
struct wlr_seat *seat;

View file

@ -1,5 +1,5 @@
#ifndef SERVER_H
#define SERVER_H
#ifndef _WB_SERVER_H
#define _WB_SERVER_H
#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200112L
@ -25,38 +25,40 @@
#include <locale.h>
#define _ gettext
#include "waybox/output.h"
#include "waybox/cursor.h"
#include "decoration.h"
#include "waybox/output.h"
#include "waybox/seat.h"
struct wb_server {
struct wl_display *wl_display;
struct wlr_allocator *allocator;
struct wlr_backend *backend;
struct wlr_compositor *compositor;
struct wlr_renderer *renderer;
struct wlr_allocator *allocator;
struct wlr_output_layout *layout;
struct wlr_renderer *renderer;
struct wb_cursor *cursor;
struct wb_seat *seat;
struct wb_view *grabbed_view;
double grab_x, grab_y;
struct wlr_box grab_geo_box;
double grab_x, grab_y;
uint32_t resize_edges;
struct wl_list views;
struct wlr_xdg_shell *xdg_shell;
struct wl_listener new_xdg_surface;
struct wl_list views;
struct wl_listener new_xdg_decoration;
struct wl_listener new_output;
struct wl_listener new_input;
struct wl_list outputs; // wb_output::link
struct wl_listener new_output;
struct wl_list outputs; /* wb_output::link */
};
bool wb_create_backend(struct wb_server* server);
bool wb_start_server(struct wb_server* server);
bool wb_terminate(struct wb_server* server);
#endif // server.h
#endif /* server.h */

View file

@ -1,3 +1,6 @@
#ifndef _WB_XDG_SHELL_H
#define _WB_XDG_SHELL_H
#include "waybox/server.h"
void init_xdg_shell(struct wb_server *server);
@ -5,3 +8,4 @@ void focus_view(struct wb_view *view, struct wlr_surface *surface);
struct wb_view *desktop_view_at(
struct wb_server *server, double lx, double ly,
struct wlr_surface **surface, double *sx, double *sy);
#endif