subsurfaces have been useless for awhile, remove them and name the sub-widgets sublevels

This commit is contained in:
IoIxD 2025-12-07 20:41:37 -07:00
commit 87d7157291
2 changed files with 11 additions and 15 deletions

View file

@ -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;

View file

@ -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);
}
}