Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add window resize hints support #32

Merged
merged 3 commits into from
Jul 6, 2017
Merged

Add window resize hints support #32

merged 3 commits into from
Jul 6, 2017

Conversation

CamilleScholtz
Copy link
Contributor

@CamilleScholtz CamilleScholtz commented Jul 1, 2017

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
Copy link
Owner

tudurom commented Jul 5, 2017

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
Copy link
Contributor Author

CamilleScholtz commented Jul 5, 2017

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
Copy link
Owner

tudurom commented Jul 5, 2017

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
Copy link
Contributor Author

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
Copy link
Owner

tudurom commented Jul 5, 2017 via email

@CamilleScholtz
Copy link
Contributor Author

CamilleScholtz commented Jul 5, 2017

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
Copy link
Owner

tudurom commented Jul 6, 2017

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
Copy link
Contributor Author

CamilleScholtz commented Jul 6, 2017

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
Copy link
Owner

tudurom commented Jul 6, 2017

seems legit

@tudurom tudurom merged commit 70d96fb into tudurom:master Jul 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants