mirror of
https://github.com/labwc/labwc.git
synced 2026-03-24 09:06:09 -04:00
Chase wlroots master
We need it for wlr_scene_layer_surface_v1_create()
This commit is contained in:
parent
04ca9fbdf5
commit
b79744e7b0
8 changed files with 29 additions and 32 deletions
|
|
@ -34,6 +34,7 @@
|
||||||
#include <wlr/types/wlr_pointer_gestures_v1.h>
|
#include <wlr/types/wlr_pointer_gestures_v1.h>
|
||||||
#include <wlr/types/wlr_seat.h>
|
#include <wlr/types/wlr_seat.h>
|
||||||
#include <wlr/types/wlr_server_decoration.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_xcursor_manager.h>
|
||||||
#include <wlr/types/wlr_xdg_decoration_v1.h>
|
#include <wlr/types/wlr_xdg_decoration_v1.h>
|
||||||
#include <wlr/types/wlr_xdg_shell.h>
|
#include <wlr/types/wlr_xdg_shell.h>
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
#ifndef __LABWC_LAYERS_H
|
#ifndef __LABWC_LAYERS_H
|
||||||
#define __LABWC_LAYERS_H
|
#define __LABWC_LAYERS_H
|
||||||
#include <wayland-server.h>
|
#include <wayland-server.h>
|
||||||
#include <wlr/types/wlr_surface.h>
|
|
||||||
#include <wlr/types/wlr_layer_shell_v1.h>
|
#include <wlr/types/wlr_layer_shell_v1.h>
|
||||||
|
|
||||||
struct server;
|
struct server;
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ if git.found()
|
||||||
endif
|
endif
|
||||||
add_project_arguments('-DLABWC_VERSION=@0@'.format(version), language: 'c')
|
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_proj = subproject(
|
||||||
'wlroots',
|
'wlroots',
|
||||||
default_options: ['default_library=static', 'examples=false'],
|
default_options: ['default_library=static', 'examples=false'],
|
||||||
|
|
|
||||||
12
src/output.c
12
src/output.c
|
|
@ -287,12 +287,12 @@ wlr_output_configuration_v1 *create_output_config(struct server *server)
|
||||||
wlr_output_configuration_v1_destroy(config);
|
wlr_output_configuration_v1_destroy(config);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
struct wlr_box *box =
|
struct wlr_box box;
|
||||||
wlr_output_layout_get_box(server->output_layout,
|
wlr_output_layout_get_box(server->output_layout,
|
||||||
output->wlr_output);
|
output->wlr_output, &box);
|
||||||
if (box) {
|
if (!wlr_box_empty(&box)) {
|
||||||
head->state.x = box->x;
|
head->state.x = box.x;
|
||||||
head->state.y = box->y;
|
head->state.y = box.y;
|
||||||
} else {
|
} else {
|
||||||
wlr_log(WLR_ERROR, "failed to get output layout box");
|
wlr_log(WLR_ERROR, "failed to get output layout box");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -240,6 +240,7 @@ server_init(struct server *server)
|
||||||
wlr_log(WLR_ERROR, "unable to create the wlroots compositor");
|
wlr_log(WLR_ERROR, "unable to create the wlroots compositor");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
wlr_subcompositor_create(server->wl_display);
|
||||||
|
|
||||||
struct wlr_data_device_manager *device_manager = NULL;
|
struct wlr_data_device_manager *device_manager = NULL;
|
||||||
device_manager = wlr_data_device_manager_create(server->wl_display);
|
device_manager = wlr_data_device_manager_create(server->wl_display);
|
||||||
|
|
|
||||||
|
|
@ -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_layout *output_layout = server->output_layout;
|
||||||
struct wlr_output *wlr_output = wlr_output_layout_output_at(
|
struct wlr_output *wlr_output = wlr_output_layout_output_at(
|
||||||
output_layout, view->x + popup_box->x, view->y + popup_box->y);
|
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 = {
|
struct wlr_box output_toplevel_box = {
|
||||||
.x = output_box->x - view->x,
|
.x = output_box.x - view->x,
|
||||||
.y = output_box->y - view->y,
|
.y = output_box.y - view->y,
|
||||||
.width = output_box->width,
|
.width = output_box.width,
|
||||||
.height = output_box->height,
|
.height = output_box.height,
|
||||||
};
|
};
|
||||||
wlr_xdg_popup_unconstrain_from_box(popup, &output_toplevel_box);
|
wlr_xdg_popup_unconstrain_from_box(popup, &output_toplevel_box);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
29
src/xdg.c
29
src/xdg.c
|
|
@ -127,29 +127,23 @@ static void
|
||||||
handle_request_minimize(struct wl_listener *listener, void *data)
|
handle_request_minimize(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct view *view = wl_container_of(listener, view, request_minimize);
|
struct view *view = wl_container_of(listener, view, request_minimize);
|
||||||
struct wlr_xdg_surface *surface = data;
|
view_minimize(view, view->xdg_surface->toplevel->requested.minimized);
|
||||||
if (view) {
|
|
||||||
view_minimize(view, surface->toplevel->requested.minimized);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_request_maximize(struct wl_listener *listener, void *data)
|
handle_request_maximize(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct view *view = wl_container_of(listener, view, request_maximize);
|
struct view *view = wl_container_of(listener, view, request_maximize);
|
||||||
struct wlr_xdg_surface *surface = data;
|
view_maximize(view, view->xdg_surface->toplevel->requested.maximized);
|
||||||
if (view) {
|
|
||||||
view_maximize(view, surface->toplevel->requested.maximized);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_request_fullscreen(struct wl_listener *listener, void *data)
|
handle_request_fullscreen(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct view *view = wl_container_of(listener, view, request_fullscreen);
|
struct view *view = wl_container_of(listener, view, request_fullscreen);
|
||||||
struct wlr_xdg_toplevel_set_fullscreen_event *e = data;
|
view_set_fullscreen(view,
|
||||||
view_set_fullscreen(view, e->fullscreen, e->output);
|
view->xdg_surface->toplevel->requested.fullscreen,
|
||||||
|
view->xdg_surface->toplevel->requested.fullscreen_output);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
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.width = MAX(geo.width, min_width);
|
||||||
view->pending_move_resize.height = MAX(geo.height, min_height);
|
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);
|
(uint32_t)geo.width, (uint32_t)geo.height);
|
||||||
if (serial > 0) {
|
if (serial > 0) {
|
||||||
view->pending_move_resize.configure_serial = serial;
|
view->pending_move_resize.configure_serial = serial;
|
||||||
|
|
@ -207,7 +201,7 @@ xdg_toplevel_view_move(struct view *view, double x, double y)
|
||||||
static void
|
static void
|
||||||
xdg_toplevel_view_close(struct view *view)
|
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
|
static void
|
||||||
|
|
@ -222,7 +216,7 @@ update_padding(struct view *view)
|
||||||
static void
|
static void
|
||||||
xdg_toplevel_view_maximize(struct view *view, bool maximized)
|
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
|
static void
|
||||||
|
|
@ -230,14 +224,14 @@ xdg_toplevel_view_set_activated(struct view *view, bool activated)
|
||||||
{
|
{
|
||||||
struct wlr_xdg_surface *surface = view->xdg_surface;
|
struct wlr_xdg_surface *surface = view->xdg_surface;
|
||||||
if (surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL) {
|
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
|
static void
|
||||||
xdg_toplevel_view_set_fullscreen(struct view *view, bool fullscreen)
|
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
|
static bool
|
||||||
|
|
@ -251,7 +245,8 @@ parent_of(struct view *view)
|
||||||
{
|
{
|
||||||
struct view *p;
|
struct view *p;
|
||||||
wl_list_for_each (p, &view->server->views, link) {
|
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;
|
return p;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
[wrap-git]
|
[wrap-git]
|
||||||
url = https://gitlab.freedesktop.org/wlroots/wlroots.git
|
url = https://gitlab.freedesktop.org/wlroots/wlroots.git
|
||||||
revision = 0.15.1
|
revision = master
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue