PDA

View Full Version : Windows not appearing in XP.



beardybloke
22nd October 2007, 12:31
I have an odd issue in QT3.3.5.

I have windows XP and Solaris (SunOS 5.8) platforms for testing on.

My app has a toolbutton which creates a new window, further pushes of the toolbutton create new copies of the same window.

In solaris I can do this many times (I've tested up to around 25 windows). However in windows after creating three windows, the system appears to give up drawing the windows. Within a debugger I can see all the memory (about 8-9MB) being allocated and objects created, etc. All seems fine with the internal data structures, there is simply no window drawing going on. All that happens is that each time the button is pushed the system appears to stall for a few seconds and then the entire screen flickers for a few seconds. This flicker also shows when I exit the application.

Is there any known issue with window drawing in Windows XP versus Solaris that I should be aware of?

Sorry for no code snippet, but I couldnt come up with a small enough snippet to demonstrate the issue.

wysota
22nd October 2007, 14:19
Without seeing the code, we won't be able to do anything. Could you at least show the code used for constructing and displaying such a window?

beardybloke
23rd October 2007, 13:10
Thanks for that - I'll try to spend some time today looking at creating a minimum failing case that I can demonstrate the issue.

Just to add some extra info to this....

After an afternoon of single stepping through the code checking pointers, etc...

I find that the stack goes as follows:-

MyObject::show()
QDialog::show()
QWidget::show()
.. which then loops around the child widgets.
.. calling showChildren() which in turn calls show() recursively....
QWidget::showChildren()
QWidget::show()
QWidget::showChildren()
QWidget::ShowChildren() - at this point I am unable to trace further - this method begins the flicker. I dont appear to have the source for this method (with the Capitalised "S").

On one occasion I was able to get the dialog window to appear but with none of the widgets on it. I attempted to resize the window and other things to see if any of the redraw mechanisms would refresh it.

From there I saw the various widgets being painted on the screen, not on the window I expected but in the top left hand corner of the window on the background. All sorts of menus and tabbed windows were drawn but then disappeared one by one - which i think is probably what is happening when the code attempts to draw the window in the first place - manifesting itself as the flicker.

Is it possible that somehow the parent window connection has been lost and its simply drawing on the main screen? Has anyone seen anything like this? Any hints/tips on following this up?

As I said before I'm a but of a newbie at Qt.

I'll spend some time today seeing if I can come up with a minimum failing case that I can post later.

jacek
24th October 2007, 00:24
In solaris I can do this many times (I've tested up to around 25 windows). However in windows after creating three windows, the system appears to give up drawing the windows.
How complex are these windows? AFAIR there's some limit of HWNDs you can have, but you shouldn't run out of them with just three windows.

wysota
24th October 2007, 00:33
We'd appreciate to see some code.

beardybloke
24th October 2007, 10:43
How complex are these windows? AFAIR there's some limit of HWNDs you can have, but you shouldn't run out of them with just three windows.

These windows are fairly complex and allocate a load of memory.

I havent had a chance to look at generating a code snippet to demonstrate this any further as I've been assigned to look at something else in the meantime.

An extra piece of information that I did discover yesterday - I'm beginning to think its simply a resource issue on the PC rather than a Qt issue per se, while i was recreating this I had a small compile for something else going in the background, the compile failed with a win32 error 1114 whilst trying to load user32.dll. With that in mind I tried to load the taskmanager & a performance meter and they failed to load (reported by Event Viewer). Another less complex window within the app, which doesnt have the problem on its own will also redraw on the screen background rather than within the dialog once I get to this state. I'll dig around when I get back to this problem probably tomorrow.

Thanks again for all your help so far.

jacek
24th October 2007, 13:26
I'm beginning to think its simply a resource issue on the PC rather than a Qt issue per se, while i was recreating this I had a small compile for something else going in the background, the compile failed with a win32 error 1114 whilst trying to load user32.dll.
You can use Process Explorer (http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/ProcessExplorer.mspx) to see how much resources your application uses (esp. it can display the number of open handles).

beardybloke
24th October 2007, 18:32
You can use Process Explorer (http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/ProcessExplorer.mspx) to see how much resources your application uses (esp. it can display the number of open handles).


Thanks for that - this showed that the window was consuming about 3K User Handles. Everything goes screwy after 10K which appears to be the limit (http://support.microsoft.com/kb/327699).

Thanks for the pointers....