Skip to content

Commit ceefe56

Browse files
committed
Resize hints are now used for manual resizing.
1 parent 70d96fb commit ceefe56

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

wm.c

+6-7
Original file line numberDiff line numberDiff line change
@@ -678,8 +678,7 @@ setup_window(xcb_window_t win)
678678
client->min_height = hints.min_height;
679679
}
680680

681-
if (hints.flags & XCB_ICCCM_SIZE_HINT_P_RESIZE_INC &&
682-
conf.resize_hints) {
681+
if (hints.flags & XCB_ICCCM_SIZE_HINT_P_RESIZE_INC) {
683682
client->width_inc = hints.width_inc;
684683
client->height_inc = hints.height_inc;
685684
}
@@ -922,10 +921,10 @@ resize_window(xcb_window_t win, int16_t w, int16_t h)
922921
if (client->min_height != 0 && ah < client->min_height)
923922
ah = client->min_height;
924923

925-
focused_win->geom.width = aw;
926-
focused_win->geom.height = ah;
924+
client->geom.width = aw - conf.resize_hints * (aw % client->width_inc);
925+
client->geom.height = ah - conf.resize_hints * (ah % client->height_inc);
927926

928-
resize_window_absolute(win, aw, ah);
927+
resize_window_absolute(win, client->geom.width, client->geom.height);
929928
}
930929

931930
/*
@@ -2173,11 +2172,11 @@ event_configure_request(xcb_generic_event_t *ev)
21732172

21742173
if (e->value_mask & XCB_CONFIG_WINDOW_WIDTH
21752174
&& !client->maxed && !client->monocled && !client->hmaxed)
2176-
client->geom.width = e->width - (e->width % client->width_inc);
2175+
client->geom.width = e->width - conf.resize_hints * (e->width % client->width_inc);
21772176

21782177
if (e->value_mask & XCB_CONFIG_WINDOW_HEIGHT
21792178
&& !client->maxed && !client->monocled && !client->vmaxed)
2180-
client->geom.height = e->height - (e->height % client->height_inc);
2179+
client->geom.height = e->height - conf.resize_hints * (e->height % client->height_inc);
21812180

21822181
if (e->value_mask & XCB_CONFIG_WINDOW_STACK_MODE) {
21832182
values[0] = e->stack_mode;

0 commit comments

Comments
 (0)