[Gambas-user] Window position error on applying stored "geometry"

Bruce bbruen at ...2308...
Sun Jun 3 03:02:59 CEST 2012


On Sun, 2012-06-03 at 01:24 +0100, RICHARD WALKER wrote:
> Using Gambas 3.1.1 as distributed with Mageia 2. I believe it may be
> somewhat patched as it includes Mageia in the packaging wizard
> distribution selection screen.
No, Mageia is in the original.

> I have a small front-end program for controlling jack_capture for
> which I have implemented a .conf settings file. Amongst other things,
> the settings file stores the last screen location/size. The entry in
> the .conf file may look like this:
> [Window]
> Geometry=[574,26,344,148,0]
> 
> At startup the program will actually appear at 574,52. If this
> location is stored to the .conf file on exit then the next startup
> will put the window at 574,78. In general the window will always
> appear at a location 26 pixels below the "restored" setting.
> 
> It is not, perhaps, a coincidence that the task-bar height is 26
> pixels. If I create a settings .file entry like this:
> [Window]
> Geometry=[574,0,344,148,0]
> 
> then the program will open with its window tucked up neatly below the
> task bar. The Fmain.Top value will, of course, be 26. Changing the
> task bar height to 32 will change all of the displacements from 26 to
> 32.
> 
> So far, so good. If I can find the panel in the Desktop.Windows list
> then I can change my Settings file write procedure to incorporate the
> offset thus:
> 
> Adjusted_Top = Fmain.Top - panel_height
> Settings["Window/Geometry"] = [Fmain.Left, Adjusted_Top, Fmain.Width,
> Fmain.Height, 0]
> 
> That should solve the problem, but I am not clear as to why it  is
> necessary. Why not use absolute screen locations and completely avoid
> the task bar issue?
> 
> The observant among you may be wondering why I did not use the Write
> settings method. In fact I have used it but it causes a crash if the
> program is closed when it is on the second monitor. I can, however,
> use
> 
> Settings.Read(Fmain, "Window")
> 
> which will load the screen settings correctly, whichever screen is
> indicated by the X location.
> 
> I was wondering if this is only an issue with Gambas 3 on the LXDE
> desktop, but I cannot test this as I am keeping this machine
> lean'n'mean; that means KDE4 and Gnome 3 are not allowed near it.
I'm with you there Richard! :-)  I've been using LXDE since the first KDE4 debacle was released

> Richard

Now this is a wild guess, but are you running lxpanel at the top of the
screen?  There is an outstanding bug regarding this going back about 2
years or so, especially if it has the default name.

I run mine down the left hand side and
1) Settings.Write and Settings.Read both work fine
2) The window does not move down the screen.

I do remember such an effect happening with something else not gambas,
so maybe???

Anyway the sun just came out in Strathalbyn and I'm off to lunch! So
best of luck.
Bruce





More information about the User mailing list