fix: avoid use null mon when session not active
This commit is contained in:
@@ -83,7 +83,7 @@ setclient_coordinate_center(Client *c, struct wlr_box geom, int offsetx,
|
||||
|
||||
uint32_t cbw = check_hit_no_border(c) ? c->bw : 0;
|
||||
|
||||
if (!c->no_force_center) {
|
||||
if (!c->no_force_center && m) {
|
||||
tempbox.x = m->w.x + (m->w.width - geom.width) / 2;
|
||||
tempbox.y = m->w.y + (m->w.height - geom.height) / 2;
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
void set_size_per(Monitor *m, Client *c) {
|
||||
Client *fc = NULL;
|
||||
bool found = false;
|
||||
|
||||
if (!m || !c)
|
||||
return;
|
||||
|
||||
wl_list_for_each(fc, &clients, link) {
|
||||
if (VISIBLEON(fc, m) && ISTILED(fc) && fc != c) {
|
||||
c->master_mfact_per = fc->master_mfact_per;
|
||||
|
||||
@@ -1353,7 +1353,8 @@ void applyrules(Client *c) {
|
||||
}
|
||||
}
|
||||
|
||||
set_size_per(mon, c);
|
||||
if (mon)
|
||||
set_size_per(mon, c);
|
||||
|
||||
// if no geom rule hit and is normal winodw, use the center pos and record
|
||||
// the hit size
|
||||
|
||||
Reference in New Issue
Block a user