bug-xboard
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-XBoard] Xboard-4.5.3a bug: windows sliding


From: h . g . muller
Subject: Re: [Bug-XBoard] Xboard-4.5.3a bug: windows sliding
Date: Sat, 25 Feb 2012 11:35:31 +0100
User-agent: SquirrelMail

Op Za, 25 februari, 2012 10:52 am schreef Byrial Jensen:
> Hi,
>
>
> When I start Xboard and quit again the coordinates in .xbaordrc have
> changed for all windows, even if they were never opened.

The window coordinates are all stored relative to the coordinates of the
main window. (Except for the main window itself, of course.) So if the
windows never open (which should be equivalent to when you open them biut
they are never touched), but you move the main window, the coordinates of
the others are changed. So next time they will pop up in the same absolute
place as the last time they were closed.

>
> Anyway a posible solution might be to not to change the stored positions
> in the configuration file unless the postion is changed more than some
> threshold value, so only manual movements of the windows are likely to be
> registered.

This might actually work, after correcting for the guessed frame widths
(my current Ubuntu theme seems to need subtraction of (2,22) from the
reported (x,y) to make a window on average pop up in the same location.
Before this was (3,24), which is still hard-coded in the source. And
apparently no good on OSX.

So I guess we could do both: add a -frameX and -frameY option with default
settings (2,22), which people could include in /etc/xboard.conf if for
them it is different. (Or should it be a user option, persistent in the
user settings file? I guess different users could have different
themes...)

>
> It might also be possible to read the positions both immediately after
> creation and when the windows are closed, and only change the configuration
> file if these two set of position values are different, indication a
> manual movement.

Yes, well, I tried that. One problem is that immediately after you create
them, the positions always read out as (0,0), no matter where the window
was actually popped up.

It is possible to read out the position with some delay (50 msec was
enough on my system), provided you don't use ScheduledDelayedEvent for
this (because it is busy with the engine timeout, and can only handle a
single event atthe time) and do your own timer X-calls directly.
Unfortunately the difference between the coordinates you get, and the
coordinates you requested is often not any measure for the width of the
window frame and title bar. E.g. if I position the main window in the
upper left corner, indeed (0,0) will go into the settings file. But when I
then restart XBoard, it often pops up at (0,25). This seems to depend on
whether I have a full-screen gedit window open; when I close everything
except the xterm from which I start XBoard, it does pop up at (0,0) (or
sometimes (0,1)). Of course when I ask then where it is, it will say
(2,22), but the frameX/Y offsets take care of that.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]