U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » Look and Chameleon Technology » Question to UPP developers: the issue with windows rendering (Windows XP)
Question to UPP developers: the issue with windows rendering (Windows XP) [message #29227] Tue, 12 October 2010 09:05 Go to next message
porto is currently offline  porto
Messages: 51
Registered: March 2007
Member
There is a strange issue with UPP windows rendering: the window title bar becomes rounded shape (themed) not immediately, but first rectangle is drawn. Animated GIF File is attached. Native applications that use WinAPI and QT apps don't have this issue. It's a little bit annoying. Can you explain or fix it?

Sorry for bad English.

[Updated on: Tue, 12 October 2010 16:05]

Report message to a moderator

Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29241 is a reply to message #29227] Wed, 13 October 2010 08:53 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3458
Registered: August 2008
Senior Veteran
Hello Porto

Excellent gif to explain it. However I cannot reproduce it, perhaps because window opening in my case is so fast that I cannot see the defect.


Best regards
Iñaki
Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29251 is a reply to message #29241] Wed, 13 October 2010 10:49 Go to previous messageGo to next message
porto is currently offline  porto
Messages: 51
Registered: March 2007
Member
Hello koldo!
Maybe your system is too fast. The best way to see this issue is to use an application that can record video screenshots, and then play the recorded video in slow motion mode or by frames.
I made another animation with this program:
http://www.wisdom-soft.com/downloads/setupautoscreenrecorder free.exe
If you will try this app, don't set "Object / Window" of "Active window" in "Record What" section. I dod't know why, but these options don't work properly with UPP windows for me.

Animation file is attached. (This animation is recorded on other system)

[Updated on: Wed, 13 October 2010 10:53]

Report message to a moderator

Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29254 is a reply to message #29251] Wed, 13 October 2010 12:24 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3458
Registered: August 2008
Senior Veteran
Hello porto

I have used your program to record the desktop but I did not get the problem.

I was wondering if the issue is not about how a new window is rendered, but about how an U++ application fills the upper borders of a window that is opened over it.


Best regards
Iñaki
Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29257 is a reply to message #29254] Wed, 13 October 2010 14:18 Go to previous messageGo to next message
porto is currently offline  porto
Messages: 51
Registered: March 2007
Member
You're right, I incorrectly described the issue - it's about how an U++ application fills the upper borders of a window.
Very strange. I'm getting this issue on 3 different systems with WindowsXP.
What operating system and version of UPP do you use? Can you upload your recorded video?

P.S. Can you ask the developers, maybe they would look at my post with a description of the issue? I really liked UPP, but a little bit annoying this issue.

P.P.S. I have just tried to record another video, and at first in slow view mode I dont't noticed the issue. But when I loaded the video to VirtualDub and watched it frame by frame - I noticed this issue.

Thanks.

[Updated on: Wed, 13 October 2010 14:54]

Report message to a moderator

Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29258 is a reply to message #29251] Wed, 13 October 2010 15:07 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1367
Registered: November 2005
Location: Poland
Ultimate Contributor

I think I saw this effect when parsing progress indicator dialog showed up. In other cases I was not able to see it. Open CtrlCore/Win32Wnd.cpp. There is InitWin32 method. Try to change values for wc.hbrBackground and/or wc.style (maybe CS_SAVEBITS or 0x20000 causes this, try to remove them). It's just an idea. Hard to say what's the source of the problem.
Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29259 is a reply to message #29258] Wed, 13 October 2010 15:37 Go to previous messageGo to next message
porto is currently offline  porto
Messages: 51
Registered: March 2007
Member
Thanks, I tried to do as you wrote, but it didn't help. Maybe I did something wrong. I'd love to know the opinion of UPP creators about this issue, if it's of course possible...

[Updated on: Wed, 13 October 2010 18:08]

Report message to a moderator

Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29262 is a reply to message #29259] Wed, 13 October 2010 18:44 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
porto wrote on Wed, 13 October 2010 09:37

Thanks, I tried to do as you wrote, but it didn't help. Maybe I did something wrong. I'd love to know the opinion of UPP creators about this issue, if it's of course possible...


Well, the problem is we have little influence there: All windows borders (including these round corners) are in fact drawn by win32.

Does this happen if window gets opened over U++ app? In that case the issue is most likely caused by delayed rendering of underlying window.

Is it only delay, or you have to move the window to make it look right?

Mirek
Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29275 is a reply to message #29262] Wed, 13 October 2010 20:01 Go to previous messageGo to next message
porto is currently offline  porto
Messages: 51
Registered: March 2007
Member
Quote:

Does this happen if window gets opened over U++ app?

No, this happens in any case (for new UPP windows too) whith every UPP app, but sometimes it's hard to notice.

Quote:

Is it only delay, or you have to move the window to make it look right?

It's only delay.

I'll say it again, the issue arises on an different computers running Windows XP. Native WinAPI apps or e.g. apps that use QT don't have this issue. Perhaps it is not necessary to pay your attention, but I would like to UPP application looked more natively in Windows.

Does not anyone notice this issue? I noticed this around 3 years ago when I first meet whith UPP. This is a wonderful framework!

[Updated on: Wed, 13 October 2010 20:05]

Report message to a moderator

Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29276 is a reply to message #29275] Wed, 13 October 2010 20:12 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
No, never noticed it and I have an eye for things like this. Are your systems new or old? Do they have the same video card/driver?

And a question for Mirek: does U++ create the underlying WinAPI frame in one go? I am sure you are aware that for some properties, updating them is not enough and you have to "recreate" the HWND. I ran into this problem with my ancient WinAPI wrapper. This doesn't affect us that much because our widgets don't wrap native ones, but still maybe it is related to this?
Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29277 is a reply to message #29276] Wed, 13 October 2010 20:23 Go to previous messageGo to next message
porto is currently offline  porto
Messages: 51
Registered: March 2007
Member
One of my systems is a netbook ASUS Eee PC 1001P, the second system is a modern desktop with discrete video (NVidia GSO 9600). My third system is 4 years old (Pentium 4 3Ghz, int. video). But I saw this issue on other systems. Every system I tried runs Windows XP SP3.
Now this issue is mystycal for me... Sad

For Mirek: May be a delay happens at the stage of initializing the window? Because when a window is moving, or when it is minimizing / maximizing issue doesn't occur.
And a silly assumption: all of my systems are running Russian edition of Windows XP. Can there be a reason for this issue?

[Updated on: Thu, 14 October 2010 07:25]

Report message to a moderator

Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29294 is a reply to message #29262] Thu, 14 October 2010 10:45 Go to previous messageGo to next message
porto is currently offline  porto
Messages: 51
Registered: March 2007
Member
I found a better way to see this issue.
Download this app (it slows down the CPU):
http://www.cpukiller.com/cpukil305.zip
install it, set the "Slow Down Factor" (I set it on 95%), start slowing down CPU. Now, this issue will be visible very well.
I observed as native applications and applications written using QT. They did not have this defect.
If no one will confirm this issue, I will perform yet another experiment: I will install a clean copy of Windows XP SP3 Eng in VirtualBox and try to notice this issue there.

[Updated on: Thu, 14 October 2010 11:00]

Report message to a moderator

Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29295 is a reply to message #29227] Thu, 14 October 2010 11:13 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 826
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
Don't you use some special theme or something like windows blinds?

I'm using "win classic" (like Win2000) theme, so I have sharp corners and no problems at all.
Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29296 is a reply to message #29295] Thu, 14 October 2010 11:22 Go to previous messageGo to next message
porto is currently offline  porto
Messages: 51
Registered: March 2007
Member
For mr_ped: I am using standart WinXP Luna theme. When I'm switching theme to "classic", I don't see this issue too.
What is your OS? If it's Windows XP, can you try to use "Luna" theme and "Cpukiller3"?

[Updated on: Thu, 14 October 2010 11:29]

Report message to a moderator

Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29304 is a reply to message #29262] Thu, 14 October 2010 18:48 Go to previous messageGo to next message
porto is currently offline  porto
Messages: 51
Registered: March 2007
Member
I have already started to doubt myself, because no one notices the issue. I performed an experiment with VirtualBox and clean copy of Windos XP SP3 Eng. Now I can confidently say: the issue is exist. Download the attached files, open them in VirtualDub and see the range of frames from the names of these files. The first file:

[Updated on: Sat, 16 October 2010 10:02] by Moderator

Report message to a moderator

Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29306 is a reply to message #29227] Thu, 14 October 2010 19:42 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1796
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

From your videos, it looks to me like it only happens when there is a window behind the "wrong rendered" one and even only when the app is busy with something else then repainting. To be sure could you try to find out if this effect happens when you open some U++ window on top of any other application? IMHO the bottom window reacts slowly on the requests to repaint the area of rounded corners and you can notice it (that also explains why it takes longer if you keep the cpu busy with cpukill). I'm not an expert, but I am afraid there is most likely no solution if that's the case...

Honza
Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29307 is a reply to message #29306] Thu, 14 October 2010 20:12 Go to previous messageGo to next message
porto is currently offline  porto
Messages: 51
Registered: March 2007
Member
dolik.rce wrote on Thu, 14 October 2010 20:42

To be sure could you try to find out if this effect happens when you open some U++ window on top of any other application?

Yes, it happens too.
Thank you for your comment. Before, I sometimes noticed that the UPP applications are opened on a clean desktop had this issue.
I still hope that a solution must be, because in other frameworks I didn't notice anything like it.

[Updated on: Fri, 15 October 2010 14:27]

Report message to a moderator

Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29324 is a reply to message #29307] Fri, 15 October 2010 13:53 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
In this very case, it is a Windows problem - that applet to remove apps is responsible repainting itself.

I would say if you would move the prompt somewhere, where would be whole black areas behind - because applet is busy and does not process WM_PAINT painting requests...
Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29325 is a reply to message #29324] Fri, 15 October 2010 13:55 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
P.S.: Do not post .avi files into the forum. I guess if you need to post video, put it to the youtube and link it...
Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29326 is a reply to message #29324] Fri, 15 October 2010 14:20 Go to previous messageGo to next message
porto is currently offline  porto
Messages: 51
Registered: March 2007
Member
But what about the cases described above? Is it possible to fix this issue?

P.S. Sorry for posting .avi files.

[Updated on: Fri, 15 October 2010 14:30]

Report message to a moderator

Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29327 is a reply to message #29326] Fri, 15 October 2010 14:31 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
porto wrote on Fri, 15 October 2010 08:20

I understand. But what about the cases described above? Is it possible to fix this issue?

P.S. Sorry for posting .avi files.


I am unable to replay the video, but with the screenshot, the problem is not with U++.

Maybe you have not noticed the same issue with other apps, but that is just coincidence. The problem is not with top window, but with window behind...

Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29333 is a reply to message #29327] Fri, 15 October 2010 14:47 Go to previous messageGo to next message
porto is currently offline  porto
Messages: 51
Registered: March 2007
Member
I have examined in great detail other applications - native, QT apps, and I did not notice anything similar.
There is one screenshot from my video. (VirtualBox+clean WinXP)
In this case, even if the problem with window behind - it's UPP app's window too.

If you want to notice it, try:
Quote:

I found a better way to see this issue.
Download this app (it slows down the CPU):
http://www.cpukiller.com/cpukil305.zip
install it, set the "Slow Down Factor" (I set it on 95%), start slowing down CPU. Now, this issue will be visible very well.


  • Attachment: f0353.jpg
    (Size: 87.13KB, Downloaded 601 times)

[Updated on: Fri, 15 October 2010 17:31]

Report message to a moderator

Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29341 is a reply to message #29327] Fri, 15 October 2010 16:37 Go to previous messageGo to next message
porto is currently offline  porto
Messages: 51
Registered: March 2007
Member
I decided to make another animation to explain the issue:
http://www.ultimatepp.org/forum/index.php?t=getfile&id=2894&
This is an example application "RichTextObject" from UPP.
But if you think this is not a problem, never mind.
  • Attachment: 1.gif
    (Size: 99.83KB, Downloaded 1037 times)

[Updated on: Fri, 15 October 2010 18:42]

Report message to a moderator

Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29364 is a reply to message #29341] Sat, 16 October 2010 08:24 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
I know what the issue is, but I am not sure how to fix it. Win32 has control about it.
Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29365 is a reply to message #29364] Sat, 16 October 2010 08:38 Go to previous messageGo to next message
porto is currently offline  porto
Messages: 51
Registered: March 2007
Member
And the last question. Why I can't notice something like this issue with other apps (WinAPI native, Qt etc)? This is an animation of cold start UPP application:
http://www.ultimatepp.org/forum/index.php?t=getfile&id=2895&


P.S. Thanks for your replies. Sorry for my fault-finding and taken away your valuable time.
  • Attachment: nnnnnnnnn.gif
    (Size: 193.46KB, Downloaded 990 times)

[Updated on: Sat, 16 October 2010 09:59]

Report message to a moderator

Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29368 is a reply to message #29365] Sat, 16 October 2010 10:01 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
porto wrote on Sat, 16 October 2010 02:38

And the last question. Why I can't notice something like this issue with other apps?



My guess: Because you are not trying hard enough...

Quote:


This is an animation of cold start UPP application:

P.S. Thanks for your replies. Sorry for my fault-finding and taken away your valuable time.


Well, to be absolutely sure, I have tried to reproduce the problem on slowest computer I have around (Asus EEE with 1.6Ghz Atom, WinXP), found nothing.

My guess is that the effect is caused by particular setup of your machine.

Actually, within WinXP, this effect is normal - but with normal PC, it is so fast that black areas go away before they are send to the monitor.

For some reason, on your machine it is slower. Well, it CAN becaused by some particular set of flags we are using in call to CreateWindow or something like that, however we are not doing anything "illegal", just using normal Win32 API calls.

I would even tried to mingle with these flags to see if I can solve the problem for you, the problem is I cannot even reproduce the damned thing.

You might also consider upgrading your video driver...
Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29369 is a reply to message #29368] Sat, 16 October 2010 10:24 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
OK, I did some test using CpuKiller (btw, useful utility, thanks), setting it at 98%.

It is true that U++ based apps show black corners. The same thing is true for following well known software:

Adobe Reader
IrfanView
Total Commander
DVD Shrink

(stopped testing there).

If Adobe does not see this as problem, neither do I.

Just technical sidenote, to me it looks like technical issue behind the problem is that it depends on the way how the main window is composed. If it has a lot of child widgets, Win32 split painting widget by widget to multiple messages and this way some messages in multitasking system reach other windows. U++ is highly optimized there and paints the window in single pass.

You can even notice that if you slow down things, those windows that do not show the black corners generally paint by parts and for quite a longer time...

I guess there is little I can add here - I did not want to dismiss the issue, but this really is non-issue...
Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29370 is a reply to message #29369] Sat, 16 October 2010 10:42 Go to previous messageGo to next message
porto is currently offline  porto
Messages: 51
Registered: March 2007
Member
Thanks, you gave a convincing explanation. Once again sorry for the time taken away from you and I wish you success in U++ development, it's a wonderful framework.

[Updated on: Sat, 16 October 2010 11:26]

Report message to a moderator

Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29513 is a reply to message #29369] Mon, 25 October 2010 16:11 Go to previous messageGo to next message
porto is currently offline  porto
Messages: 51
Registered: March 2007
Member
Delete this message, please

[Updated on: Tue, 26 October 2010 10:10]

Report message to a moderator

icon7.gif  Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29521 is a reply to message #29369] Tue, 26 October 2010 09:56 Go to previous messageGo to next message
porto is currently offline  porto
Messages: 51
Registered: March 2007
Member
I do not know why, but this dirty hack COMPLETELY eliminates this "issue":
void Ctrl::Create0(Ctrl::CreateBox *cr)
{
	GuiLock __;
	cr->exstyle = cr->exstyle | WS_EX_COMPOSITED;

[Updated on: Tue, 26 October 2010 12:39]

Report message to a moderator

Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29523 is a reply to message #29227] Tue, 26 October 2010 11:04 Go to previous messageGo to next message
porto is currently offline  porto
Messages: 51
Registered: March 2007
Member
But this is not the solution. Now it reduces a performance when I dragging any windows on top of UPP applications.
Partially solves my problem is forced set for each window CS_SAVEBITS style. But in this case, sometimes the "issue" is visible, for example, when TheIDE parses the source files when I open any project ...
I will dig further.

[Updated on: Tue, 26 October 2010 15:26]

Report message to a moderator

Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29534 is a reply to message #29369] Wed, 27 October 2010 14:56 Go to previous messageGo to next message
porto is currently offline  porto
Messages: 51
Registered: March 2007
Member
It seems a simple solution was found. In a method:
void Ctrl:: Create0 (Ctrl:: CreateBox * cr) (Win32Wnd.cpp)
Before showing the window, we add an extended style:
cr->exstyle = cr->exstyle | WS_EX_COMPOSITED;

After the window is shown, remove it:
::SetWindowLong(top->hwnd, GWL_EXSTYLE, cr->exstyle ^ WS_EX_COMPOSITED);

It would be nice before to check which version of Windows we have - do it if we have Windows XP or higher.

These simple changes fixed the problem, and the performance still the same.

Can I hope that someone of the developers will make these (or more correct than mine) changes to one of the following buids of UPP?

[Updated on: Wed, 27 October 2010 15:43]

Report message to a moderator

Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29539 is a reply to message #29534] Wed, 27 October 2010 19:37 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Hey, nice digging Smile It is sort of extreme workaround using some sideffect, but why not.

Do you have it as complete patch? I mean, where have you put

::SetWindowLong(top->hwnd, GWL_EXSTYLE, cr->exstyle ^ WS_EX_COMPOSITED);

?
Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29540 is a reply to message #29539] Wed, 27 October 2010 21:44 Go to previous messageGo to next message
porto is currently offline  porto
Messages: 51
Registered: March 2007
Member
I have put it after this line:
::ShowWindow(top->hwnd, visible ? cr->show : SW_HIDE);
Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29563 is a reply to message #29539] Sat, 30 October 2010 13:45 Go to previous messageGo to next message
porto is currently offline  porto
Messages: 51
Registered: March 2007
Member
There was found, I think, a good way to get away of this "issue" (the temporary addition to an extended style of windows a flag WS_EX_KOMPOSITED *) - but I want to find the reason of it.
Do not judge strictly an amateur in programming. Embarassed
After a series of experiments with MS Spy++ utility I made some conclusions, this "issue" has two causes:
1. Child windows of traditional Windows applications have a flag of style CS_SAVEBITS. Child windows of UPP apps, this style does not have (or have, but not all).
After the forced set of this flag to all windows, "issue" only occurs if UPP application is busy, for example when I opening a package in TheIDE or doing "Rescan Code".
2. If UPP app does not busy (idle) and it creates the child window, the parent window is not repainting. But if UPP app is busy and it creates the child window, in this case, for some reason is starting repainting of the parent window or region of it, and CS_SAVEBITS is no longer helps.
If in this case the parent window or region of it does not repaint and all the child windows would have a flag CS_SAVEBITS (like in traditional applications), then the "issue" would not appear (IMHO).
This was only my best guess, do not take very seriously. Rolling Eyes


* With WS_EX_COMPOSITED set, all descendants of a window get bottom-to-top painting order using double-buffering. Bottom-to-top painting order allows a descendent window to have translucency (alpha) and transparency (color-key) effects, but only if the descendent window also has the WS_EX_TRANSPARENT bit set. Double-buffering allows the window and its descendents to be painted without flicker.
Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29571 is a reply to message #29540] Mon, 01 November 2010 09:56 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
porto wrote on Wed, 27 October 2010 15:44

I have put it after this line:
::ShowWindow(top->hwnd, visible ? cr->show : SW_HIDE);


Lines have numbers. Files have names.

Is it so hard to cite the filename and the number of line? Smile

Eventually quoting couple of sourounding lines here (or the whole function, if that is not too big)?
Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29572 is a reply to message #29563] Mon, 01 November 2010 10:03 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
porto wrote on Sat, 30 October 2010 07:45

There was found, I think, a good way to get away of this "issue" (the temporary addition to an extended style of windows a flag WS_EX_KOMPOSITED *) - but I want to find the reason of it.
Do not judge strictly an amateur in programming. Embarassed
After a series of experiments with MS Spy++ utility I made some conclusions, this "issue" has two causes:
1. Child windows of traditional Windows applications have a flag of style CS_SAVEBITS. Child windows of UPP apps, this style does not have (or have, but not all).



I guess you have got the term "child window" wrong. CS_SAVEBITS is intended for popups.

Quote:


After the forced set of this flag to all windows, "issue" only occurs if UPP application is busy, for example when I opening a package in TheIDE or doing "Rescan Code".



For one thing, there are no child windows in U++... Smile (Except DHCtrl descendants, but that is a special case).

My guess is that WS_EX_COMPOSITED only helps accidentally - it changes repainting process of windows and as side-effect, the effect is gone. In the same time, it is not unlikely that this will still depend on actual windows version, graphics driver etc...
Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29573 is a reply to message #29571] Mon, 01 November 2010 10:21 Go to previous messageGo to next message
porto is currently offline  porto
Messages: 51
Registered: March 2007
Member
I made changes in file Wnd32Wnd.cpp, in method:
void Ctrl::Create0(Ctrl::CreateBox *cr) (begin at line 459)

Added lines are marked in bold:

void Ctrl::Create0(Ctrl::CreateBox *cr)
{
GuiLock __;
cr->exstyle = cr->exstyle | WS_EX_COMPOSITED;
... some code ...

::ShowWindow(top->hwnd, visible ? cr->show : SW_HIDE);
::SetWindowLong(top->hwnd, GWL_EXSTYLE, cr->exstyle ^ WS_EX_COMPOSITED);
... some code ...
}


I really want to find out the cause of this effect. So I want to ask you, if UPP apps windows need repainting some area, they are fully updated or update only the necessary area?


I have achieved the same effect in WinAPI application by locking update in underlying window by LockWindowUpdate():
   HWND hWnd, hWnd2;

   hInst = hInstance;

   hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
      CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
   hWnd2 = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
      CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);

   ShowWindow(hWnd, SW_MAXIMAZED);
   LockWindowUpdate(hWnd);
   ShowWindow(hWnd2, SW_NORMAL);
   Sleep(1000);


Without LockWindowUpdate() in this code the effect is gone.
My another suggestion (possibly incorrect again): in UPP apps for some reason MS Windows are not immediately sends WM_PAIN command to underlying windows.


I also tried to make the following changes: after the new window is shown, I just completely update the parent window. This is also a solution to the problem, but why Windows does not update a necessary area of parent window automatically not clear to me...

[Updated on: Mon, 01 November 2010 13:45]

Report message to a moderator

Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29608 is a reply to message #29572] Wed, 03 November 2010 17:07 Go to previous messageGo to next message
porto is currently offline  porto
Messages: 51
Registered: March 2007
Member
As I understood from the description in MSDN the flag of extended style "WS_EX_COMPOSITED" activates the double-buffering at the OS level (it's supported minimum in WinXP), so unlikely it will depend on the graphics card drivers. About making changes in UPP if you agree, I think the better off the flag after the full appearance of the window. About changes in UPP, if you agree, I think it's better to set off the flag after full window rendering instead after non client area rendering, it will give a smoother draw them.
You can make changes like that e.g., or more correctly: (added lines are marked in bold):
1. In file Wnd32Wnd.cpp, at begin of the method (line 459):
void Ctrl::Create0(Ctrl::CreateBox *cr)
{
cr->exstyle = cr->exstyle | WS_EX_COMPOSITED;
...some code...
}
2. In file TopWin32.cpp, at end of the method (line 173):
void TopWindow::Open(HWND hwnd)
{
...some code...
::SetWindowLong(hwnd, GWL_EXSTYLE, ::GetWindowLong(hwnd, GWL_EXSTYLE) ^ WS_EX_COMPOSITED);
}

[Updated on: Wed, 03 November 2010 17:08]

Report message to a moderator

Re: Question to UPP developers: the issue with windows rendering (Windows XP) [message #29624 is a reply to message #29573] Thu, 04 November 2010 14:27 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
porto wrote on Mon, 01 November 2010 05:21


I also tried to make the following changes: after the new window is shown, I just completely update the parent window. This is also a solution to the problem, but why Windows does not update a necessary area of parent window automatically not clear to me...



It does. Please note that everythings gets updated in the end, even when the effect is visible. What so much bothers you is the pause.

But all these things are affected by timing. Win32 simply sends some messages first, some others later, that is all. Accidentally, for U++ or IrfanView, with certain HW and system config, it means that messages required to repaint nonclient area of window are sent later.
Previous Topic: Style: DefaultInk / default
Next Topic: HotSpots usage HOWTO
Goto Forum:
  


Current Time: Sun Apr 26 21:53:35 GMT+2 2026

Total time taken to generate the page: 0.02059 seconds