mirror of
https://github.com/wizbright/waybox.git
synced 2025-10-29 05:40:20 -04:00
Fixed for the wlroots xdg-positioner regression fix (see 2d623724c3)
This commit is contained in:
parent
5e95882436
commit
9fa7060dd4
4 changed files with 24 additions and 21 deletions
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
#include <wlr/backend.h>
|
||||
#include <wlr/render/allocator.h>
|
||||
|
||||
#include <wlr/render/wlr_renderer.h>
|
||||
#include <wlr/types/wlr_compositor.h>
|
||||
#include <wlr/types/wlr_data_device.h>
|
||||
|
|
|
|||
|
|
@ -246,11 +246,11 @@ static void popup_unconstrain(struct wb_layer_popup *popup) {
|
|||
int lx, ly;
|
||||
wlr_scene_node_coords(popup->scene, &lx, &ly);
|
||||
|
||||
/* the output box expressed in the coordinate system of the toplevel parent
|
||||
* of the popup */
|
||||
/* The output box expressed in the coordinate system of the toplevel
|
||||
* parent of the popup. */
|
||||
struct wlr_box output_toplevel_sx_box = {
|
||||
.x = output->geometry.x - lx,
|
||||
.y = output->geometry.y - ly,
|
||||
.x = output->geometry.x - MIN(lx, 0),
|
||||
.y = output->geometry.y - MAX(ly, 0),
|
||||
.width = output->geometry.width,
|
||||
.height = output->geometry.height,
|
||||
};
|
||||
|
|
@ -288,7 +288,8 @@ static struct wb_layer_popup *create_popup(struct wlr_xdg_popup *wlr_popup,
|
|||
wl_signal_add(&wlr_popup->base->events.new_popup, &popup->new_popup);
|
||||
|
||||
popup_unconstrain(popup);
|
||||
return NULL;
|
||||
|
||||
return popup;
|
||||
}
|
||||
|
||||
static void popup_handle_new_popup(struct wl_listener *listener, void *data) {
|
||||
|
|
@ -310,8 +311,10 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) {
|
|||
struct wlr_layer_surface_v1 *layer_surface = data;
|
||||
|
||||
if (layer_surface->output == NULL) {
|
||||
struct wb_server *server = wl_container_of(listener, server, new_layer_surface);
|
||||
struct wb_view *view = wl_container_of(server->views.next, view, link);
|
||||
struct wb_server *server =
|
||||
wl_container_of(listener, server, new_layer_surface);
|
||||
struct wb_view *view =
|
||||
wl_container_of(server->views.next, view, link);
|
||||
layer_surface->output = get_active_output(view);
|
||||
}
|
||||
struct wb_output *output = layer_surface->output->data;
|
||||
|
|
|
|||
|
|
@ -5,9 +5,8 @@ void output_frame_notify(struct wl_listener *listener, void *data) {
|
|||
* generally at the output's refresh rate (e.g. 60Hz). */
|
||||
struct wb_output *output = wl_container_of(listener, output, frame);
|
||||
struct wlr_scene *scene = output->server->scene;
|
||||
|
||||
struct wlr_scene_output *scene_output = wlr_scene_get_scene_output(
|
||||
scene, output->wlr_output);
|
||||
struct wlr_scene_output *scene_output =
|
||||
wlr_scene_get_scene_output(scene, output->wlr_output);
|
||||
|
||||
#if WLR_CHECK_VERSION(0, 16, 0)
|
||||
wlr_output_layout_get_box(output->server->output_layout,
|
||||
|
|
@ -35,7 +34,6 @@ void output_destroy_notify(struct wl_listener *listener, void *data) {
|
|||
|
||||
wl_list_remove(&output->destroy.link);
|
||||
wl_list_remove(&output->frame.link);
|
||||
wl_list_remove(&output->link);
|
||||
|
||||
/* Frees the layers */
|
||||
size_t num_layers = sizeof(output->layers) / sizeof(struct wlr_scene_node *);
|
||||
|
|
@ -45,6 +43,7 @@ void output_destroy_notify(struct wl_listener *listener, void *data) {
|
|||
wlr_scene_node_destroy(node);
|
||||
}
|
||||
|
||||
wl_list_remove(&output->link);
|
||||
free(output);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ struct wb_view *get_view_at(
|
|||
/* This returns the topmost node in the scene at the given layout coords.
|
||||
* we only care about surface nodes as we are specifically looking for a
|
||||
* surface in the surface tree of a wb_view. */
|
||||
struct wlr_scene_node *node = wlr_scene_node_at(
|
||||
&server->scene->node, lx, ly, sx, sy);
|
||||
struct wlr_scene_node *node =
|
||||
wlr_scene_node_at(&server->scene->node, lx, ly, sx, sy);
|
||||
if (node == NULL || node->type != WLR_SCENE_NODE_SURFACE) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -44,8 +44,8 @@ void focus_view(struct wb_view *view, struct wlr_surface *surface) {
|
|||
* it no longer has focus and the client will repaint accordingly, e.g.
|
||||
* stop displaying a caret.
|
||||
*/
|
||||
struct wlr_xdg_surface *previous = wlr_xdg_surface_from_wlr_surface(
|
||||
prev_surface);
|
||||
struct wlr_xdg_surface *previous =
|
||||
wlr_xdg_surface_from_wlr_surface(prev_surface);
|
||||
#if WLR_CHECK_VERSION(0, 16, 0)
|
||||
wlr_xdg_toplevel_set_activated(previous->toplevel, false);
|
||||
#else
|
||||
|
|
@ -284,11 +284,13 @@ static void handle_new_popup(struct wl_listener *listener, void *data) {
|
|||
if (!wlr_output) return;
|
||||
struct wb_output *output = wlr_output->data;
|
||||
|
||||
int top_margin = (view->server->config) ?
|
||||
view->server->config->margins.top : 0;
|
||||
struct wlr_box output_toplevel_box = {
|
||||
.x = output->geometry.x - view->current_position.x,
|
||||
.y = output->geometry.y - view->current_position.y,
|
||||
.width = output->geometry.width,
|
||||
.height = output->geometry.height,
|
||||
.height = output->geometry.height - top_margin,
|
||||
};
|
||||
wlr_xdg_popup_unconstrain_from_box(popup, &output_toplevel_box);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue