clients/stacking: Fix widget user_data cast type

This used to not be a problem as both `struct stacking` and `struct
window` start with a pointer to `struct display`.

Signed-off-by: Colin Kinloch <colin.kinloch@collabora.com>
This commit is contained in:
Colin Kinloch 2024-01-08 18:53:21 +00:00 committed by Marius Vlad
parent 8e0e75999e
commit 3f919e3d92
1 changed files with 3 additions and 3 deletions

View File

@ -156,7 +156,8 @@ button_handler(struct widget *widget,
uint32_t button,
enum wl_pointer_button_state state, void *data)
{
struct stacking_window *stacking_window = data;
struct window *window = data;
struct stacking_window *stacking_window = window_get_user_data(window);
switch (button) {
case BTN_RIGHT:
@ -296,12 +297,11 @@ set_window_background_colour(cairo_t *cr, struct window *window)
static void
redraw_handler(struct widget *widget, void *data)
{
struct window *window;
struct window *window = data;
struct rectangle allocation;
cairo_t *cr;
widget_get_allocation(widget, &allocation);
window = widget_get_user_data(widget);
cr = widget_cairo_create(widget);
cairo_translate(cr, allocation.x, allocation.y);