• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Lab 4.4 Exercises

4.4.1. Understand the Basics of Windowing Systems

a) Discuss the advantages that a windowing environment has over command-line or character-based environments.

________________________________________________________________________

________________________________________________________________________

A1:

Answer: Windows were first adopted to reflect the way users normally work in mixed-task environments. Several pieces of work are visible, in part, on the screen at the same time, and the user can quickly switch between them. Windows allow many tasks to be visible, and in some windowing systems, each task is operating with the same priority. External events cause changes in focus of the various tasks (windows). Compared with single screen (task) displays, windowing offers a significant range of benefits.

A window:
  • Allows users to apply spatial ordering of documents on a desktop to display screens (particularly with overlapping windows)

  • Allows the user to change the focus from one task to another with little effort

  • Eliminates the need to re-establish context in task switching since the contents of a window are preserved (or can quickly be regenerated) even when the whole window is hidden by others

  • Provides a visual memory cache that is useful for monitoring tasks peripheral to the main task or for information integration from several sources

Windowing support is so important that it is now built into the operating system on most platforms.

b) What is meant by window focus and why is it important in a windowing environment?

________________________________________________________________________

________________________________________________________________________

A2:

Answer: The window holding the focus receives input from the keyboard. It is important to keep track of which window has the focus, because it is not always the one on top. Particularly in cases like the X Windowing System, you can have many different windows, all of which are at the same priority, all doing something constructive, so it is impossible to tell where your input is going without keeping track of which window has the focus.

There are several things to keep in mind. First, the term “window” is used very loosely. When you talk about applications on the X Windowing System, you typically talk about “clients.” This is partly due to the fact that it is not X that is providing the appearance and behavior of the windows, but rather the windows manager. As its name implies, the windows manager “manages” the windows or clients.

4.4.2. Understand the Basics of the X Windows System

a) Explain the client/server relationship of X Windows.

________________________________________________________________________

________________________________________________________________________

A1:

Answer: The user's workstation, where the windows are displayed, acts as the server. Applications running on the same workstation, or any other machine on the network, act as clients by sending windows requests to the server.

This is an important difference that is both confusing and extremely useful. The easier way to remember the difference is that the machine that is providing the display services is the server. This is the same in other client-server contexts. That is, the machine that provides the service is the server. The machine that uses these services is the client.

Under the X Windowing System, a machine can act as both a client and a server. In fact, the same machine can be both a client and a server at the same time. Therefore, it is best to think of the applications that are using the services as the clients and not the particular machine.

Each display is controlled by an X server process that allows access to the display from multiple clients, interprets network message from clients, passes user input to clients across the network, provides graphics drawing primitives (image model), and maintains resources (windows, cursors, fonts, pixel images) shared between clients.

The screen layout is under complete control of a window manager. Client processes are written as event loops responding to asynchronous events such as key press, mouse click, and mouse movement notified by the X server.

Client applications call upon the services of the X server by issuing a series of requests. Typical requests are to create, destroy, and reconfigure windows and to display text and graphics in a window. Client requests may prompt the server to return status information about windows or other resources. The X server and the entire set of client processes run asynchronously. Requests are queued by the server and serviced in the order of reception. No guarantee of response time is made, since the server may be servicing a large number of clients. Note the response time implications!

Client processes communicate (over the network if necessary) with the X servers using the X protocol. The X protocol is packet-based with four types of packets: requests such as specifications for drawing a line or changing the color value in a cell, replies that contain data solicited by (round-trip) requests, events that contain information about a device action, and error notifications. X protocol packets are buffered to improve the network utilization and decrease delays.

Of similar age to Microsoft Windows, X Windows is dominant on Unix platforms. We may well see the two windows managers competing on an equal footing on the same hardware platform.

b) Find a system running a newer version of MS-Windows (Windows 95 or later) and a system running the X Window system. Compare and contrast the behavior and appearance of the interfaces.

________________________________________________________________________

________________________________________________________________________

A2:

Answer: One of the most significant similarities is the range of features that each provides. If you look at the list of features in Table 4.5, you see that both MS-Windows and X Windows have the same set of features. There are buttons and menus that change the appearance of the window, you can move and resize the window, and you can change the order by which the windows are stacked. It is not until you dig deeper that you start to see differences.

Perhaps the biggest difference is that with X Windows you typically have a choice of window managers. This means that the appearance (and perhaps behavior) can be selected that best fits your needs (or even preferences). If you want, you can even choose a window manager for X that is almost identical to MS-Windows.

The designers of window managers under X have taken this to the extreme. There are complete development environments. That is, you can create applications within the window manager without the need to learn complex programming languages as is the case with MS-Windows.

Another aspect you need to dig for is configurability. Looking at what MS-Windows can configure, you are fairly limited by comparison to the X Windowing System. MS-Windows allows you to define “schemes,” which define a common appearance (colors, fonts, etc.) and are then valid for every application. Although many window managers also provide these schemes, you can define your own characteristics down to the application level. That means (if you want to) each application can have a different scheme. For example, all applications that access your live database have yellow letters on a red background and those accessing the test database have the standard black on white. In fact, you can define these characteristics down to individual instance of an application.

The primary task of the window manager is to provide the interface to the graphics server, like the X Windowing System. On an MS-Windows system, the graphics server and window manager are integrated into a single unit with the operating system, which cannot be split apart. Although this can be an advantage in some cases, it is mostly a problem as a client that crashes can effectively take out the operating system with it. An X client may take out the X server, but the operating system is still intact. In addition, whereas both MS-Windows and X Windows can be classified as “good” interfaces, based on the usability and consistency, MS-Windows falls short in configurability and stability.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint