Linked by Eugenia Loli on Fri 10th Aug 2007 02:53 UTC, submitted by J. M.
Qt A Trolltech employee explains how Qt 4.4 will eliminate current problems with redrawing artifacts and poor resizing performance, using windowless child widgets.
Order by: Score:
Cool, now what about GTK+?
by J. M. on Fri 10th Aug 2007 03:18 UTC
J. M.
Member since:
2005-07-24

This looks really exciting, the improvement in the second video is great (even though the resizing still can't fully keep up with the mouse, but it's much smoother). Plus, like the Trolltech guy said, the windowless widgets are much lighter on resources. I think it would be very interesting if some GTK+ developer could comment on that, since the GTK+ widgets use their own X windows, too...

Reply Score: 6

RE: Cool, now what about GTK+?
by aseigo on Fri 10th Aug 2007 11:56 UTC in reply to "Cool, now what about GTK+?"
aseigo Member since:
2005-07-06

> even though the resizing still can't fully keep up
> with the mouse

screencasts generally suck at showing movement smoothly. you can generally expect the real experience to be better than what a screencast will deliver visually.

Reply Score: 8

RE: Cool, now what about GTK+?
by butters on Fri 10th Aug 2007 17:37 UTC in reply to "Cool, now what about GTK+?"
butters Member since:
2005-07-08

Not to devalue Trolltech's excellent work on Qt, but it seems like this should have been fixed in Xorg rather than worked-around in Qt. A major part of an X server's job is to manage the stacking, moving, and resizing of client regions. Apparently Xorg is good enough to manage windows but doesn't scale well to the widgets they contain.

So the question is: what is the underlying cause of this limitation? Is there something different about managing widgets that isn't merely an extension of managing windows? Is there a shortcoming in the X11 protocol that prevents the efficient decoupling of managing regions from managing their content?

This is functionality that should be common to all GUI toolkits. As the parent noted, it should be implementing in GTK+ and, I'll add, countless other toolkits. So in the interest of good design and smart abstractions, it makes sense to consider how Xorg can better accommodate widget management.

However, I should also note that Qt targets non-X11 environments. On other platforms, the present approach may make sense. On the other hand, certain platforms may already address these problems in their windowing systems. So there are portability issues here that complicate attempts to exploit commonality.

Reply Score: 5

ggeldenhuys Member since:
2006-11-13

Not to devalue Trolltech's excellent work on Qt, but it seems like this should have been fixed in Xorg rather than worked-around in Qt


butters: I fully agree with you. Being a toolkit author myself, I agree. This is something that needs to be fixed in X11 (Xorg) and not in every toolkit out there via work-arounds.

Reply Score: 2

RE[4]: Cool, now what about GTK+?
by butters on Sat 11th Aug 2007 05:31 UTC in reply to "RE[3]: Cool, now what about GTK+?"
butters Member since:
2005-07-08

Fair enough. I agree with the reasoning in the linked comment thread. Trolltech was right to go ahead and enhance Qt, especially since they are cross-platform. But it's also important that this generate enough noise to persuade the Xorg folks to make improvements on their end.

Reply Score: 2

RE[2]: Cool, now what about GTK+?
by anda_skoa on Fri 10th Aug 2007 17:58 UTC in reply to "RE: Cool, now what about GTK+?"
anda_skoa Member since:
2005-07-07

However, I should also note that Qt targets non-X11 environments.


Not only non-X11 platforms. While it would be nice if every Unix/X11 platform would be using the latest and greatest x.org X server, a lot are either using older releases (e.g. "enterprise" Linux distributions) or other implementations (e.g. XiGraphics, which doesn't even have proper XRender)

Reply Score: 2

Gnome
by notig on Fri 10th Aug 2007 03:18 UTC
notig
Member since:
2006-10-07

I really seriously hope they freaking figure out what is wrong with the windowing system in gnome.

I am not sure if its

window manager
gtk
x11
something else

but it sure as hell isn't just some "synchronization " problem. When i move windows around the cpu usage spikes like crazy.

I have tried it with open drivers, with closed drivers

I have tried it with ATI video cards and Nvidia video card.. and i always have he same problem.

Something is inefficient somewhere and it is not my imagination and it bothers the hell out of me. I made a movie to describe it

http://www.youtube.com/watch?v=8gh7ABSs1NY

Reply Score: 5

RE: Gnome
by leos on Fri 10th Aug 2007 04:27 UTC in reply to "Gnome"
leos Member since:
2005-09-21

Something is inefficient somewhere and it is not my imagination and it bothers the hell out of me. I made a movie to describe it

Wow, that is seriously messed up. I have a laptop with ATI graphics, using the open source driver, which is absolute crap, and it doesn't do that. I have seen that effect, and it only happens when the laptop was under extreme load (like compiling something and another app pegging the CPU). At work where I am running the nvidia proprietary drivers, it never happens, even under full load.
This is under KDE though. Try KDE and XFCE and see if it persists. Also try with a different app in the background. Some apps are faster at redrawing than others, so while you might see those artifacts over top of Firefox, they might not be apparent on another app.
Also, this whole problem goes away completely if you enable the composite extension (and you might need a window manager that supports it, dunno if metacity does). With composite, the window in the background is cached, so it doesn't have to re-render its contents all the time.

Reply Score: 3

RE[2]: Gnome
by notig on Fri 10th Aug 2007 04:35 UTC in reply to "RE: Gnome"
notig Member since:
2006-10-07

Well the video was made with 2 Gigs of ram, athlon x2 4200 and geforce 7900GT 256 MB and the proprietary nvidia driver on gnome feisty

it did it with my previous laptop (an ATI) as well

Edited 2007-08-10 04:41

Reply Score: 1

RE: Gnome
by SomeGuy on Fri 10th Aug 2007 05:54 UTC in reply to "Gnome"
SomeGuy Member since:
2006-03-20

That video you're describing is a combination of 3 things.

1) Firefox sucks. It's slow, buggy, and as the video shows, it really sucks at repainting itself. for example, it turns off solid fills, so that the previous window contents get left behind instead of leaving a solid color, which looks better.

That's not to say that other apps won't show artifacts too, but Firefox is by far the worst when it comes to this.

2) You're not using a compositor. A compositor -- even the builtin automatic compositing rules in Xorg -- will make this much faster, and remove the repaints. Try it with "xcompmgr -a" if you have xcompmgr installed. That won't give you eye candy. It won't even give you transparent windows, but it _WILL_ give you much much faster repaints.

Without a compositor, there is absolutely *NOTHING* that can be done to totally eliminate the "window trail" artifacts, the best you can do is reduce them by making draws faster, and "faking" it by setting solid backgrounds on windows so that you don't notice the partial draws as much.

Reply Score: 9

RE[2]: Gnome
by notig on Fri 10th Aug 2007 06:01 UTC in reply to "RE: Gnome"
notig Member since:
2006-10-07

windows hasn't had that kind of lag for years.... and they weren't using a compositor. SUre using a compositor helps because the graphics card is powerful.. but does it address the underlying issue?

And when i was moving around.... i wasnt even lokoing inside the window. Take a look at the edges of the window frame. I should do another video showing my CPU spiking.

The point is i think that this new advancement for QT.. coudl also be used for gnome and GTK. I am not sure though but i just want clarification. Here is the post that intrigues me:

an application with windowless child widgets is much more light-weight and resource friendly as we donít allocate native windows for every single widget

s long as X11 is asynchronous (with all its benefits, by all means), resize and move operations will also be asynchronous, and flicker will appear as X11 first clears the exposed area (or leaves a trail of junk behind), then sends an expose notification, allowing the client to redraw. You can probably avoid the flicker with clever use of XFlush, but that will mean performance goes down the drain. With this solution, we donít only remove the flicker, and remove the need to wait for X11 roundtrips, but we also free up X11 resources as Qt no longer needs the subwidgets on the server side. Which means less memory consumption :->. And on Windows, it means people can create more widgets than they could beforeÖ

Reply Score: 4

RE[3]: Gnome
by SomeGuy on Fri 10th Aug 2007 06:26 UTC in reply to "RE[2]: Gnome"
SomeGuy Member since:
2006-03-20

Windows does have that kind of lag. Again, Firefox shows that lag best, even on Windows, despite the Mozilla foundation's understandable focus on the Windows market (it is, after all, their biggest market). If you look at the WM_PAINT event in the Win32 API, it's more or less the exact same thing as the X11 Expose event, with the same issues.

Note that in the original video, there was no problem with the terminal's redraw (and testing here, even with filled windows, there is no visible redraw except when under heavy load)

As for the final quote that you posted:
- GTK already does similar, except it uses InputOnly windows to figure out where events came from, which means that the code for creating it's widgets is simpler, and which means that event selection can be much finer-grained. it does *NOT* use subwindows for drawing.

- The QT solution doesn't really change the amount of roundtrips in most cases, and the X resources that it frees up aren't very large. I suspect the real win is with Windows, where you can now create more widgets.

Reply Score: 6

RE[3]: Gnome
by netpython on Fri 10th Aug 2007 11:28 UTC in reply to "RE[2]: Gnome"
netpython Member since:
2005-07-06

windows hasn't had that kind of lag for years.... and they weren't using a compositor. SUre using a compositor helps because the graphics card is powerful.. but does it address the underlying issue?

Windows had other problems such as a system lockup when you insert a damaged CD or DVD.

Reply Score: 1

RE[3]: Gnome
by leos on Fri 10th Aug 2007 14:52 UTC in reply to "RE[2]: Gnome"
leos Member since:
2005-09-21

windows hasn't had that kind of lag for years.... and they weren't using a compositor

You don't notice these problems on Windows because the graphics drivers have historically always been better than on Linux. Even the most garbage graphics card has had 2D acceleration for years. So the effect is still there, but redrawing is just about instantaneous so you don't notice. Any linux with a reasonable graphics driver is just as good.

Reply Score: 3

RE[4]: Gnome
by superstoned on Fri 10th Aug 2007 17:37 UTC in reply to "RE[3]: Gnome"
superstoned Member since:
2005-07-07

aah, that's not true, on a relatively slow system, graphics on windows are always better. This thing they show in the video on that Qt blog is really a problem on linux. And it's great we can look forward do this finally solved with Qt 4.4!

Reply Score: 3

RE[2]: Gnome
by mart on Fri 10th Aug 2007 08:59 UTC in reply to "RE: Gnome"
mart Member since:
2005-11-17

1) Firefox sucks. It's slow, buggy, and as the video shows, it really sucks at repainting itself. for example, it turns off solid fills, so that the previous window contents get left behind instead of leaving a solid color, which looks better.

the huge problem of firefox is that it's not a real gtk app... or at least it doesn't use the native gtk widgets, but it draws them for its own using the gtk drawing apis in order to fake the gtk appearance (it does the same thing on windows for copying the xp/vista themes).
and i use it with the gtk-qt theme engine so the disaster is complete ;)

Reply Score: 7

RE: Gnome
by Almindor on Fri 10th Aug 2007 09:06 UTC in reply to "Gnome"
Almindor Member since:
2006-01-16

I just tried it on Ubuntu Feisty, my setup:

CPU 5 year old AMD Athlon xp 2400+ (@2Ghz)
RAM 1024 DDR (only 266 speed tho because of CPU/mobo)
GeForce 6 6600 Gt (using nvidia driver)

I don't know how you captured the video, so I couldn't capture it (tell me and I will ;) ), but I had virtually no tailing when I moved a small firefox window with your video going in it, over a maximized firefox window over osnews.

Perhaps you got something oddly set or you really do not use nvidia driver (eg: some bug, and x checked back to nv?)

NOTE: I get max CPU usage to about 15% when moving windows around, even over firefox.

Edited 2007-08-10 09:08

Reply Score: 2

RE[2]: Gnome
by superstoned on Fri 10th Aug 2007 17:41 UTC in reply to "RE: Gnome"
superstoned Member since:
2005-07-07

well, it's slow on my amd 2.4 ghz dualcore, with GeForce 6600... But it depends on how critical you are. When I see tearing, it's bad, that simple. Firefox on windows (2.66 ghz P-III) is also bad, btw. At least it's noticeable, unlike with other apps. Also, like they do in the Qt blogpost, resizing a part of an app with a lot of widgets is always smooth in XP, unlike linux.

Reply Score: 4

RE[3]: Gnome
by Almindor on Sat 11th Aug 2007 10:36 UTC in reply to "RE[2]: Gnome"
Almindor Member since:
2006-01-16

You must have something set wrong then, I NEVER got tearing, and I even do 100% cpu tasks in the background like compilation + this is much weaker machine.

Reply Score: 2

RE[4]: Gnome
by segedunum on Sat 11th Aug 2007 11:36 UTC in reply to "RE[3]: Gnome"
segedunum Member since:
2005-07-06

You must have something set wrong then, I NEVER got tearing, and I even do 100% cpu tasks in the background like compilation + this is much weaker machine.

I'm sorry, but everyone gets this on a wide variety of machines. It's well documented, and has been complained about by a lot of people.

Reply Score: 2

RE[5]: Gnome
by superstoned on Sat 11th Aug 2007 14:04 UTC in reply to "RE[4]: Gnome"
superstoned Member since:
2005-07-07

Indeed. Has been a problem like what, forever?

I guess he doesn't see any problem in the video's on the blog as well ;-)

Reply Score: 1

RE: Gnome
by roddog on Fri 10th Aug 2007 10:39 UTC in reply to "Gnome"
roddog Member since:
2006-03-24

It may just be me and the way I use my computer but the VAST majority of time I am sitting infront of it, I'm actually working within a window rather than just moving them around the desktop and watching the window trailers. I see it as a feature like the the Mouse Trails in Winblows, albeit one without a preference window...

Reply Score: 2

RE: Gnome
by chemical_scum on Fri 10th Aug 2007 12:27 UTC in reply to "Gnome"
chemical_scum Member since:
2005-11-02

I really seriously hope they freaking figure out what is wrong with the windowing system in gnome...

Something is inefficient somewhere and it is not my imagination and it bothers the hell out of me. I made a movie to describe it

http://www.youtube.com/watch?v=8gh7ABSs1NY


I used to get exactly the same effect under Gnome on my old system:

128MB RAM, 700MHz Celeron, ATI 3D Rage Pro card, xorg driver.

With my current system:

512MB RAM, 2.8GHz Celeron, Intel i945 graphics

I just cant move the windows fast enough to see anything like that. My current system is hardly a screamer in fact its very basic but it is fast enough to cope easily.

Edited 2007-08-10 12:31

Reply Score: 3

RE[2]: Gnome
by Brmbolec on Fri 10th Aug 2007 12:52 UTC in reply to "RE: Gnome"
Brmbolec Member since:
2005-07-23

But it seems you're not using Composite extension, it should not happen there.

Reply Score: 2

RE: Gnome
by Jondice on Fri 10th Aug 2007 13:37 UTC in reply to "Gnome"
Jondice Member since:
2006-09-20

I have this same problem in Gnome in Solaris, so I started using dwm.

Reply Score: 2

BeginWindowDeferPos
by sappyvcv on Fri 10th Aug 2007 03:19 UTC
sappyvcv
Member since:
2005-07-06

How much different from BeginWindowDeferPos (http://msdn2.microsoft.com/en-us/library/ms632672.aspx), DeferWindowPos (http://msdn2.microsoft.com/en-us/library/ms632681.aspx) and EndWindowDeferPos (http://msdn2.microsoft.com/en-us/library/ms633440.aspx) in terms of what problem it solves?

I understand how it solves it is quitq different.

Edited 2007-08-10 03:26

Reply Score: 3

widget toolkit design
by bnolsen on Fri 10th Aug 2007 03:29 UTC
bnolsen
Member since:
2006-01-06

All they need to do is get more on to orthogonalizing their toolkit.

When it comes down to it a set of widgets just really is a set of drawing instructions, layering, geometry and event management. The magic is in finding a clean way to make all of them fit together cleanly and orthogonally.

Qt4 actually did a good job api wise for breaking out geometry, drawing instructions and layering. I think their mill stone is the event stuff, and the overengineered MVC stuff, but anyways..

Reply Score: 1

yes
by poundsmack on Fri 10th Aug 2007 03:56 UTC
poundsmack
Member since:
2005-07-13

QT + best toolkit ever hnds down. for ease of development and features implimented it has got to be my personaly favorite. wxwidgets is a close second.

Reply Score: 9

Windows
by Bending Unit on Fri 10th Aug 2007 05:07 UTC
Bending Unit
Member since:
2005-07-06

Windows doesn't have those redrawing problems in the first place. I repeated the test and it looks like the second (windowless) video.

Find the real cause in the windowing system instead, and you improve all applications, not just Qt apps. I just cannot get used to the graphics lag in Linux.

Reply Score: 5

RE: Windows
by sappyvcv on Fri 10th Aug 2007 14:06 UTC in reply to "Windows"
sappyvcv Member since:
2005-07-06

It can if the software developer doesn't use the proper APIs. See my previous post.

Reply Score: 2

RE: Windows
by ggeldenhuys on Fri 10th Aug 2007 17:59 UTC in reply to "Windows"
ggeldenhuys Member since:
2006-11-13

Find the real cause in the windowing system instead, and you improve all applications, not just Qt apps. I just cannot get used to the graphics lag in Linux.


I agree 100%. The problem sits with X11 (Xorg).

Reply Score: 1

RE[2]: Windows
by Howie S on Mon 13th Aug 2007 21:35 UTC in reply to "RE: Windows"
Howie S Member since:
2005-07-14

Find the real cause in the windowing system instead, and you improve all applications, not just Qt apps. I just cannot get used to the graphics lag in Linux.

Reply Score: 1

RE[2]: Windows
by Howie S on Mon 13th Aug 2007 21:42 UTC in reply to "RE: Windows"
Howie S Member since:
2005-07-14

>>Find the real cause in the windowing system instead, and you improve all applications, not just Qt apps. I just cannot get used to the graphics lag in Linux.

I totally agree. While so so so much work has been done in projects like KDE and GNOME, X11 development (back in the Xfree86 days) seemed to barely be crawling by. I have the feeling that the Xorg folks are starting to make up for lost time, but the fact remains, X is a dinosaur that should be put out to pasture. Sadly, projects like Mesa-solo seem to be the only savior on the horizon, but that could realistically mean waiting another 5 to 10 years (or so it feels) for a well-performing X-less graphical implimentation. Oh, the whoas of free software. If there were some fundraising, I'll gladly throw some dough their way if this could be sped up.

Reply Score: 1

v eLiquid
by Brmbolec on Fri 10th Aug 2007 07:37 UTC
X11 networking
by reduz on Fri 10th Aug 2007 07:41 UTC
reduz
Member since:
2006-02-25

I can imagine that this technique will put more stress on the X client side and add some lag when xhosting via network. Having independent windows should theorically work better because the XServer does the job of figuring out where to send the event, so latency reduced.

More like, this was the answer from the GTK developers when I asked them about drawing directly (what mentioned in the article) instead of by windows many years ago, and having it optional, because the very slow resizing of gtk was obviously because of this.

This time, I'm glad a developer cares for 99% of the userbase, not the remaining 1% ;)

Reply Score: 3

RE: X11 networking
by dsmogor on Fri 10th Aug 2007 08:00 UTC in reply to "X11 networking"
dsmogor Member since:
2005-09-01

I have seen this problem in any X11 based toolkit causing X core mechanisms being bypassed by one toolkit after another. (starting with swing).
How come X devs haven't figured out how to solve it throughout the years forcing toolkits that support it to implement complex hacks? Is is that deeply entrenched in X11 design. If is cannot always perform on both remote and local scenarios some deep re-architecting is needed.
Wouldn't some new extension be sufficient?

Reply Score: 3

RE[2]: X11 networking
by kaiwai on Sat 11th Aug 2007 15:33 UTC in reply to "RE: X11 networking"
kaiwai Member since:
2005-07-06

Pardon? there is a replacement, its called XCB. It is part of Xorg already, its people deciding not to support it - that is the problem.

Reply Score: 2

RE: X11 networking
by aseigo on Fri 10th Aug 2007 11:58 UTC in reply to "X11 networking"
aseigo Member since:
2005-07-06

by setting the right flag on the widgets, one can force them to be individual windows at runtime. so in theory if the difference is indeed measurable and desirable, one could create a little tool that walks the object tree and sets the flag (or if one reached down a bit deeper, changes the default flag set) to get the current/old behaviour at runtime for such networked devices.

Reply Score: 5

Impressive
by Carewolf on Fri 10th Aug 2007 08:10 UTC
Carewolf
Member since:
2005-09-08

I already feelt that most flickering was gone in Qt4.1 with all the widgets double-buffered Qt-application were pretty smooth during resizing and moving.
This is can at most be a minor further improvement, Qt4 already kicks GTK in the nuts when it comes to anti-flicker.

Reply Score: 5

RE: Impressive
by J. M. on Fri 10th Aug 2007 09:16 UTC in reply to "Impressive"
J. M. Member since:
2005-07-24

"This is can at most be a minor further improvement, Qt4 already kicks GTK in the nuts when it comes to anti-flicker."

I definitely hope it will be a major improvement (as the video clearly shows) - and badly needed, since on the computers I've been trying Qt 4 apps, on both Linux and Windows, the resizing performance is absolutely horrible, just as horrible as the video shows (possibly even worse), even much worse than with GTK+ (which is already bad enough). And not only the resizing performance, but dialogs show up slowly, tab switching is slow etc. Qt 4 really feels very "heavy" (unlike Qt 3, which is an order of magnitude faster).

Edited 2007-08-10 09:21

Reply Score: 1

We will get there
by Andre4s on Fri 10th Aug 2007 08:13 UTC
Andre4s
Member since:
2006-02-10

Resizing windows has never stoped me from doing anything.

Reply Score: 2

Qt with more licences
by dammage on Fri 10th Aug 2007 09:08 UTC
dammage
Member since:
2006-01-08

Hey, where's that report?

Qt 4.3.1 (and QTopia) now provides a GPL exception allowing code under different licences to be linked against the GPL.

APL 1.0/1.1, BSDL, MITL and a few others, check [1]

Well, a few from these allow redistributing binaries without source. You have to make available the source to Trolltech on request under these terms though. ( Check 2) in [1] )

That's a great step by Trolltech - now a lot more projects can use it for own purposes. And if someone wants to hijack the GPL version by utilizing the BSD version and not releasing the code ... Trolltech will ask for it and then sell it itself ;)
Nah, I believe they will ask nicely to get a few commercial licences otherwise it will be opened.

[1] http://trolltech.com/products/qt/gplexception
[2] http://www.heise.de/newsticker/meldung/94092 [German]
[3] http://www.golem.de/showhigh2.php?file=/0708/54013.html&wort[]=qt [German]

Reply Score: 6

Wrong platform focus
by remko on Fri 10th Aug 2007 09:08 UTC
remko
Member since:
2007-08-10

It sounds a bit weird to me that they are focusing their optimization efforts on platforms that didn't need that much optimizing in the first place.

Qt already performs very well on both Linux and Windows for 'normal' applications. However, on Mac OS X, Qt4 has become dog slow (a lot slower than Qt3). Even Java applications feel lighter on OS X. It's not easy being a good looking/feeling application on OS X compared to all the native apps to begin with, but this makes it a lot harder.

Edited 2007-08-10 09:24

Reply Score: 2

Kill X11
by pseudocode on Fri 10th Aug 2007 09:11 UTC
pseudocode
Member since:
2007-05-30

I think QT is going in the right direction (for Desktop users).

The next step is to have the toolkits (QT, GTK, ...) talking directly to the compositing engine (linux Beryl, windows DM).

After that, the next step is to have the Compositing engine talking directly to the video card (opengl, directx).

We don't need anymore an X11-like layer. The toolkits are powerfull enough to manage/render all widgets in one window. The compositing engines can do all the 2D-windows placements. The message bus can be used to do the window/window interaction.

Reply Score: 2

RE: Kill X11
by jadeshade on Fri 10th Aug 2007 10:02 UTC in reply to "Kill X11"
jadeshade Member since:
2007-07-10

To start off on a mean note, killing X11 would be retarded - that's what drivers are written for, it abstracts and makes everything nice so everyone else has a clue where to start (as in, it's not just inertia that it's still with us). As an extension of this, having the compositing engine speak directly to the hardware would mean different drivers for each - not gonna happen when you figure some people can't get a decent driver at all. What IS gonna happen, though, is X11 is going to migrate to being fully OpenGL (which is not a hardware spec - it however provides a framework where hardware acceleration can take place. what the videocard can't do ends up getting done in software (if at all) and moving X11 to OpenGL means that programmers can take advantage of hardware acceleration with much less effort).

I'm sorry if I'm sounding flamey, but it's posts like this (and the 'hey guys let's split the kernel and reap the magical benefits it will bring' one) that make me wonder if anyone takes the time to understand how any of these underlying systems work and/or WHY they work that way. (I'm also short 12 hours sleep)

Reply Score: 18

RE[2]: Kill X11
by pseudocode on Fri 10th Aug 2007 12:47 UTC in reply to "RE: Kill X11"
pseudocode Member since:
2007-05-30

What IS gonna happen, though, is X11 is going to migrate to being fully OpenGL


I suppose you are talking about Xegl. You can call it "migration" if you like. But "Moving X11 to be fully OpenGL", as you said, is a major change in X11 "philosophy". Today, the X11 "core" is not bound to any card-level graphic language. And AFAIK, Xegl will not be a compositing engine.

I'm sorry if I'm sounding flamey, but it's posts like this (and the 'hey guys let's split the kernel and reap the magical benefits it will bring' one) that make me wonder if anyone takes the time to understand how any of these underlying systems work and/or WHY they work that way.



In a today Beryl-like desktop, most of the X's job is done by other layers.

- rendering: GPU (texturefrombitmap)
- region clipping: GPU (z-order)
- compositing: Beryl

In Beryl-like desktop, X main jobs are:
- provide a (visible) full-screen OpenGL surface for the display
- provide a (hidden) per-window backbuffer
- draw the widgets
- route user event (mouse/keyboard) to the application

If the widget drawing is done by the toolkit, the paint/repaint will also be externalized.

So, from my point of view, there is 3 ways to go:

1. Add all the features of GPU+Beryl+Toolkit in the futur Xegl

2. Keep X as a simple router of user events.

3. Remove X and do the "event routing" in an other layer

Edited 2007-08-10 12:47

Reply Score: 2

RE[3]: Kill X11
by binarycrusader on Fri 10th Aug 2007 13:13 UTC in reply to "RE[2]: Kill X11"
binarycrusader Member since:
2005-07-06

Sorry, but X does way more than what you say. Your overview is a gross simplification at best. You seem to be forgetting the input layer, RandR, dga, drivers, etc.

Not only that, the X11 protocol is what allows remote deskstops and so on. Plus it has been a standard for many years and is what part of what makes it so portable across all platforms (even Windows).

Edited 2007-08-10 13:14

Reply Score: 7

RE[4]: Kill X11
by pseudocode on Fri 10th Aug 2007 15:07 UTC in reply to "RE[3]: Kill X11"
pseudocode Member since:
2007-05-30

Sorry, but X does way more than what you say. Your overview is a gross simplification at best. You seem to be forgetting the input layer, RandR, dga, drivers, etc.


Yes, of course it's a simplification. X do all the interconnections between the different layers, so there is a lot of things behind the scene.

But the fact is that, when using beryl, the render+clipping+compositing is not done by X.

If you add the fact that QT will do the widget drawing, then X behaves more like a "middleware".

Not only that, the X11 protocol is what allows remote deskstops and so on. Plus it has been a standard for many years and is what part of what makes it so portable across all platforms (even Windows).


The X11 protocol is great for remote "x-clients" connecting to your local "x-server". Is that really the same that a "remote desktop" ?

Reply Score: 1

RE[4]: Kill X11
by Bending Unit on Fri 10th Aug 2007 22:13 UTC in reply to "RE[3]: Kill X11"
Bending Unit Member since:
2005-07-06

Not only that, the X11 protocol is what allows remote deskstops and so on


Yet, at the same time, the Windows remote desktop is vastly superior so that cannot be used as a very good argument anymore.

Reply Score: 1

RE[5]: Kill X11
by Redeeman on Fri 10th Aug 2007 23:34 UTC in reply to "RE[4]: Kill X11"
Redeeman Member since:
2006-03-23

vastly superior? you have no clue what you are talking about..

first off, its doing really very different things.. compare RDP to vnc or NX(where NX totally beats RDP to death btw..).

and second off.. nah, you probably wouldnt understand, so ill not waste my time arguing with you.. but if you really really wanna know, go look up what its really about, or request it here, and i might enlighten you..

Reply Score: 4

RE[4]: Kill X11
by Moochman on Sat 11th Aug 2007 21:58 UTC in reply to "RE[3]: Kill X11"
Moochman Member since:
2005-07-06

"Not only that, the X11 protocol is what allows remote deskstops and so on."

Does this mean that Qt 4 apps won't be able to be displayed in remote X sessions anymore?

Reply Score: 2

RE[5]: Kill X11
by binarycrusader on Sun 12th Aug 2007 01:14 UTC in reply to "RE[4]: Kill X11"
binarycrusader Member since:
2005-07-06

No. It should have no effect on that the way they are doing it.

Reply Score: 2

RE[3]: Kill X11
by Morin on Fri 10th Aug 2007 18:31 UTC in reply to "RE[2]: Kill X11"
Morin Member since:
2005-12-31

> Today, the X11 "core" is not bound to any card-level graphic language.
> And AFAIK, Xegl will not be a compositing engine.

OpenGL is hardly a "card-level" graphic language. In fact, it is very close to being a superset of X11 (not formally, but in principle), basically bringing 3d rendering and some nice effects to the table. Even network abstraction is a basic feature of OpenGL. Bringing them together raises a lot of formal objections (APIs would change), but no change in philosophy.

Reply Score: 2

RE: Kill X11
by rayiner on Fri 10th Aug 2007 14:48 UTC in reply to "Kill X11"
rayiner Member since:
2005-07-06

Uh, who does all the resource management, input handling, etc? Beryl is just a compositing manager --- it composes together functionality that's mostly implemented in the X server or GL stack.

Reply Score: 7

RE: Kill X11
by thecwin on Fri 10th Aug 2007 16:58 UTC in reply to "Kill X11"
thecwin Member since:
2006-01-04

You can't "kill" X11, it's the resource manager, handles the events, links the rest of it together. What you mean is minimising it to a tiny component as in Xegl: This is a long term goal of the X server.

Reply Score: 2

Finally
by J.R. on Fri 10th Aug 2007 10:03 UTC
J.R.
Member since:
2007-07-25

I was wondering what toolkit to use. To be honest I was really unsure, but finally I bought a GTK+ book. Now I am not so sure anymore. This flickering has been something I have been annoyed at for years, and pretty much makes QT superior with a great margin...if it works that is ;)

Reply Score: 2

RE: Finally
by DirtyHarry on Fri 10th Aug 2007 11:29 UTC in reply to "Finally"
DirtyHarry Member since:
2006-01-31

You bought a GTK+ book? And the only reason to switch to Qt is this flicker stuff? How about API? The API of Qt is way, WAY ahead of the GTK+ one.... That is if you like C++ ;-)

Reply Score: 6

RE[2]: Finally
by aseigo on Fri 10th Aug 2007 12:02 UTC in reply to "RE: Finally"
aseigo Member since:
2005-07-06

you can write Qt apps in python, ruby or java (to name three) so the "if you like C++" is really a non sequitur =)

that said, i completely agree that a better reason to pick between the toolkits is API design (for me this includes consistency, clarity, speed in use and documentation) which is a place where Qt has always shined brightly.

Reply Score: 13

RE[3]: Finally
by DirtyHarry on Fri 10th Aug 2007 19:18 UTC in reply to "RE[2]: Finally"
DirtyHarry Member since:
2006-01-31

Aaron, don't get me wrong. I 'like' C++. And Qt simply rocks. At work we use the commercial license of Qt on a daily basis, and I often refer to them as API fetishists :-)

I would really, really want us to make our own API's as the ones from the Trollies.

Reply Score: 1

RE[3]: Finally
by reduz on Fri 10th Aug 2007 15:45 UTC in reply to "RE: Finally"
reduz Member since:
2006-02-25

For programming C++, Qt is a toolkit that aims at making your programming easier. Gtkmm (the C++ layer of GTK) is a big mess to me compared to Qt, because of horrible docs , and very complex, barely documented APIs using templates. Still though, I think the signals system in Gtkmm (libsigc++) is much nicer than Qt Signals (argument binding is extremely useful) and doesn't need a preprocessor.

Reply Score: 2

RE: Finally
by TheMonoTone on Fri 10th Aug 2007 15:56 UTC in reply to "Finally"
TheMonoTone Member since:
2006-01-01

Buy a book? You don't need no stinkin book with Qt! Complete and clear docs are standard.

Reply Score: 1

Impressed by the videos
by Yamin on Fri 10th Aug 2007 14:29 UTC
Yamin
Member since:
2006-01-10

Anyone else here impressed by the use of videos to explain what the flickering problem is, and to demonstrate the fix ;) I can't count the number of times an article is written; especially on tech sites; and they ramble on and on about problems, but never demonstrate it.

In any case, looks like a great job, though like others have said, I wonder what the limitation is in X that causes this?

Reply Score: 3

raynevandunem
Member since:
2006-11-24

Why is it that OS X's Aqua windows tend to move extremely quickly when you move them around?

I mean, they have their Quartz Extreme and X11 has Compiz, so they're both hardware accelerated with OpenGL, but even then, Quartz seems to redraw windows much better when you move them, even on video.

http://www.youtube.com/watch?v=HCY5Y4fmbx4
http://www.youtube.com/watch?v=b1iSIkyiAVk

I don't know what it is, if it's Core Image or their imaging model. Will Cairo bring this to X11, or is it just something that they haven't figured out yet?

Reply Score: 3

superstoned Member since:
2005-07-07

Afaik, most of that stuff is done by Arthur on linux (Qt rendering engine), and maybe the Quasar library for image effects which should be in KDE 4.1...

Reply Score: 2

QT and the larger picture
by Anonumous on Fri 10th Aug 2007 15:39 UTC
Anonumous
Member since:
2007-06-13

I don't know. Is it just me or does it feel like QT hacks around a lot of problems instead of fixing them properly in Xorg and drivers etc so everyone benefits, not just QT?

As an example, look at what Carl Worth & co are doing to optimize Cairo in recent months (http://cworth.org/blog/). When finding bottlenecks, instead of just hacking around them, they are fixed properly and all rendering stacks on top of Xorg benefits (including QT).

Edited 2007-08-10 15:41

Reply Score: 2

RE: QT and the larger picture
by smitty on Fri 10th Aug 2007 16:33 UTC in reply to "QT and the larger picture"
smitty Member since:
2005-10-13

The problem is that this "hack" fixes things on Windows and OSX as well, so even if they did fix X11 they still would have had to done this work anyway. So while it would be nice if they could contribute to X as well I can understand why they don't want to get too involved in fixing 3rd party code when it wouldn't reduce their workload and they've got plenty of work to do on their own products.

Reply Score: 4

RE: QT and the larger picture
by leos on Fri 10th Aug 2007 16:36 UTC in reply to "QT and the larger picture"
leos Member since:
2005-09-21

Is it just me or does it feel like QT hacks around a lot of problems instead of fixing them properly in Xorg and drivers etc so everyone benefits, not just QT?

It's just you. Trolltech employs Zack Rusin, who has done a lot of work on Xorg and other projects that are outside Qt. EXA and the new Render implementation for example were Zack's work. I don't know enough about it to tell you whether it would have even been possible to fix this particular problem in any other way.

Reply Score: 7

RE[2]: QT and the larger picture
by Anonumous on Fri 10th Aug 2007 16:56 UTC in reply to "RE: QT and the larger picture"
Anonumous Member since:
2007-06-13

EXA was adapted from KAA. Zack was one of the adapters. I don't think Zack has contributed anything more worth mentioning to the Xserver (not after a quick look at the git log anyway). Don't know about other projects, but I do know that Zack is a great hacker (not to belittle his contributions).

But yeah, I would like to see more stuff like this from Trolltech. Fixing things the right way (tm) instead of cludges in QT.

Reply Score: 1

superstoned Member since:
2005-07-07

Trolltech is more than enough of a real FOSS company to fix things the Right Way (TM) whenever feasible, so I suspect this must have been particularly hard or even impossible to fix due to X' architecture. If I understood some ppl above in this discussion, GTK already does something similar.

Reply Score: 5

Bending Unit Member since:
2005-07-06

If that is so, X is apparently broken beyond repair. Sad.

Reply Score: 1

superstoned Member since:
2005-07-07

well, it might just be a lot of deep, architectural work to get it fixed. And commercial entities rarely go for big, architectural rewrites. They go for visible features in a reasonable timeframe... It's one of the advantages we as a FOSS community have - we have people who don't care they need to start a project which will take years and which will only show results in a indirect way. If it's really a deep architectural problem, the community will need to start the work on it, I'm afraid.

Reply Score: 2

replies
by elanthis on Fri 10th Aug 2007 16:13 UTC
elanthis
Member since:
2007-02-17

I suppose you are talking about Xegl.


Or he could be referring to Glucose, which is a very different (and much simpler) approach: create a new 2D X11 driver that calls into the DRI using glitz. Most of the technical issues making that difficult were solved when the indirect accelerated rendering support was added.

When finding bottlenecks, instead of just hacking around them, they are fixed properly and all rendering stacks on top of Xorg benefits (including QT).


Where has QT been hacking around anything? The GTK+ developers have talked about childless windows for a long while now, too. It's actually pretty important to do that if you want to get in-window compositing without depending on a compositing manager. Plus it reduces X pixmap memory usage.

But the fact is that, when using beryl, the render+clipping+compositing is not done by X.


Yes, it is. You don't understand what a compositing manager does. All it is responsible for is the end-result drawing of windows, the structure of which are provided by the X server still. The client still send drawing commands to X, which still is responsible for clipping them into their respective windows, and which is still responsible for managing input. The most basic compositing manager actually does nothing other than take the existing X-managed window positions and blit the window contents onto the screen based on that information.

The only way to "get rid of X" would be to merge most of X into your compositing manager, which is really just stupid on such a multitude of levels I don't even know where to start enumerating them.

Contrary to all-so-popular belief, X is not a bottleneck. Removing it isn't going to gain you anything, but it will cost you quite a bit.

Removing X is only something ever advocated by people who don't know what the heck they're talking about, as every argument against X can be pretty easily shot down by anyone with even a smidgen of understanding on how the X infrastructure works.

Reply Score: 5

RE: replies
by leos on Fri 10th Aug 2007 16:39 UTC in reply to "replies"
leos Member since:
2005-09-21

Or he could be referring to Glucose, which is a very different (and much simpler) approach: create a new 2D X11 driver that calls into the DRI using glitz.


Do you know if Glucose ever went anywhere? I never saw a mention of it after the initial announcement from Zack.

Reply Score: 2

RE[2]: replies
by Anonumous on Fri 10th Aug 2007 17:02 UTC in reply to "RE: replies"
Anonumous Member since:
2007-06-13

Alan Hourihane has picked up the torch and created a glucouse-2 branch. Last I heard of it was in this mail to the xorg mailing list:

http://lists.freedesktop.org/archives/xorg/2007-March/022928.html

Reply Score: 2

fpGUI (Free Pascal GUI Toolkit)
by ggeldenhuys on Fri 10th Aug 2007 16:58 UTC
ggeldenhuys
Member since:
2006-11-13

How funny is this. Just a month ago I rewrote my fpGUI (Free Pascal GUI Toolkit) which was based on a windowless framework to being a windowed framework. My experience was the opposite. ;) My event handling and redrawing was a nightmare with the windless design. The code is now much cleaner and performance is much better using the windowed (every widget has a window handle) design.

Going windowless, you have to handle more events, distribute events, handle window clipping, etc... A lot more work, considering the underlying windowing system can handle all of that for you! I do agree on the fact that a windowless design is more lightweight, but allocating resources on todays systems are not a issue anymore like they used to be years ago.

For more info on fpGUI go to http://opensoft.homeip.net/fpgui/

My 2c worth.

Reply Score: 3

superstoned Member since:
2005-07-07

Well, I can imagine it is a lot to handle all events yourself, esp if you write your own GUI at home. But Trolltech has more resources, and the performance improvement is imho a lot more substantial than you suggest. Just look at those movies... Or compare a linux gui with a windows gui. The latter is a lot more smooth when resizing stuff, even when run in wine.

Reply Score: 4

Cause of the flicker
by Brandybuck on Fri 10th Aug 2007 18:24 UTC
Brandybuck
Member since:
2006-08-27

I had always assumed that the cause of this "flicker" was layout management. But this fix indicates that the cause is actually one step lower, in that all size changes occur to X11 windows, which involves the propagation of numerous events.

Reply Score: 1

Dumb toolkits
by gogglesguy on Fri 10th Aug 2007 18:35 UTC
gogglesguy
Member since:
2007-08-10

I don't think it's X11, but rather "dumb" toolkits that draw way too often. Take a look at FOX toolkit (www.fox-toolkit.org). It doesn't do double-buffering except maybe for one or two widgets. Neither does it have windowless child widgets. Yet still the performance is absolutely great. This is mainly due to the delayed repaint/layout, which makes all the difference. Drawing in general is very expensive so you really only want to draw when absolutely necessary. See the "Delayed Repaint/Layout" section on the bottom of this page:

http://fox-toolkit.org/guiupdate.html

Reply Score: 4

What a Load of Rubbish
by segedunum on Sat 11th Aug 2007 11:35 UTC
segedunum
Member since:
2005-07-06

I just wonder if people commenting on this thread are actually reading some of the better comments around here. Those of you talking about X being the main bottleneck haven't got a clue what you're talking about. In reality, X does very little, which is the way it was designed (it didn't specify a toolkit for a reason). The bottlenecks are elsewhere, and the biggest is how the toolkit manages this and what it pushed to the X server. Motif didn't seem to have this problem, as ugly as it looked and as bad to program as it was.

Options such as creating a new, separate, and incompatible, X server are just so stupid it isn't believable. This isn't going to be helped in X for some time, and even then, the biggest bottleneck is still how the toolkit goes about doing things. XCB, as I understand it, is a layer below Xlib, so doing various things directly with XCB can speed things up (and Trolltech may already be doing it), but it's not a panacea.

Apparently, if Trolltech fixes an awful lot of things in Qt then they're doing it all wrong because they should be fixing things in X. What an absolute load. What do you expect them to fix? Also, you have to take into account that this has to benefit cross-platform as well. If Trolltech does all it can to alleviate problems in Qt, and other parts of a system are improved along with it, then we should be in for a substantial improvement, shouldn't we?

I don't know what it is, but all this 'fix it in X' stuff just sounds like some thinly veiled explanation as to why GTK, and Gnome, is just so particularly bad on this front. Attempting to solve this with Compiz, or relying on hardware acceleration to minimise the effect, simply isn't any solution at all and really is a 'hack'.

Reply Score: 6

RE: What a Load of Rubbish
by richmoore on Sat 11th Aug 2007 11:54 UTC in reply to "What a Load of Rubbish"
richmoore Member since:
2005-08-06

Motif didn't seem to have this problem, as ugly as it looked and as bad to program as it was.
Interestingly Motif has both widgets with windows and without, ie. Widgets and Gadgets.

Reply Score: 2