J6OSBEBQXZR5JZ5TOCCUPELBPUVEQULGCXURXLPY7WFYTDEQOU2AC NNBK7MMS3MCRQGIYBYXVSF4DJVWFVZMXDD3O2W2MUIPL23DJLXOQC JLUWRE5FNOBBXIPF2HQELX2JGECPHXFVSUCNSU27O2335NGJ7KMAC 7B74AT3BXYB7PVW4F6SGQNPMHOU5TEV5TZ54CG6VSQI46XSEKWXQC 2ZRKX4A24W4WNSLJNPKP3FWB3Y3UCYLWWESTC65P45BQFSJKS4PQC S7RXJJZG4IEIVLPHEWFT5M2T3SRRO5US5SYBPXSYSWJJLXAKNNPAC 7XCGFU3GX4TQXZBOU7GFAQ62EEOTVRNWFYQGI3XULFPSUKDZ2EYAC D425ND7AT3F7QJ3CCSESMVDOC3J5C5P32M5SJDBHECZJXLHNQ2FAC E7UO6NRGXFDMBU3BSJYRDNOA3Y7VHD7NWPHI5PHCPHQF6ZNOPZLQC O5JVMDEEKP334BAYMJ6HHXROW4X4WC24JHCYZTKJRQE5UGYXV7YQC CN4FS77B6FLSEDGAQ4R5YGHS56TNW7IGUR7RK4HKCLDX2627VBKAC typedef struct {unsigned int mod;unsigned int button;void (*func)(const Arg *);const Arg arg;} Button;
/* Used to move all of the data necessary to render a surface from the top-level* frame handler to the per-surface render function. */struct render_data {struct wlr_output *output;Client *client;struct timespec *when;};
/* Allocate a dwl_view for this surface */struct dwl_view *view = calloc(1, sizeof(*view));view->xdg_surface = xdg_surface;
/* Allocate a Client for this surface */Client *c = calloc(1, sizeof(*c));c->xdg_surface = xdg_surface;
view->map.notify = maprequest;wl_signal_add(&xdg_surface->events.map, &view->map);view->unmap.notify = unmapnotify;wl_signal_add(&xdg_surface->events.unmap, &view->unmap);view->destroy.notify = destroynotify;wl_signal_add(&xdg_surface->events.destroy, &view->destroy);
c->map.notify = maprequest;wl_signal_add(&xdg_surface->events.map, &c->map);c->unmap.notify = unmapnotify;wl_signal_add(&xdg_surface->events.unmap, &c->unmap);c->destroy.notify = destroynotify;wl_signal_add(&xdg_surface->events.destroy, &c->destroy);
output->frame.notify = renderoutput;wl_signal_add(&wlr_output->events.frame, &output->frame);wl_list_insert(&outputs, &output->link);
m->frame.notify = rendermon;wl_signal_add(&wlr_output->events.frame, &m->frame);wl_list_insert(&mons, &m->link);
struct dwl_view *current_view = wl_container_of(views.next, current_view, link);struct dwl_view *next_view = wl_container_of(current_view->link.next, next_view, link);focus(next_view, next_view->xdg_surface->surface);/* Move the previous view to the end of the list */wl_list_remove(¤t_view->link);wl_list_insert(views.prev, ¤t_view->link);
Client *c = wl_container_of(clients.next, c, link);Client *n = wl_container_of(c->link.next, n, link);focus(n, n->xdg_surface->surface);/* Move the previous client to the end of the list */wl_list_remove(&c->link);wl_list_insert(clients.prev, &c->link);
/* Move the grabbed view to the new position. */grabbed_view->x = cursor->x - grab_x;grabbed_view->y = cursor->y - grab_y;
/* Move the grabbed client to the new position. */grabbed_client->x = cursor->x - grab_x;grabbed_client->y = cursor->y - grab_y;
/* The view has a position in layout coordinates. If you have two displays,* one next to the other, both 1080p, a view on the rightmost display might
/* The client has a position in layout coordinates. If you have two displays,* one next to the other, both 1080p, a client on the rightmost display might
* in graphics programming. We need to prepare a matrix to render the view* with. wlr_matrix_project_box is a helper which takes a box with a desired* x, y coordinates, width and height, and an output geometry, then* prepares an orthographic projection and multiplies the necessary
* in graphics programming. We need to prepare a matrix to render the* client with. wlr_matrix_project_box is a helper which takes a box with* a desired x, y coordinates, width and height, and an output geometry,* then prepares an orthographic projection and multiplies the necessary
* our view list is ordered front-to-back, we iterate over it backwards. */struct dwl_view *view;wl_list_for_each_reverse(view, &views, link) {if (!view->mapped) {/* An unmapped view should not be rendered. */
* our client list is ordered front-to-back, we iterate over it backwards. */Client *c;wl_list_for_each_reverse(c, &clients, link) {if (!c->mapped) {/* An unmapped client should not be rendered. */
view->x + geo_box.x + geo_box.width,view->y + geo_box.y + geo_box.height);moveresize(view, CurResize);
c->x + geo_box.x + geo_box.width,c->y + geo_box.y + geo_box.height);moveresize(c, CurResize);
* cursor. This relies on views being ordered from top-to-bottom. */struct dwl_view *view;wl_list_for_each(view, &views, link) {if (xytosurface(view, lx, ly, surface, sx, sy)) {return view;
* cursor. This relies on clients being ordered from top-to-bottom. */Client *c;wl_list_for_each(c, &clients, link) {if (xytosurface(c, lx, ly, surface, sx, sy)) {return c;