more robust mw_force_csd
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good

This commit is contained in:
IoIxD 2026-09-11 13:38:58 -07:00
commit 292ffe1120

View file

@ -171,10 +171,6 @@ static void xdg_toplevel_configure(void* data,
if(width == 0 || height == 0) { if(width == 0 || height == 0) {
width = self->wayland.ww; width = self->wayland.ww;
height = self->wayland.wh; height = self->wayland.wh;
/* if it's still 0 then bail */
if(width == 0 || height == 0) {
return;
}
} }
if(self->wayland.type == MwLL_WAYLAND_TOPLEVEL) { if(self->wayland.type == MwLL_WAYLAND_TOPLEVEL) {
@ -257,6 +253,7 @@ void MwLLWaylandBufferUpdate(MwLL self, struct _MwLLWaylandShmBuffer* buffer) {
/* Toplevel setup function */ /* Toplevel setup function */
static void setup_toplevel(MwLL r, int x, int y) { static void setup_toplevel(MwLL r, int x, int y) {
char* mw_force_csd = getenv("MW_FORCE_CSD");
r->wayland.type = MwLL_WAYLAND_TOPLEVEL; r->wayland.type = MwLL_WAYLAND_TOPLEVEL;
r->wayland.toplevel = malloc(sizeof(struct _MwLLWaylandTopLevel)); r->wayland.toplevel = malloc(sizeof(struct _MwLLWaylandTopLevel));
r->wayland.x = x; r->wayland.x = x;
@ -284,7 +281,10 @@ static void setup_toplevel(MwLL r, int x, int y) {
} }
/* check now if we have decorations so that everything else can act accordingly */ /* check now if we have decorations so that everything else can act accordingly */
if(shget(r->wayland.wl_protocol_map, zxdg_decoration_manager_v1_interface.name) != NULL && getenv("MW_FORCE_CSD") == NULL) { if(mw_force_csd != NULL) {
r->wayland.has_decorations = strcmp(mw_force_csd, "0") == 0;
r->wayland.do_csd = strcmp(mw_force_csd, "1") == 0;
} else if(shget(r->wayland.wl_protocol_map, zxdg_decoration_manager_v1_interface.name) != NULL) {
r->wayland.has_decorations = MwTRUE; r->wayland.has_decorations = MwTRUE;
} else { } else {
r->wayland.do_csd = MwTRUE; r->wayland.do_csd = MwTRUE;
@ -492,6 +492,7 @@ struct xdg_popup_listener popup_listener = {
/* Popup setup function */ /* Popup setup function */
static void setup_popup(MwLL r, int x, int y, MwLL parent) { static void setup_popup(MwLL r, int x, int y, MwLL parent) {
char* mw_force_csd = getenv("MW_FORCE_CSD");
MwLL topmost_parent = r->wayland.parent; MwLL topmost_parent = r->wayland.parent;
r->wayland.type = MwLL_WAYLAND_POPUP; r->wayland.type = MwLL_WAYLAND_POPUP;
r->wayland.x = x; r->wayland.x = x;
@ -527,7 +528,10 @@ static void setup_popup(MwLL r, int x, int y, MwLL parent) {
} }
/* check now if we have decorations so that everything else can act accordingly */ /* check now if we have decorations so that everything else can act accordingly */
if(shget(r->wayland.wl_protocol_map, zxdg_decoration_manager_v1_interface.name) != NULL && getenv("MW_FORCE_CSD") == NULL) { if(mw_force_csd != NULL) {
r->wayland.has_decorations = strcmp(mw_force_csd, "0") == 0;
r->wayland.do_csd = strcmp(mw_force_csd, "1") == 0;
} else if(shget(r->wayland.wl_protocol_map, zxdg_decoration_manager_v1_interface.name) != NULL) {
r->wayland.has_decorations = MwTRUE; r->wayland.has_decorations = MwTRUE;
} else { } else {
r->wayland.do_csd = MwTRUE; r->wayland.do_csd = MwTRUE;