tudurom / windowchef

Window Chef is a stacking window manager that cooks windows with orders from the Waitron
https://tudorr.ro/software/windowchef/
ISC License
203 stars 14 forks source link

Add window resize hints support #32

Closed CamilleScholtz closed 7 years ago

CamilleScholtz commented 7 years ago

I'm not exactly sure what:

        if (e->value_mask & XCB_CONFIG_WINDOW_WIDTH) {
            values[i] = e->width;
            i++;
        }

        if (e->value_mask & XCB_CONFIG_WINDOW_HEIGHT) {
            values[i] = e->height;
            i++;
        }

are for, maybe they need to be:

        if (e->value_mask & XCB_CONFIG_WINDOW_WIDTH) {
            values[i] = e->width - (e->width % client->width_inc);
            i++;
        }

        if (e->value_mask & XCB_CONFIG_WINDOW_HEIGHT) {
            values[i] = e->height - (e->height % client->height_inc);
            i++;
        }

I also didn't add a man page entry as of yet.

tudurom commented 7 years ago

I can't understand what does these hints actually do. The user always specifies how much should a windows change its size. So if windows resize hints are enabled, how much are windows actually resized?

CamilleScholtz commented 7 years ago

For example most (if not all?) terminals have some atom set that tells window managers to snap the size to their collum/row size weh resizing, that way the padding is always the same.

So if a window does not have the atom set it will just resize normally with 1px "intervals" but when I resize my terminal that has a row height/width of ~7/14px it will do so in intervals of 7/14px, try resizing urxvt or st with resize hints enabled using xmrs for example.

But yeah, this is especially useful/noticeable if you resize a window using xmrs btw.

tudurom commented 7 years ago

Yeah I see that it is much comfortable to use like that. But I think that resizing with increments shouldn't be handled by the configure_window event handler. The increments should be used only when the user manually resizes the window via waitron.

CamilleScholtz commented 7 years ago

But what if you use xmrs? xmrs (and many other tools) do not check for these hints. In fact I think it's actually the job of the window manager, openbox does it too like this.

tudurom commented 7 years ago

Oh, good point. Then, let the wm handle that. If a program wants fine-grained control, then it can temporarily disable increments (to do: perhaps implement mutexes someday).

I remember that i tested wmrs against your patch and growing windows didn't work.

On Thu, Jul 6, 2017, 00:34 Camille notifications@github.com wrote:

But what if you use xmrs? xmrs (and many other tools) do not check for these hints. In fact I think it's actually the job of the window manager, openbox does it too like this.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/tudurom/windowchef/pull/32#issuecomment-313233480, or mute the thread https://github.com/notifications/unsubscribe-auth/AKNZTFGo5KvIReJJHmdrGvftU0vrdCO9ks5sLAFzgaJpZM4OLarG .

CamilleScholtz commented 7 years ago

actually is seems like waitron window_resize N N still just uses Npx intervals. However wrs N N (pfw) does snap. I don't know what the cleanest/most consistent solution to this would be.

tudurom commented 7 years ago

The cleanest, simplest and easiest fix si to make ipc_windows_resize respect increments. Easy.

Also it seems that growing windows with wrs and increments doesn't work:

screenshot

CamilleScholtz commented 7 years ago

probably because it snaps to the nearest size, which with 1 would almost always be the current size. for me wrs +14 0 does work for example.

tudurom commented 7 years ago

seems legit