App placement problems on Debian/Lenny - anyone else ?

Hi all,

for the last couple of days I have noticed that most of the
time my wxpython app starts up in irregular places on
screen, in random sizes and even on random workspaces. This
happens both if I start it from a console window or from a
menu item. Sometimes it does what it is supposed to, most of
the time not. Today I noticed this for the first time with
wxGlade, too. I therefor filed a bug with python-wxgtk2.8.

My application tries to set itself to a size saved to a
database at the previous shutdown. This always worked. It
now also works sometimes, but, again, mostly not.

Environment:

Debian Testing
KDE 3.5.9
Python 2.5.2
wxPython 2.8.7.1
libgtk 2.12.11

Anyone sees anything similar ?

Karsten

···

--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

Karsten Hilbert wrote:

Hi all,

for the last couple of days I have noticed that most of the
time my wxpython app starts up in irregular places on
screen, in random sizes and even on random workspaces. This
happens both if I start it from a console window or from a
menu item. Sometimes it does what it is supposed to, most of
the time not. Today I noticed this for the first time with
wxGlade, too. I therefor filed a bug with python-wxgtk2.8.

My application tries to set itself to a size saved to a
database at the previous shutdown. This always worked. It
now also works sometimes, but, again, mostly not.

Environment:

Debian Testing
KDE 3.5.9
Python 2.5.2
wxPython 2.8.7.1
libgtk 2.12.11

Anyone sees anything similar ?

Karsten
  

I don't see this on Windows. My application runs on Linux as well, but I only have two users. They use the latest wxPython on Ubuntu and they haven't mentioned that behavior. I'm sure they would if it happened though. Do you have a call to Layout() right before or right after you show the frame? Can you upgrade to 2.8.9.1?

Mike

I don't see this on Windows. My application runs on Linux as well, but I
only have two users. They use the latest wxPython on Ubuntu and they
haven't mentioned that behavior. I'm sure they would if it happened
though. Do you have a call to Layout() right before or right after you
show the frame?

The last three lines of the main frame's __init__ are

self.SetClientSize(wx.Size(x, y)) # x and y loaded from DB
self.Center(wx.BOTH)
self.Show(True)

And the code in the wx.App subclass where the frame is set up:

frame = gmTopLevelFrame(None, -1, 'GNUmed', (640, 440))
frame.CentreOnScreen(wx.BOTH)
frame.Show(True)
self.SetTopWindow(frame)

Nothing suspicious I can see.

Can you upgrade to 2.8.9.1?

Not really as it is not available for Debian, not even for unstable or experimental. I will file a Request for Packaging on it, though.

Karsten

···

--
NUR NOCH BIS 31.01.! GMX FreeDSL - Telefonanschluss + DSL
für nur 16,37 EURO/mtl.!* DSL Vergleich 2024 | GMX.NET

Karsten Hilbert wrote:

I don't see this on Windows. My application runs on Linux as well, but I only have two users. They use the latest wxPython on Ubuntu and they haven't mentioned that behavior. I'm sure they would if it happened though. Do you have a call to Layout() right before or right after you show the frame?
    

The last three lines of the main frame's __init__ are

self.SetClientSize(wx.Size(x, y)) # x and y loaded from DB
self.Center(wx.BOTH)
self.Show(True)

And the code in the wx.App subclass where the frame is set up:

frame = gmTopLevelFrame(None, -1, 'GNUmed', (640, 440))
frame.CentreOnScreen(wx.BOTH)
frame.Show(True)
self.SetTopWindow(frame)

Nothing suspicious I can see.

I suppose you could do it yourself by getting the system resolution and the frame's position. I get my frame's position like this:

self.framePosition = (self.frame.GetPosition())

Then I'd use something like this to get the resolution:

width, height = wx.GetDisplaySize()

Then do a little math and use SetPosition() to set it. Looks like Robin even had an example in this old post:

http://www.nabble.com/-wxPython--CentreOnScreen-troubles-again-td17889123.html

Still, the CentreOnScreen call should work. Unfortunately, I don't seem to have any current code that uses it...

Can you upgrade to 2.8.9.1?
    

Not really as it is not available for Debian, not even for unstable or experimental. I will file a Request for Packaging on it, though.

Karsten
  

Robin has instructions on the wiki for upgrading on Debian and Ubuntu, although I don't know if these instructions are up to date:

http://wiki.wxpython.org/InstallingOnUbuntuOrDebian

Worth a try though, if you're the brave sort. I've used them successfully on Ubuntu before.

···

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org
Python Extension Building Network: http://www.pythonlibrary.org

>> though. Do you have a call to Layout() right before or right after you
>> show the frame?
>>
> The last three lines of the main frame's __init__ are
>
> self.SetClientSize(wx.Size(x, y)) # x and y loaded from DB
> self.Center(wx.BOTH)
> self.Show(True)
>
> And the code in the wx.App subclass where the frame is set up:
>
> frame = gmTopLevelFrame(None, -1, 'GNUmed', (640, 440))
> frame.CentreOnScreen(wx.BOTH)
> frame.Show(True)
> self.SetTopWindow(frame)
>
> Nothing suspicious I can see.

I suppose you could do it yourself by getting the system resolution and
the frame's position. I get my frame's position like this:

self.framePosition = (self.frame.GetPosition())

Then I'd use something like this to get the resolution:

width, height = wx.GetDisplaySize()

Then do a little math and use SetPosition() to set it.

Well, it is not so much *how* to set position and/or size. I can
figure that out. The strange thing is why does it suddenly
behave erratically while the exact same code worked perfectly
fine for *years* without any change of code in GNUmed and
without and (noted) update to wxPython on Debian ? Also,
why does wxGlade exhibit the same behaviour ?

http://www.nabble.com/-wxPython--CentreOnScreen-troubles-again-td17889123.html

Will read that.

>> Can you upgrade to 2.8.9.1?
>>
> Not really as it is not available for Debian, not even for unstable or
experimental. I will file a Request for Packaging on it, though.
>
Robin has instructions on the wiki for upgrading on Debian and Ubuntu,
although I don't know if these instructions are up to date:

InstallingOnUbuntuOrDebian - wxPyWiki

Worth a try though, if you're the brave sort. I've used them
successfully on Ubuntu before.

It is not so much about me - I can do that if needed. It is about
my users who can't be bothered to do any such thing.

Karsten

···

--
NUR NOCH BIS 31.01.! GMX FreeDSL - Telefonanschluss + DSL
für nur 16,37 EURO/mtl.!* DSL Vergleich 2024 | GMX.NET

Karsten Hilbert wrote:

though. Do you have a call to Layout() right before or right after you show the frame?
    

The last three lines of the main frame's __init__ are

self.SetClientSize(wx.Size(x, y)) # x and y loaded from DB
self.Center(wx.BOTH)
self.Show(True)

And the code in the wx.App subclass where the frame is set up:

frame = gmTopLevelFrame(None, -1, 'GNUmed', (640, 440))
frame.CentreOnScreen(wx.BOTH)
frame.Show(True)
self.SetTopWindow(frame)

Nothing suspicious I can see.
      

I suppose you could do it yourself by getting the system resolution and the frame's position. I get my frame's position like this:

self.framePosition = (self.frame.GetPosition())

Then I'd use something like this to get the resolution:

width, height = wx.GetDisplaySize()

Then do a little math and use SetPosition() to set it.
    

Well, it is not so much *how* to set position and/or size. I can
figure that out. The strange thing is why does it suddenly
behave erratically while the exact same code worked perfectly
fine for *years* without any change of code in GNUmed and
without and (noted) update to wxPython on Debian ? Also,
why does wxGlade exhibit the same behaviour ?
  
I don't know. Have updates been pushed out or pulled in by Debian automatically? I've seen weird things on Windows when updates get applied, although not with my applications. Maybe a change in themes?

Mike

> Well, it is not so much *how* to set position and/or size. I can
> figure that out. The strange thing is why does it suddenly
> behave erratically while the exact same code worked perfectly
> fine for *years* without any change of code in GNUmed and
> without and (noted) update to wxPython on Debian ? Also,
> why does wxGlade exhibit the same behaviour ?
>

I don't know. Have updates been pushed out or pulled in by Debian
automatically?

Not that I noticed anything that seemed relevant to wxPython or
the stack it is built upon. However, a change may be buried deep in the

driver
kernel
  framebuffer
   libc
    X server
     KDE
      libgtk
       wxgtk
        python-wxgtk

stack ...

I've seen weird things on Windows when updates get
applied, although not with my applications. Maybe a change in themes?

That might be an idea although I know I did not change
the theme manually in any way.

Karsten

···

--
NUR NOCH BIS 31.01.! GMX FreeDSL - Telefonanschluss + DSL
für nur 16,37 EURO/mtl.!* DSL Vergleich 2024 | GMX.NET

Karsten Hilbert wrote:

Hi all,

for the last couple of days I have noticed that most of the
time my wxpython app starts up in irregular places on
screen, in random sizes and even on random workspaces. This
happens both if I start it from a console window or from a
menu item. Sometimes it does what it is supposed to, most of
the time not. Today I noticed this for the first time with
wxGlade, too. I therefor filed a bug with python-wxgtk2.8.

My application tries to set itself to a size saved to a
database at the previous shutdown. This always worked. It
now also works sometimes, but, again, mostly not.

Environment:

Debian Testing
KDE 3.5.9
Python 2.5.2
wxPython 2.8.7.1
libgtk 2.12.11

Anyone sees anything similar ?

Have you made any changes to your window manager settings? It is the thing that ultimately decides where to position the frames and it can even ignore the frame's wishes on size and position if it wants to.

···

--
Robin Dunn
Software Craftsman
http: /wxPython.org Java give you jitters? Relax with wxPython!

I swear I didn't. I cannot swear that any of the recent
Debian upgrades did not in some subtle way (although I
didn't notice anything).

However:

It behaves *erratically* !

- Sometimes it opens up the size it should
- Most of the time it opens up in a random place with a
  random size, sometimes on the workspace where I start
  it, sometimes on others.
- Every time it does NOT size properly it sizes in a
  different way and in a different place !

Does that still sound like "expected" behaviour even if
something changed the window manager settings ? I'd expect
it to be wrong but consistent.

Karsten

···

On Fri, Jan 23, 2009 at 11:08:32AM -0800, Robin Dunn wrote:

My application tries to set itself to a size saved to a
database at the previous shutdown. This always worked. It
now also works sometimes, but, again, mostly not.

Environment:

Debian Testing
KDE 3.5.9
Python 2.5.2
wxPython 2.8.7.1
libgtk 2.12.11

Anyone sees anything similar ?

Have you made any changes to your window manager settings? It is the
thing that ultimately decides where to position the frames and it can
even ignore the frame's wishes on size and position if it wants to.

--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

Karsten Hilbert wrote:

···

On Fri, Jan 23, 2009 at 11:08:32AM -0800, Robin Dunn wrote:

My application tries to set itself to a size saved to a
database at the previous shutdown. This always worked. It
now also works sometimes, but, again, mostly not.

Environment:

Debian Testing
KDE 3.5.9
Python 2.5.2
wxPython 2.8.7.1
libgtk 2.12.11

Anyone sees anything similar ?

Have you made any changes to your window manager settings? It is the thing that ultimately decides where to position the frames and it can even ignore the frame's wishes on size and position if it wants to.

I swear I didn't. I cannot swear that any of the recent
Debian upgrades did not in some subtle way (although I
didn't notice anything).

However:

It behaves *erratically* !

- Sometimes it opens up the size it should
- Most of the time it opens up in a random place with a
  random size, sometimes on the workspace where I start
  it, sometimes on others.
- Every time it does NOT size properly it sizes in a
  different way and in a different place !

Does that still sound like "expected" behaviour even if
something changed the window manager settings ? I'd expect
it to be wrong but consistent.

I wouldn't expect it on the size, but I seem to remember that KDE has a "Random" window placement setting.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!