Bug 560570 - [Minimize/Maximize and Restore the window] shows a black ui for a moment
Summary: [Minimize/Maximize and Restore the window] shows a black ui for a moment
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.15   Edit
Hardware: PC Windows 10
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-26 19:07 EST by Missing name CLA
Modified: 2020-11-03 16:58 EST (History)
0 users

See Also:


Attachments
SSSCE simple example (1.57 KB, application/octet-stream)
2020-02-26 19:07 EST, Missing name CLA
no flags Details
Example Image (8.31 KB, image/png)
2020-02-26 19:12 EST, Missing name CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Missing name CLA 2020-02-26 19:07:47 EST
Created attachment 281947 [details]
SSSCE simple example

Hello, I'm new here. Thank you very much in advance.

[Minimize/Maximize and Restore the window] shows a black ui for a moment ( if the window contains a lot of Controls, Widgets). And it causes a little flicker (Even in a high performance PC).
This seems a bit ugly. So I'd like to prevent this behavior in my app.

I have tried SWT.DOUBLE_BUFFERED style in constructors but no luck.

I attached a SSSCE.

---

I tried debugging the SWT code.

And I found that at the point of maximizing the window, button shows up normally.
But when Composite calls Control#fillBackground > OS.FillRect (which is native code), the black rectangle image appears.

The brush color was #F0F0F0 (COLOR_BTNFACE), so not black.
I don't know why FillRect leaves a weird black rectangle.

Other Windows Application does not show black rectangle like this, so this is the SWT's problem I think.

---org.eclipse.swt.widgets.Control.java
void fillBackground (long hDC, int pixel, RECT rect) {
	if (rect.left > rect.right || rect.top > rect.bottom) return;
	OS.FillRect (hDC, rect, findBrush (pixel, OS.BS_SOLID));
}
Comment 1 Missing name CLA 2020-02-26 19:12:25 EST
Created attachment 281948 [details]
Example Image
Comment 2 Missing name CLA 2020-02-26 19:13:20 EST
My Original Forum post.

https://www.eclipse.org/forums/index.php/t/1099428/
Comment 3 Missing name CLA 2020-11-03 16:58:08 EST
I removed OS.WS_CLIPCHILDREN from Composite.java.
And it looks far better now.
Although I don't know it may or may not cause other bugs.

I made small changes in Composite.java
Sorry not posting diff.

---Composite.java

int widgetStyle () {
	/* Force clipping of children by setting WS_CLIPCHILDREN */
	return super.widgetStyle (); //| OS.WS_CLIPCHILDREN;
}

---Composite.java

int newBits = oldBits;// | OS.WS_CLIPSIBLINGS | OS.WS_CLIPCHILDREN;