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
Fix gravity handling when reparenting a window back to the root window #2323
base: master
Are you sure you want to change the base?
Conversation
Meh. :-(
|
Uhm... okay. For some reason, the titlebars have a different size when just running the test vs when running all tests (22px for "make check", 16px for just the one test). I don't know why, nor do I know if this is a red herring or the actual problem (since the problem is a difference of one pixel, I would guess that some rounding in the division is involved, but both these sizes are even...) |
Related to some other config (file) being used maybe? |
Not sure what exactly breaks the test, but the code in To test this, I added some bindings to
Then if I run https://github.com/ccg/metacity/blob/master/src/wm-tester/test-gravity.c and use Mod4+KP_Add and Mod4+KP_Subtract on windows with Changing the titlebar size in steps of 2 instead of 1 makes the problem disappear, because in this case truncation to 0 does not happen. Changing the border width also does not cause problems, because the total width occupied by borders on opposite sizes is always even. The proper way to calculate the coordinates is to call However, all of this should not matter if the titlebar size is changed from 0 to the final value in one step, which is what should usually happen — so the problem with that test is most likely caused by something else. |
I tried to run |
Rebased on master. Still fails on Travis, but no longer fails locally. No idea what to do about this... |
mb add scrot call and upload it to fileshare, so you could see what happens in xvfb inside travis: https://github.com/themix-project/oomox-gtk-theme/blob/master/test/test.sh#L138-L141 |
A screenshot wouldn't tell me more than what the error message already says: Something is off by one pixel. I guess I would rather need to add lots of debug- |
are you able to reproduce the problem inside docker image with the same ubuntu version as on travis? (i guess, 12.04) |
I don't know and I am not going to install docker in the hopes that this might be specific to the ubuntu version. All the code that decides the positions of windows is in awesome, so the same between what is run on Travis and what is run here. I might stare a bit at |
This extends test-gravity with a test that checks that the window position does not change if a window is unmapped and mapped again. This new test currently fails. Related-to: awesomeWM#2308 Signed-off-by: Uli Schlachter <psychon@znc.in>
A window can be mapped again later after it was hidden. To make sure it ends up at the correct position, we have to (inversely) translate it for its gravity, so that the application of gravity when the window becomes visible again does not cause problems. Fixes: awesomeWM#2308 Signed-off-by: Uli Schlachter <psychon@znc.in>
Rebased on master for #2355 |
Codecov Report
@@ Coverage Diff @@
## master #2323 +/- ##
==========================================
- Coverage 84.03% 76.42% -7.62%
==========================================
Files 477 332 -145
Lines 32671 18376 -14295
==========================================
- Hits 27454 14043 -13411
+ Misses 5217 4333 -884
|
Fixes #2308
CC @sigprof (I was faster than "coming weekend", whoooh; the most complicated part of this was that I broke
test-gravity
at first, but did not notice the error (this now has to wait for a specificPropertyNotify
to know that unmapping is done, but it also listened for otherPropertyNotify
messages; the result was that that the state machine got really, really confused)).