]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Chase wlroots master
authorJohan Malm <jgm323@gmail.com>
Mon, 14 Feb 2022 20:20:16 +0000 (20:20 +0000)
committerJohan Malm <jgm323@gmail.com>
Wed, 23 Feb 2022 21:47:01 +0000 (21:47 +0000)
We need it for wlr_scene_layer_surface_v1_create()

include/labwc.h
include/layers.h
meson.build
src/output.c
src/server.c
src/xdg-popup.c
src/xdg.c
subprojects/wlroots.wrap

index c0b9d47bb0fd5786b0691fcce604f1da90df2eab..6586fc5553a65bfbf5505fd172358d6bb5c46257 100644 (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>
index 35b410902e9afac9c8c9858fc188de1f89d0f8c3..1613020b35fa451e39327d3cadaff0e0f8b64869 100644 (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;
index 09f6f0b24be56ec4b37f871f65e8a83a1818c539..e0da463eaf422cca6eaa442cb7ed24d6e067d6b1 100644 (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'],
index fc69a294af084208bf7863c72c2f1590dc3b95c8..297e4260ef23260ab48e752cca43e028ed09f1c7 100644 (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");
                }
index fd59599ad5fb72ca23d885f8c8fed922e4efc484..171ec6dd6b1fe72f70d53eef4c1ce312a9c887b1 100644 (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);
index 731967f22eac495f612694204169620d10063238..7a466536a0c6ead0c5ad6bd81cd81873f5fc648d 100644 (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);
 }
index 9920d3e5af36686782a0bbaf4fd9a1028a93a863..a820eacf12fba53bfa0c18ed088c48bd60e1f94b 100644 (file)
--- a/src/xdg.c
+++ b/src/xdg.c
@@ -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;
                }
        }
index 314d2c363979b26de3a2a8def3a351c11cf62fb1..3c65aaaca3356e48243104dda2a2ea891e83f2fa 100644 (file)
@@ -1,3 +1,3 @@
 [wrap-git]
 url = https://gitlab.freedesktop.org/wlroots/wlroots.git
-revision = 0.15.1
+revision = master