[CinCV TNG] [PATCH] Rewrite of BC_DisplayInfo::test_window
j6t at kdbg.org
Sat Apr 25 16:18:04 CEST 2015
Am 24.04.2015 um 22:56 schrieb Johannes Sixt:
> Am 23.04.2015 um 21:18 schrieb Einar Rünkaru:
>> On 04/23/2015 09:36 PM, Johannes Sixt wrote:
>>> Am 23.04.2015 um 19:46 schrieb Einar Rünkaru:
>>>> The function test_window attempts to determine what direction and how
>>>> much window manager moves window when drawing decorations around
>>>> the window.
>>>> This change simplifies the function: drawing only
>>>> one window in some distance from screen borders, giving explictly
>>>> some time to WM for finishing drawing and then detecting the maximum
>>>> of coordinate change.
>>>> The funcion gives name guicast_test to the created window.
>>>> This makes possible to configure WM to treat the window
>>>> specifically if needed.
>>>> + if(xm < event.xconfigure.x)
>>>> + xm = event.xconfigure.x;
>>>> + if(ym < event.xconfigure.y)
>>>> + ym = event.xconfigure.y;
>>> I do not see where xm and ym are initialized before this use here.
>>>> - }while(state != 3);
>>>> + };
>>> The semicolon is unnecessary.
>> Thanks for review.
>> Fixed patch attached.
> 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
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.
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?
More information about the Cinelerra