Chase wlroots master

We need it for wlr_scene_layer_surface_v1_create()
This commit is contained in:
Johan Malm 2022-02-14 20:20:16 +00:00
parent 04ca9fbdf5
commit b79744e7b0
8 changed files with 29 additions and 32 deletions

View file

@ -34,6 +34,7 @@
#include <wlr/types/wlr_pointer_gestures_v1.h>
#include <wlr/types/wlr_seat.h>
#include <wlr/types/wlr_server_decoration.h>
#include <wlr/types/wlr_subcompositor.h>
#include <wlr/types/wlr_xcursor_manager.h>
#include <wlr/types/wlr_xdg_decoration_v1.h>
#include <wlr/types/wlr_xdg_shell.h>

View file

@ -2,7 +2,6 @@
#ifndef __LABWC_LAYERS_H
#define __LABWC_LAYERS_H
#include <wayland-server.h>
#include <wlr/types/wlr_surface.h>
#include <wlr/types/wlr_layer_shell_v1.h>
struct server;

View file

@ -37,7 +37,7 @@ if git.found()
endif
add_project_arguments('-DLABWC_VERSION=@0@'.format(version), language: 'c')
wlroots_version = ['>=0.15.0', '<0.16.0']
wlroots_version = ['>=0.16.0', '<0.17.0']
wlroots_proj = subproject(
'wlroots',
default_options: ['default_library=static', 'examples=false'],

View file

@ -287,12 +287,12 @@ wlr_output_configuration_v1 *create_output_config(struct server *server)
wlr_output_configuration_v1_destroy(config);
return NULL;
}
struct wlr_box *box =
wlr_output_layout_get_box(server->output_layout,
output->wlr_output);
if (box) {
head->state.x = box->x;
head->state.y = box->y;
struct wlr_box box;
wlr_output_layout_get_box(server->output_layout,
output->wlr_output, &box);
if (!wlr_box_empty(&box)) {
head->state.x = box.x;
head->state.y = box.y;
} else {
wlr_log(WLR_ERROR, "failed to get output layout box");
}

View file

@ -240,6 +240,7 @@ server_init(struct server *server)
wlr_log(WLR_ERROR, "unable to create the wlroots compositor");
exit(EXIT_FAILURE);
}
wlr_subcompositor_create(server->wl_display);
struct wlr_data_device_manager *device_manager = NULL;
device_manager = wlr_data_device_manager_create(server->wl_display);

View file

@ -17,14 +17,15 @@ popup_unconstrain(struct view *view, struct wlr_xdg_popup *popup)
struct wlr_output_layout *output_layout = server->output_layout;
struct wlr_output *wlr_output = wlr_output_layout_output_at(
output_layout, view->x + popup_box->x, view->y + popup_box->y);
struct wlr_box *output_box = wlr_output_layout_get_box(
output_layout, wlr_output);
struct wlr_box output_box;
wlr_output_layout_get_box(output_layout, wlr_output, &output_box);
struct wlr_box output_toplevel_box = {
.x = output_box->x - view->x,
.y = output_box->y - view->y,
.width = output_box->width,
.height = output_box->height,
.x = output_box.x - view->x,
.y = output_box.y - view->y,
.width = output_box.width,
.height = output_box.height,
};
wlr_xdg_popup_unconstrain_from_box(popup, &output_toplevel_box);
}

View file

@ -127,29 +127,23 @@ static void
handle_request_minimize(struct wl_listener *listener, void *data)
{
struct view *view = wl_container_of(listener, view, request_minimize);
struct wlr_xdg_surface *surface = data;
if (view) {
view_minimize(view, surface->toplevel->requested.minimized);
}
view_minimize(view, view->xdg_surface->toplevel->requested.minimized);
}
static void
handle_request_maximize(struct wl_listener *listener, void *data)
{
struct view *view = wl_container_of(listener, view, request_maximize);
struct wlr_xdg_surface *surface = data;
if (view) {
view_maximize(view, surface->toplevel->requested.maximized);
}
view_maximize(view, view->xdg_surface->toplevel->requested.maximized);
}
static void
handle_request_fullscreen(struct wl_listener *listener, void *data)
{
struct view *view = wl_container_of(listener, view, request_fullscreen);
struct wlr_xdg_toplevel_set_fullscreen_event *e = data;
view_set_fullscreen(view, e->fullscreen, e->output);
view_set_fullscreen(view,
view->xdg_surface->toplevel->requested.fullscreen,
view->xdg_surface->toplevel->requested.fullscreen_output);
}
static void
@ -182,7 +176,7 @@ xdg_toplevel_view_configure(struct view *view, struct wlr_box geo)
view->pending_move_resize.width = MAX(geo.width, min_width);
view->pending_move_resize.height = MAX(geo.height, min_height);
uint32_t serial = wlr_xdg_toplevel_set_size(view->xdg_surface,
uint32_t serial = wlr_xdg_toplevel_set_size(view->xdg_surface->toplevel,
(uint32_t)geo.width, (uint32_t)geo.height);
if (serial > 0) {
view->pending_move_resize.configure_serial = serial;
@ -207,7 +201,7 @@ xdg_toplevel_view_move(struct view *view, double x, double y)
static void
xdg_toplevel_view_close(struct view *view)
{
wlr_xdg_toplevel_send_close(view->xdg_surface);
wlr_xdg_toplevel_send_close(view->xdg_surface->toplevel);
}
static void
@ -222,7 +216,7 @@ update_padding(struct view *view)
static void
xdg_toplevel_view_maximize(struct view *view, bool maximized)
{
wlr_xdg_toplevel_set_maximized(view->xdg_surface, maximized);
wlr_xdg_toplevel_set_maximized(view->xdg_surface->toplevel, maximized);
}
static void
@ -230,14 +224,14 @@ xdg_toplevel_view_set_activated(struct view *view, bool activated)
{
struct wlr_xdg_surface *surface = view->xdg_surface;
if (surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL) {
wlr_xdg_toplevel_set_activated(surface, activated);
wlr_xdg_toplevel_set_activated(surface->toplevel, activated);
}
}
static void
xdg_toplevel_view_set_fullscreen(struct view *view, bool fullscreen)
{
wlr_xdg_toplevel_set_fullscreen(view->xdg_surface, fullscreen);
wlr_xdg_toplevel_set_fullscreen(view->xdg_surface->toplevel, fullscreen);
}
static bool
@ -251,7 +245,8 @@ parent_of(struct view *view)
{
struct view *p;
wl_list_for_each (p, &view->server->views, link) {
if (p->xdg_surface == view->xdg_surface->toplevel->parent) {
if (p->xdg_surface->toplevel
== view->xdg_surface->toplevel->parent) {
return p;
}
}

View file

@ -1,3 +1,3 @@
[wrap-git]
url = https://gitlab.freedesktop.org/wlroots/wlroots.git
revision = 0.15.1
revision = master