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++ Library : Other (not classified elsewhere) » [FIXED] Fixing X11 resizing issue. (Huge X11 quality improvement!!!)
[FIXED] Fixing X11 resizing issue. (Huge X11 quality improvement!!!) [message #40187] Sun, 30 June 2013 13:57 Go to next message
Klugier is currently offline  Klugier
Messages: 1076
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello,

The main problem with U++ on X11 is windows resizing quality. When you resize window you can see white square arrtifacts. I have found solution for this issue.

Here is the patch code (CtrlCore/X11Wnd.cpp - Line 488)
Window w = XCreateWindow(Xdisplay, RootWindow(Xdisplay, Xscreenno),
	                         r.left, r.top, r.Width(), r.Height(),
	                         0, CopyFromParent, InputOutput, CopyFromParent,
	                         CWBitGravity|CWSaveUnder|CWOverrideRedirect|
	                         (IsCompositedGui() ? CWBackPixmap : CWBackPixel),
	                         &swa);


What I really changed is one little line of code:

(IsCompositedGui() ? CWBackPixmap : CWBackPixel),


Insted of:

(IsCompositedGui() ? CWBackPixel : CWBackPixmap),


This patch will have huge impact on your experience with ultimate++ on X11, because it eliminates one of the most annoying bug.

Sincerely,
Klugier


U++ - one framework to rule them all.

[Updated on: Fri, 19 July 2013 21:08]

Report message to a moderator

Re: [BUG & PATCH] Fixing X11 resizing issue. (Huge X11 quality improvement!!!) [message #40263 is a reply to message #40187] Sat, 13 July 2013 21:28 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Patch applied...

Mirek
Re: [BUG & PATCH] Fixing X11 resizing issue. (Huge X11 quality improvement!!!) [message #40278 is a reply to message #40263] Sun, 14 July 2013 21:35 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
mirek wrote on Sat, 13 July 2013 15:28

Patch applied...

Mirek


In my case (Ubuntu + KDE) Upp is flickering like crazy after this change. Example: reference/DockingExample1 (try to resize the main window).


Regards,
Novo
Re: [BUG & PATCH] Fixing X11 resizing issue. (Huge X11 quality improvement!!!) [message #40286 is a reply to message #40278] Mon, 15 July 2013 14:58 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1076
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello,

I am almost sure that this patch is OK. I had tested it on several graphical user enviroment such as KDE (4.10.5), LXDE, Xfc & Cinamon. It also works good on VirtualBox.

Novo, Can you write more details about your distribution? BTW, Before this update I had flicker on all my GNU/Linux machines!!!

I have a huge request to ultimatepp community. Can you guys test window resizing on GNU/Linux and write about it. Before you start testing make sure that you have the latest upp version.

------------------------------------------------------------ ------------------------------------------------------------
I have made some tests on my old machine (Open source Radeon driver). It seems that the result of IsCompositedGui() can depends on too many factors such as graphic card driver. Personally, I think that we should always use "CWBackPixmap", because this flag guarantees smooth resizing. I think we need to create window in following way:

Window w = XCreateWindow(Xdisplay, RootWindow(Xdisplay, Xscreenno),
	                         r.left, r.top, r.Width(), r.Height(),
	                         0, CopyFromParent, InputOutput, CopyFromParent,
	                         CWBitGravity|CWSaveUnder|CWOverrideRedirect|CWBackPixmap,
	                         &swa);


P.S.
Thank you Novo for reporting.

Sincerely,
Klugier


U++ - one framework to rule them all.

[Updated on: Mon, 15 July 2013 18:02]

Report message to a moderator

Re: [BUG & PATCH] Fixing X11 resizing issue. (Huge X11 quality improvement!!!) [message #40287 is a reply to message #40286] Mon, 15 July 2013 18:30 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
klugier wrote on Mon, 15 July 2013 08:58

Hello,

I am almost sure that this patch is OK. I had tested it on several graphical user enviroment such as KDE (4.10.5), LXDE, Xfc & Cinamon. It also works good on VirtualBox.

Novo, Can you write more details about your distribution? BTW, Before this update I had flicker on all my GNU/Linux machines!!!

I have a huge request to ultimatepp community. Can you guys test window resizing on GNU/Linux and write about it. Before you start testing make sure that you have the latest upp version.

Sincerely,
Klugier


I have latest Ubuntu x64 (AMD) + KDE + Openbox as a window manager. Graphics card ATI 5770, I believe. My system has two 24' monitors (rotated 90 degrees). I always use latest code from svn.

I also checked on two my computers at work ("Update the window contents while resizing" is checked):

1) Ubuntu 10.04 32-bit, regular Gnome 2, NVidia video card, one 21' rotated monitor - flickering.

2) Lubuntu 13.04 (Openbox window manager), 64-bit, NVidia video card, one 21' not rotated monitor - flickering

Checked with examples/HomeBudget (no Docking):

1) - flickering.
2) - flickering.

Conclusion:
1) this is not just a problem with Docking;
2) it is not related to multiple and rotated monitors;



Regards,
Novo
Re: [BUG & PATCH] Fixing X11 resizing issue. (Huge X11 quality improvement!!!) [message #40288 is a reply to message #40287] Mon, 15 July 2013 19:32 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1076
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Novo,

Like I said. We need to remove IsCompositedGui() check from XCreateWindow and stay only with CWBackPixmap flag.

The bug in this place is obvious, because smooth resizing works on some machines, but on others it doesn't. So the final code should look like this:

Window w = XCreateWindow(Xdisplay, RootWindow(Xdisplay, Xscreenno),
	                         r.left, r.top, r.Width(), r.Height(),
	                         0, CopyFromParent, InputOutput, CopyFromParent,
	                         CWBitGravity|CWSaveUnder|CWOverrideRedirect|CWBackPixmap,
	                         &swa);


Sincerely,
Klugier


U++ - one framework to rule them all.
Re: [BUG & PATCH] Fixing X11 resizing issue. (Huge X11 quality improvement!!!) [message #40289 is a reply to message #40288] Mon, 15 July 2013 19:43 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
Hello, Klugier and Sergey.

Generally, I use Ctrl::GlobalBackPaint() static method on GUI_APP_MAIN to disable flickering on Windows XP and/or Posix (FreeBSD, Linux):
Toggle source code

There is GlobalBackPaint() for Windows 7 already, for some reasons.

[Updated on: Mon, 15 July 2013 20:35]

Report message to a moderator

Re: [BUG & PATCH] Fixing X11 resizing issue. (Huge X11 quality improvement!!!) [message #40290 is a reply to message #40289] Mon, 15 July 2013 20:41 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1076
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Sender Ghost,

Thank you for tips, but they don't work in this case. I have still flickering when CWBackPixel flags is on. The problem is that CWBackPixmap must be turn on to fully avoid flickering on X11.

Sincerely,
Klugier


U++ - one framework to rule them all.

[Updated on: Mon, 15 July 2013 22:30]

Report message to a moderator

Re: [BUG & PATCH] Fixing X11 resizing issue. (Huge X11 quality improvement!!!) [message #40291 is a reply to message #40290] Mon, 15 July 2013 21:22 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Ubuntu 13.04 64b (cinnamon 3d), dell studio 1735 (radeon hd). In my case the patch helped. Before window flickered. Now everything looks perfect!

[Updated on: Mon, 15 July 2013 21:22]

Report message to a moderator

Re: [BUG & PATCH] Fixing X11 resizing issue. (Huge X11 quality improvement!!!) [message #40292 is a reply to message #40288] Mon, 15 July 2013 21:34 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
klugier wrote on Mon, 15 July 2013 13:32

Hello Novo,

Like I said. We need to remove IsCompositedGui() check from XCreateWindow and stay only with CWBackPixmap flag.

The bug in this place is obvious, because smooth resizing works on some machines, but on others it doesn't. So the final code should look like this:

Window w = XCreateWindow(Xdisplay, RootWindow(Xdisplay, Xscreenno),
	                         r.left, r.top, r.Width(), r.Height(),
	                         0, CopyFromParent, InputOutput, CopyFromParent,
	                         CWBitGravity|CWSaveUnder|CWOverrideRedirect|CWBackPixmap,
	                         &swa);


Sincerely,
Klugier


This fixed flickering in configuration 1.

Checked on a home computer with two rotated monitors - no flickering.

Thanks!


Regards,
Novo

[Updated on: Tue, 16 July 2013 04:33]

Report message to a moderator

Re: [BUG & PATCH] Fixing X11 resizing issue. (Huge X11 quality improvement!!!) [message #40297 is a reply to message #40292] Tue, 16 July 2013 08:32 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
OK, it is now CWBackPixmap unconditionally...

(It is still sort of irrelevant, GTK backend is the future...)

Mirek
Re: [BUG] Fixing X11 resizing issue. (Huge X11 quality improvement!!!) [message #40307 is a reply to message #40187] Tue, 16 July 2013 15:08 Go to previous message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
Thank you! For the time being it still makes a lot of sense.

Regards,
Novo
Previous Topic: [FIXED] Scrollbar artifacts on KDE (GTK Backend)
Next Topic: [FIXED] FileSel KDE Port & FileSel MIME types handling improvement & More
Goto Forum:
  


Current Time: Thu Apr 18 12:39:33 CEST 2024

Total time taken to generate the page: 0.02570 seconds