This commit is contained in:
korei999 2023-12-08 04:04:39 +02:00
parent 3d54f28eed
commit 6d8f1a8474

66
dwl.c
View file

@ -338,7 +338,6 @@ static void pointerconstraintsetregion(struct wl_listener *listener, void *data)
static void pointerfocus(Client *c, struct wlr_surface *surface, static void pointerfocus(Client *c, struct wlr_surface *surface,
double sx, double sy, uint32_t time); double sx, double sy, uint32_t time);
static void printstatus(void); static void printstatus(void);
static void wlr_output_damage_whole(struct wlr_output *output);
static void powermgrsetmodenotify(struct wl_listener *listener, void *data); static void powermgrsetmodenotify(struct wl_listener *listener, void *data);
static void quit(const Arg *arg); static void quit(const Arg *arg);
static void rendermon(struct wl_listener *listener, void *data); static void rendermon(struct wl_listener *listener, void *data);
@ -2464,35 +2463,6 @@ powermgrsetmodenotify(struct wl_listener *listener, void *data)
wlr_output_commit(event->output); wlr_output_commit(event->output);
} }
void
wlr_output_damage_whole(struct wlr_output *output) {
int width, height;
pixman_region32_t damage;
struct wlr_output_event_damage event;
wlr_output_transformed_resolution(output, &width, &height);
pixman_region32_init_rect(&damage, 0, 0, width, height);
event = (struct wlr_output_event_damage){
.output = output,
.damage = &damage,
};
wl_signal_emit_mutable(&output->events.damage, &event);
pixman_region32_fini(&damage);
}
void
powermgrsetmodenotify(struct wl_listener *listener, void *data)
{
struct wlr_output_power_v1_set_mode_event *event = data;
wlr_output_enable(event->output, event->mode);
if (event->mode)
wlr_output_damage_whole(event->output);
wlr_output_commit(event->output);
}
void void
quit(const Arg *arg) quit(const Arg *arg)
{ {
@ -3142,42 +3112,6 @@ vertile(Monitor *m)
} }
} }
void
vertile(Monitor *m)
{
unsigned int i, n = 0, h, mh, my, ty, draw_borders = 1;
Client *c;
wl_list_for_each(c, &clients, link)
if (VISIBLEON(c, m) && !c->isfloating)
n++;
if (n == 0)
return;
if (n == smartborders)
draw_borders = 0;
if (n > m->nmaster)
ty = mh = m->nmaster ? m->w.height * m->mfact : 0;
else
ty = mh = m->w.height;
i = my = 0;
wl_list_for_each(c, &clients, link) {
if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
continue;
if (i < m->nmaster) {
h = ( mh - my ) / (MIN(n, m->nmaster) - i);
resize(c, (struct wlr_box) { .x = m->w.x, .y = m->w.y + my, .width = m->w.width, .height = h }, 0, draw_borders);
my += c->geom.height;
} else {
h = ( m->w.height - ty ) / (n - i);
resize(c, (struct wlr_box) { .x = m->w.x, .y = m->w.y + ty, .width = m->w.width, .height = h }, 0, draw_borders);
ty += c->geom.height;
}
i++;
}
}
void void
togglebar(const Arg *arg) { togglebar(const Arg *arg) {
DwlIpcOutput *ipc_output; DwlIpcOutput *ipc_output;