Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » How to block background redrawing in my own widget
How to block background redrawing in my own widget [message #47001] Sun, 16 October 2016 22:37 Go to next message
Zbych is currently offline  Zbych
Messages: 327
Registered: July 2009
Senior Member
Hi,

Is there any way to disable background redrawing by Ctrl class in my own widget?
I tried to call BackPaint(NOBACKPAINT) in my widget constructor, but to no avail.
Resizing chromium browser example from bazaar looks like this:

index.php?t=getfile&id=5067&private=0

Source code: https://github.com/ultimatepp/mirror/tree/master/bazaar/Chro miumBrowser

How does DHCtrl class avoid flickering?


[Updated on: Sun, 16 October 2016 22:40]

Report message to a moderator

Re: How to block background redrawing in my own widget [message #47007 is a reply to message #47001] Fri, 28 October 2016 08:35 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13984
Registered: November 2005
Ultimate Member
Hi,

NOBACKPAINT actually means something else: Do not use back buffer to avoid flickering.

It is completely completely ignored with DHCtrl.

Now for your issue: This will be more related to improper implementation of Chromium. Recently, I needed browser in one of my apps, I have started with Bazaar IE package, but found somewhat similar issues (flickering). I was able to fix them by fixing the package. I guess something like that is needed for Chromium Browser package....

Mirek
Re: How to block background redrawing in my own widget [message #47012 is a reply to message #47007] Fri, 28 October 2016 14:01 Go to previous message
Zbych is currently offline  Zbych
Messages: 327
Registered: July 2009
Senior Member
Thanks for explanation.

Right now I override State(int reason) function from Ctrl and when size or position is changed I call Layout function to set everything:
https://github.com/ultimatepp/mirror/blob/master/bazaar/Chro miumBrowser/ChromiumBrowser.cpp

Windows code responsible for chrome position and size looks like this (flickering visible):
		CefWindowHandle hwnd = handler->GetBrowser()->GetHost()->GetWindowHandle();
		HDWP hdwp = BeginDeferWindowPos(1);
		hdwp = DeferWindowPos(hdwp, hwnd, nullptr, r.left, r.top, r.Width(), r.Height(), SWP_NOZORDER);
		EndDeferWindowPos(hdwp);


Or second version (flickering visible):
		SetWindowPos(hwnd, NULL, r.left, r.top, r.GetWidth(), r.GetHeight(), SWP_NOZORDER);


In third version I disabled it completely, so chrome doesn't change its size when I resize application window, but flickering is still visible.
The funny thing is, that with X11 backend flickering is not visible.

[Updated on: Fri, 28 October 2016 14:28]

Report message to a moderator

Previous Topic: Question about Drag and Drop
Next Topic: Incorrect header in ppm.h
Goto Forum:
  


Current Time: Sun Jun 16 07:49:19 CEST 2024

Total time taken to generate the page: 0.01740 seconds