Allow to disable resize hints in floating layout with settings

This commit is contained in:
Alex Kotov 2021-11-13 23:01:10 +05:00
parent 53e0462a31
commit cc3de5771b
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
3 changed files with 23 additions and 1 deletions

10
dwm.c
View File

@ -386,7 +386,15 @@ applysizehints(Client *c, int *x, int *y, int *w, int *h, int bw, int interact)
*h = bh;
if (*w < bh)
*w = bh;
if (c->isfloating || !c->mon->lt[c->mon->sellt]->arrange) {
if (
c->isfloating
||
(
settings_get_respect_resize_hints_in_floating_layout()
&&
!c->mon->lt[c->mon->sellt]->arrange
)
) {
/* see last two sentences in ICCCM 4.1.2.3 */
baseismin = c->basew == c->minw && c->baseh == c->minh;
if (!baseismin) { /* temporarily remove base dimensions */

View File

@ -1,6 +1,7 @@
#include "settings.h"
static bool focus_on_wheel = true;
static bool respect_resize_hints_in_floating_layout = false;
bool settings_get_focus_on_wheel()
{
@ -11,3 +12,13 @@ void settings_set_focus_on_wheel(const bool new_focus_on_wheel)
{
focus_on_wheel = new_focus_on_wheel;
}
bool settings_get_respect_resize_hints_in_floating_layout()
{
return respect_resize_hints_in_floating_layout;
}
void settings_set_respect_resize_hints_in_floating_layout(const bool new_respect_resize_hints_in_floating_layout)
{
respect_resize_hints_in_floating_layout = new_respect_resize_hints_in_floating_layout;
}

View File

@ -6,4 +6,7 @@
bool settings_get_focus_on_wheel();
void settings_set_focus_on_wheel(bool new_focus_on_wheel);
bool settings_get_respect_resize_hints_in_floating_layout();
void settings_set_respect_resize_hints_in_floating_layout(bool new_respect_resize_hints_in_floating_layout);
#endif // _SETTINGS_H