raboof / notion

Tiling tabbed window manager
https://notionwm.net/
GNU Lesser General Public License v2.1
268 stars 63 forks source link

Winprop 'min_size' seems to be ignored #312

Open urbanware-org opened 3 years ago

urbanware-org commented 3 years ago

Notion 4 seems to ignore the min_size property.

I just noticed that I can resize (downsize) floating windows, even though, I have the following code inside my cfg_kludges.cfg.

For example with Firefox:

defwinprop{
    class = "Firefox",
    role = "browser",
    float = true,
    min_size = { w = 780, h = 660 },
    max_size = { w = 780, h = 660 },
}

The max_size property works properly. I can't make the window larger than the given size.

raboof commented 3 years ago

Ah - I think this is an effect of #95 (also mentioned in https://notionwm.net/migration.html).

The background here is that honoring the minimum sizes as reported by the windows themselves was broken on Notion 3. When we fixed it we noticed that lead to undesirable behavior: some applications report unnecessarily large min_size values, which is especially annoying since the minimum applies to the whole frame, regardless of which tab is selected.

We then decided to disable honoring min_size by default, but provide a winprop to honor it (ignore_min_size = false). I guess we didn't realize that this would also apply to min_size when it is set via winprop.

Perhaps it would be a nice improvement to change the default value for ignore_min_size to depend on whether or not min_size is set for this winprop?

urbanware-org commented 3 years ago

some applications report unnecessarily large min_size values, which is especially annoying since the minimum applies to the whole frame, regardless of which tab is selected.

Indeed an undesirable behavior.

but provide a winprop to honor it (ignore_min_size = false)

Do I get you right? You mean adding the line to the defwinprop block as follows?

defwinprop{
    class = "Firefox",
    role = "browser",
    float = true,
    ignore_min_size = false,
    min_size = { w = 780, h = 660 },
    max_size = { w = 780, h = 660 },
}

If so, it did not work for me.

Perhaps it would be a nice improvement to change the default value for ignore_min_size to depend on whether or not min_size is set for this winprop?

Sounds good!

raboof commented 3 years ago

but provide a winprop to honor it (ignore_min_size = false)

Do I get you right? You mean adding the line to the defwinprop block as follows?

defwinprop{
    class = "Firefox",
    role = "browser",
    float = true,
    ignore_min_size = false,
    min_size = { w = 780, h = 660 },
    max_size = { w = 780, h = 660 },
}

That's what I meant, yeah.

If so, it did not work for me.

Hmm, then I guess this needs more analysis ;). Do you have a chance to dig into this?

urbanware-org commented 3 years ago

Hmm, then I guess this needs more analysis ;)

Yes, looks like. 😄

Do you have a chance to dig into this?

You mean dig inside the code to find the reason?

raboof commented 3 years ago

Do you have a chance to dig into this?

You mean dig inside the code to find the reason?

yes :)

urbanware-org commented 3 years ago

I think I'm not able to do so... my only basic C/C++ skills have vanished meanwhile. It's been quite a while (or rather ages) since I used those languages.