When using -g hint the WM that we've got user specified geometry #78

Merged
merged 1 commit into from Feb 9, 2013

Conversation

Projects
None yet
2 participants
Contributor

4z3 commented Jan 30, 2013

Without this some window managers (e.g. fvwm) will ignore the initial
window position and place it according to it's own rules.

@4z3 4z3 When using -g hint the WM that we've got user specified geometry
Without this some window managers (e.g. fvwm) will ignore the initial
window position and place it according to it's own rules.
3f25b90
Owner

muennich commented Jan 30, 2013

I do not understand why we have to set sizehints at all without the -g option given on the command line. Also, after looking at the diff of your commit, I'm not quite sure if it yields the same behaviour as before. Without testing your code, I'm quite confident, that the two if-conditions in lines 143 and 147 are always false.

Can you please tell me a bit more about your intent? Am I right assuming, that all you want, is to also set the gravity and the USPosition/USSize flags of the windows sizehints when the -g option is given on the command line?

Contributor

4z3 commented Jan 30, 2013

I want to set USPosition and/or USSize if the user has specified a position and/or size with -g. The gravity was set to default to NorthWestGravity and change it if the user provided negative coordinates.

You're right that we don't have to set the sizehints if neither -g nor -F where given, so setting the sizehints would be a no-op. Of course we could check if win->sizehints.flags is not 0 and only then call XSetWMNormalHints(), e.g. in win_set_sizehints() or before calling win_set_sizehints().

According to the if-conditions in lines 143 and 147, they're true iff the if-condition in line 252 evaluates to true, i.e. -F was given. This should preserve the original behavior.

Owner

muennich commented Jan 31, 2013

I will merge and refine your commit later. Regarding the if-conditions: the expression (X & Mask) == 1 is false for all Masks besides 1; according to <X11/Xuitl.h> both PMinSize and PMaxSize are a power of two greater than 1. So the correct conditionals should look like (X & Mask) == Mask.

Contributor

4z3 commented Jan 31, 2013

I see. Thanks for pointing that out!

Owner

muennich commented Feb 9, 2013

I've merged your commit into my sizehints branch and slightly corrected/refined its changes. Can you please try it out and see if it works as expected?

Contributor

4z3 commented Feb 9, 2013

Your changes work as expected, thanks for merging it.

Unfortunately your patch also introduced a minimum window size of 50x30 that wasn't expected. And now I'm really sad as I cannot display 16x11 icons without a huge gray border anymore.. :)

Owner

muennich commented Feb 9, 2013

I've removed the window size checks. Is everything okay with you? Can I merge it into master?

Contributor

4z3 commented Feb 9, 2013

For me now everything works as expected. Please feel free to merge it.

@muennich muennich added a commit that referenced this pull request Feb 9, 2013

@muennich muennich Merge branch 'sizehints', fixed issue #78 c6bfac1

muennich merged commit 3f25b90 into muennich:master Feb 9, 2013

4z3 deleted the 4z3:set-user-specified-sizehints branch Feb 9, 2013

4z3 restored the 4z3:set-user-specified-sizehints branch Feb 9, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment