• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

How does an Operating System render the GUI?

Joined
May 22, 2010
Messages
2,079
How does an Operating System render the GUI (Graphical User Interface)? I know this changed from Windows XP to Vista, but how did changes like those in Vista effect the Linux Community if at all. Did the API replace older ways of rendering the GUI in Linux too and if so when and how?

The following is the best explanation I can find on programmers stackexchange:

"It seems like your main question is how GUIs and CLIs can exist together at the same time, such as the Windows command console (cmd.exe).

It's actually not as complicated as you might think. First, remember that even a GUI needs to be able to render text, so you can read filenames, labels on controls, or work with text inside of programs. It does this by having font files that contain descriptions of how to turn various characters into glyphs (shapes) on-screen or in a printout.

Once you understand that basic principle, the answer is obvious: you can make a console program on top of a GUI by having an emulation layer that renders the text the way a CLI would and a font file that looks like console text. (Note: I'm not actually claiming that that's the way Windows does it. I don't know how it works under the hood. But it could easily be done that way.)

As for the second part of your question, as to how graphics get rendered, yes, there's a special memory location somewhere that holds pixel data. That's called a frame buffer. Back in the old days, you could get direct access to the frame buffer and play around with its pixels directly. Nowadays, that's highly discouraged if not impossible, for various reasons. Instead, you go through higher-level graphic-drawing APIs, where you describe to the system what you want to do and it takes care of the details.

This has several advantages. First, it means that you don't need to know where the framebuffer is in memory or how exactly its data is formatted. Second, and closely related to the first point, different video card manufacturers can set up their framebuffers in different ways, and you don't need to know how to write specific graphics code for each version. You let the graphics APIs take care of that. And third, (and closely related to the second point,) it means that things can change in the future without breaking existing code.

For example, there was a major change in the way Windows handles forms ("windows") when they introduced Vista, that you probably never noticed unless you do graphics programming. It used to be that every form got drawn directly to the screen. This meant, among other things, that if you dragged a second form over a visible form and then away again, the form on the bottom would have to repaint itself because that image data was lost.

But Vista introduced a compositing window manager, which basically means that each form gets its own virtual framebuffer somewhere in memory, and it just draws everything to the screen based on position and Z-order. Now you can drag one form in front of another all you want and it won't invalidate the other form's pixel data; forms only need to be repainted when their own content changes. And they were able to implement that and make it work just fine on existing programs because the existing programs all use predefined drawing APIs."

If anyone has a better explanation I like to read it if you have the time to write and reply to this.
 
This gets really technical because DWM used in Vista and later has some things in common with any compositing method of GUI rendering, including Linux and other operating systems.

Wikipedia has a good overview of Windows DWM: Desktop Window Manager - Wikipedia

Compositing windows managers go back to the Amiga in the mid-1980s. Earlier versions of Windows which supported blitting could do something similar, although it was buggy and laggy on 16-bit versions. See here: Compositing window manager - Wikipedia

I don't want to type a long post, but the basic idea of a GUI is that there are a number of views (menus, controls, etc), often nesting into a hierarchical tree structure with the "parent" container at the root of this window. The window can be treated as an independent unit and rendered separately. The benefit of this with a compositing manager is that when one window obscures another, it's not necessary to invalidate a window and make it re-draw (the way XP and earlier work). The separate windows are simply re-composited in new positions. This improves performance directly (fewer invalidations and redraws), and indirectly by offloading desktop composition effects ("Aero Glass" or GUI animation effects, for example) and drawing to the GPU.
 
Ah, the Amiga, best personal computer ever made and still the only one to this very day that was built from the ground up with true hardware-based multitasking. ;)

One of my favorite things about the Commodore devices was that the designers (not for the Amiga, in this example since it already offered such capability) was that those designers thought the hardware they'd created had some limitations. With respect to the graphics, they always stated as a matter of absolute fact (from their perspective) that on the Vic-20 and the C64 (and later the C128) that having any graphics outside the boundaries of the "window" that users were forced into - we all remember those big ass borders on the Vic-20/C64 screens which cost a lot of visual real estate in those days. Of course, some rather talented coders came along and created "the demo scene" as it's known to this day with crazy beautiful graphical demos that did precisely that: rendered graphics outside that windowed area directly on the borders all the way out to the last pixels the monitor physically had. :)

Things were so much more fun in those times ~30 years ago, these days everything is so boring in most respects. If I only had access to a working Space-Time machine, the fun I could have once again. :)

<sorry for the off-topic content, seeing any mention of the Amiga always gets me to speak up...> :D
 
I've posted these before, but I just can't resist, I love my Commodore products!

My A500:



My A1200:



iGame on the A500, both the A500 and the A1200 run the exact same WB 3.1 with Scalos desktop running off a CF HDD.



A1200 Closeup:



My C64 Breadbin waiting for it's 1541 Ultimate II+ to arrive:



I'm sorry all...Back on topic now... ;)
 
Last edited:
My MorphOS desktop, this is essentially my PPC based Amiga based on an overclocked Mac Mini.



Now...Back on topic....

...Sorry, Commodore talk gets me excited.
 
The major change from XP to Vista was that starting with Vista the GUI had an option to render the UI using hardware acceleration (graphics card). They originally called this "Aero" theme. This feature allowed for a smoother UI for minimizing and maximizing as well as special effects like transparency. With 7 they removed they changed the name to just Premium theme. I believe it was with 8 they removed the separate named theme all together so you are always using the hardware acceleration.
 
The major change from XP to Vista was that starting with Vista the GUI had an option to render the UI using hardware acceleration (graphics card). They originally called this "Aero" theme. This feature allowed for a smoother UI for minimizing and maximizing as well as special effects like transparency. With 7 they removed they changed the name to just Premium theme. I believe it was with 8 they removed the separate named theme all together so you are always using the hardware acceleration.

That must be one of the reasons most people don't like Windows 8 if not just the start screen.
 
Back
Top