REFACTOR "STASH" (nowhere near working btw)

This commit is contained in:
Emile Clark-Boman 2025-08-28 00:15:29 +10:00
parent 8dfe3b2f25
commit ab3942d3b5
25 changed files with 1021 additions and 845 deletions

View file

@ -1,4 +1,4 @@
#include "lib/client.h"
#include "client.h"
void applybounds(Client *c, struct wlr_box *bbox) {
/* set minimum possible */
@ -15,34 +15,6 @@ void applybounds(Client *c, struct wlr_box *bbox) {
c->geom.y = bbox->y;
}
void applyrules(Client *c) {
/* rule matching */
const char *appid, *title;
uint32_t newtags = 0;
int i;
const Rule *r;
Monitor *mon = selmon, *m;
appid = client_get_appid(c);
title = client_get_title(c);
for (r = rules; r < END(rules); r++) {
if ((!r->title || strstr(title, r->title)) &&
(!r->id || strstr(appid, r->id))) {
c->isfloating = r->isfloating;
newtags |= r->tags;
i = 0;
wl_list_for_each(m, &mons, link) {
if (r->monitor == i++)
mon = m;
}
}
}
c->isfloating |= client_is_float_type(c);
setmon(c, mon, newtags);
}
void focusclient(Client *c, int lift) {
struct wlr_surface *old = seat->keyboard_state.focused_surface;
int unused_lx, unused_ly, old_client_type;
@ -278,39 +250,6 @@ void view(const Arg *arg) {
printstatus();
}
void xytonode(double x, double y, struct wlr_surface **psurface, Client **pc,
LayerSurface **pl, double *nx, double *ny) {
struct wlr_scene_node *node, *pnode;
struct wlr_surface *surface = NULL;
Client *c = NULL;
LayerSurface *l = NULL;
int layer;
for (layer = NUM_LAYERS - 1; !surface && layer >= 0; layer--) {
if (!(node = wlr_scene_node_at(&layers[layer]->node, x, y, nx, ny)))
continue;
if (node->type == WLR_SCENE_NODE_BUFFER)
surface =
wlr_scene_surface_try_from_buffer(wlr_scene_buffer_from_node(node))
->surface;
/* Walk the tree to find a node that knows the client */
for (pnode = node; pnode && !c; pnode = &pnode->parent->node)
c = pnode->data;
if (c && c->type == LayerShell) {
c = NULL;
l = pnode->data;
}
}
if (psurface)
*psurface = surface;
if (pc)
*pc = c;
if (pl)
*pl = l;
}
void zoom(const Arg *arg) {
Client *c, *sel = focustop(selmon);