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

More gravity-related changes #2363

Merged
merged 3 commits into from Oct 7, 2018
Merged

Conversation

psychon
Copy link
Member

@psychon psychon commented Aug 20, 2018

Still none of the bugs reported by @sigprof are fixed, but here are some more gravity-related changes that hopefully simplify the code (and an unrelated bugfix is in here as well).

Before this commit, the code in here first handled clients changing its
x/y position and afterwards it handled resizes. This meant that the
special case of "client resizes without moving itself so we need to
apply gravity" had to have special checks on whether the client moved
itself or not.

Change the code so that resizes are handled first and moves later. This
naturally handles the problem: If the client resizes and moves itself,
the move done for the resize is later overwritten when the move is
handled.

No functional changes are intended.

Signed-off-by: Uli Schlachter <uli.schlachter@informatik.uni-oldenburg.de>
The function window_set_border_width() causes its own gravity handling.
Thus, to make sure that this gravity handling does not interfere with
what the code in here does later, we just apply changes to the border
width first, and then do everything else.

Signed-off-by: Uli Schlachter <uli.schlachter@informatik.uni-oldenburg.de>
c->size_hints.win_gravity only contains something valid if the
XCB_ICCCM_SIZE_HINT_P_WIN_GRAVITY bit is set in the flags. Most likely
this wasn't noticed before, because most code just happens to
zero-initialize this field and gravity 0 is NorthWest, which does not do
anything.

Signed-off-by: Uli Schlachter <uli.schlachter@informatik.uni-oldenburg.de>
@codecov
Copy link

codecov bot commented Aug 20, 2018

Codecov Report

Merging #2363 into master will increase coverage by 0.08%.
The diff coverage is 80%.

@@            Coverage Diff             @@
##           master    #2363      +/-   ##
==========================================
+ Coverage   84.03%   84.11%   +0.08%     
==========================================
  Files         477      478       +1     
  Lines       32671    34448    +1777     
==========================================
+ Hits        27454    28976    +1522     
- Misses       5217     5472     +255
Flag Coverage Δ
#c_code 75.16% <80%> (+2.58%) ⬆️
#functionaltests 72.05% <ø> (+0.07%) ⬆️
#lua53 86.93% <ø> (-0.25%) ⬇️
#samples 72% <ø> (+0.3%) ⬆️
#unittests 57.53% <ø> (-0.79%) ⬇️
Impacted Files Coverage Δ
event.c 71.86% <80%> (+0.28%) ⬆️
lib/menubar/init.lua 14.64% <0%> (-2.77%) ⬇️
lib/naughty/dbus.lua 22.56% <0%> (-2.67%) ⬇️
objects/client.h 65.95% <0%> (-0.71%) ⬇️
property.h 100% <0%> (ø) ⬆️
tests/_client.lua 100% <0%> (ø) ⬆️
tests/test-awful-placement.lua 95.19% <0%> (ø)
xwindow.c 92.93% <0%> (+0.54%) ⬆️
lib/awful/placement.lua 92.59% <0%> (+0.95%) ⬆️
lib/awful/rules.lua 94.53% <0%> (+1.64%) ⬆️
... and 6 more

@Elv13
Copy link
Member

Elv13 commented Oct 7, 2018

@psychon Is this ready to merge now or do you plan to do the "other half" of the gravity issues you mentioned in the first comment along with merging this?

@psychon
Copy link
Member Author

psychon commented Oct 7, 2018

or do you plan to do the "other half" of the gravity issues you mentioned in the first comment along with merging this?

I tried fixing those bugs a couple of times already and never got anywhere... :-(

@psychon psychon merged commit a54fea4 into awesomeWM:master Oct 7, 2018
@psychon psychon deleted the more_gravity branch October 7, 2018 11:46
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.

None yet

3 participants