From 87d7157291e0865cfc9728ad09e78e8586ff9e99 Mon Sep 17 00:00:00 2001 From: IoIxD Date: Sun, 7 Dec 2025 20:41:37 -0700 Subject: [PATCH] subsurfaces have been useless for awhile, remove them and name the sub-widgets sublevels --- include/Mw/LowLevel/Wayland.h | 12 ++++-------- src/backend/wayland.c | 14 +++++++------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/include/Mw/LowLevel/Wayland.h b/include/Mw/LowLevel/Wayland.h index 6ce73fb..ed40bfe 100644 --- a/include/Mw/LowLevel/Wayland.h +++ b/include/Mw/LowLevel/Wayland.h @@ -52,13 +52,11 @@ struct _MwLLWaylandTopLevel { struct _MwLLWayland { struct _MwLLCommon common; - union { - struct _MwLLWaylandTopLevel* toplevel; - struct wl_subsurface* subsurface; - }; + // data that's only loaded if it's a toplevel + struct _MwLLWaylandTopLevel* toplevel; enum { - MWLL_WAYLAND_TOPLEVEL = 0, - MWLL_WAYLAND_SUBSURFACE = 1, + MWLL_WAYLAND_TOPLEVEL = 0, + MWLL_WAYLAND_SUBLEVEL = 1, } type; struct { @@ -90,8 +88,6 @@ struct _MwLLWayland { MwU32 x, y, ww, wh; MwPoint cur_mouse_pos; - int last_serial; - MwLL parent; GLuint fbo; diff --git a/src/backend/wayland.c b/src/backend/wayland.c index e242672..c8f2c90 100644 --- a/src/backend/wayland.c +++ b/src/backend/wayland.c @@ -522,7 +522,7 @@ static void setup_toplevel(MwLL r, int x, int y) { // glGenBuffers(1, &vertex_buffer); } -static void setup_subsurface(MwLL parent, MwLL r, int x, int y) { +static void setup_sublevel(MwLL parent, MwLL r, int x, int y) { struct wl_compositor* compositor = parent->wayland.compositor; struct wl_subcompositor* subcompositor = parent->wayland.subcompositor; struct wl_surface* parent_surface = parent->wayland.surface; @@ -533,7 +533,7 @@ static void setup_subsurface(MwLL parent, MwLL r, int x, int y) { topmost_parent = topmost_parent->wayland.parent; } - r->wayland.type = MWLL_WAYLAND_SUBSURFACE; + r->wayland.type = MWLL_WAYLAND_SUBLEVEL; r->wayland.display = parent->wayland.display; @@ -546,9 +546,9 @@ static void setup_subsurface(MwLL parent, MwLL r, int x, int y) { event_loop(r); wl_region_destroy(region); - r->wayland.subsurface = wl_subcompositor_get_subsurface(subcompositor, r->wayland.surface, parent_surface); + // r->wayland.sublevel = wl_subcompositor_get_sublevel(subcompositor, r->wayland.surface, parent_surface); - wl_subsurface_set_position(r->wayland.subsurface, x, y); + // wl_sublevel_set_position(r->wayland.sublevel, x, y); // printf("position %d %d\n", x, y); @@ -564,7 +564,7 @@ static void setup_subsurface(MwLL parent, MwLL r, int x, int y) { return; } - // arrpush(parent->wayland.subsurfaces, r); + // arrpush(parent->wayland.sublevels, r); r->wayland.configured = MwTRUE; if(!r->wayland.egl_setup) { @@ -605,7 +605,7 @@ static MwLL MwLLCreateImpl(MwLL parent, int x, int y, int width, int height) { if(parent == NULL) { setup_toplevel(r, x, y); } else { - setup_subsurface(parent, r, x, y); + setup_sublevel(parent, r, x, y); } return r; @@ -628,7 +628,7 @@ static void MwLLSetXYImpl(MwLL handle, int x, int y) { if(handle->wayland.type != MWLL_WAYLAND_TOPLEVEL) { handle->wayland.x = x; handle->wayland.y = y; - wl_subsurface_set_position(handle->wayland.subsurface, x, y); + // wl_sublevel_set_position(handle->wayland.sublevel, x, y); MwLLForceRender(handle); } }