[CinCV TNG] [PATCH] Rewrite of BC_DisplayInfo::test_window

Einar R√ľnkaru einarrunkaru at gmail.com
Sat Apr 25 19:48:36 CEST 2015

Hi, Hannes

On 04/25/2015 05:18 PM, Johannes Sixt wrote:
> Am 24.04.2015 um 22:56 schrieb Johannes Sixt:

>> I tested this new patch, and it does not work *at all*. I use the KDE
>> that comes with openSuSE 13.2. The window manager should therefore be
>> KWM.
>> The old code works flawlessly. The windows are never offset by a single
>> pixel.

Old code assumes WM does not have bar on top or left. When there is bar, 
the computed values are slightly wrong. Then as Yaroslav reported old 
test hangs when WM for some reason decides to resisze the test window.
> It looks like most of the time the ConfigureNotify event is not
> received. This leaves xm and ym at zero, minus TEST_X and TEST_Y at the
> end of the function computes an offset of -100.

Ok. The check that the result offset is reasonable should be added.
> I say "most of the time" because test_window() is now called many times
> since the test 'top_border < 0' in init_borders() keeps calling
> test_window() many times. At one point, the ConfigureNotify is received,
> but that happens so late in the game that all windows are already
> shifted by 100 pixels.
> Perhaps the calls to XMoveResizeWindow() and XResizeWindow() that you
> removed should remain?

Can you increment the usleep value? Or add sleep(5) after it. May be the 
test_window just should give some more time to WM. The question is will 
we wait too few or for some reason ConfigureNotify is not sent.


More information about the Cinelerra mailing list