Window Manager Startup

From Openmoko

(Difference between revisions)
Jump to: navigation, search
m (Matchbox Top Panel)
(catchg)
 
(12 intermediate revisions by 7 users not shown)
Line 1: Line 1:
== Overview ==
+
Describes the scripts and programs used to bring up the X Windows Server and the Matchbox Window Manager.  The series of events that occur when the window manager starts follows the order of the table of contents.
Describes the scripts and programs used to bring up the Window Manager.  The series of events that occur when the window manager starts follows the order of the table of contents.
+
  
 
== X Server Init Script ==
 
== X Server Init Script ==
Line 33: Line 32:
 
</pre>
 
</pre>
  
Configures system and sets up environment variables.  Especially important are the environment variables XSERVER, DISPLAY, and ARGS.  It finished by calling and transferring control to xinit.
+
Configures system and sets up environment variables.  Especially important are the environment variables XSERVER, DISPLAY, and ARGS.  It finishes by calling and transferring control to xinit.
  
 
== X Window System Initializer ==
 
== X Window System Initializer ==
Line 75: Line 74:
 
It makes no attempt to append this shared object to the end of an already existing GTK_MODULES environment variable.  Is this correct?
 
It makes no attempt to append this shared object to the end of an already existing GTK_MODULES environment variable.  Is this correct?
  
(Please elaborate about the purpose of this shared object)
+
This module provides a possibility to send a right click to applications by holding the stylus down for a while.
 +
This method works only in GTK applications.
  
 
=== 46gtkinput ===
 
=== 46gtkinput ===
Line 83: Line 83:
 
</pre>
 
</pre>
  
This script appends a libgtkinput.so shared object to the end of the GTK_MODULES environment variable.  This seems to be more correct that the above (and indeed, if this was not appended, you would lose the previous value).
+
This script appends a libgtkinput.so shared object to the end of the GTK_MODULES environment variable.  This seems to be more correct than the above (and indeed, if this was not appended, you would lose the previous value).
  
 
It accomplishes this task with:
 
It accomplishes this task with:
Line 92: Line 92:
 
(Please elaborate about the purpose of this shared object)
 
(Please elaborate about the purpose of this shared object)
  
=== 60xXDefaults ===
+
=== X Server Resource Database Load ===
 
A script at:
 
A script at:
 
<pre>
 
<pre>
 
/etc/X11/Xsession.d/60xXDefaults
 
/etc/X11/Xsession.d/60xXDefaults
 
</pre>
 
</pre>
 +
 +
Loads the X server preferences from $HOME/.Xdefaults if it exists.  The command is:
 +
<pre>
 +
xdb -merge -nocpp < $HOME/.Xdefaults
 +
</pre>
 +
 +
There is currently not an .Xdefaults file in the Openmoko image, therefore this script does nothing.
  
 
=== Gnome Configuration Server ===
 
=== Gnome Configuration Server ===
Line 122: Line 129:
 
</pre>
 
</pre>
  
What is this?  It seems to be some sort of daemon that is used to access GConf.  Is this really gnome-settings-daemon?
+
The current description in the Openmoko repository says that the "settings-daemon provides a bridge between gconf and xsettings".
  
 
=== Window Manager Startup ===
 
=== Window Manager Startup ===
Line 158: Line 165:
 
/etc/matchbox/session
 
/etc/matchbox/session
 
</pre>
 
</pre>
In the case of OpenMoko, this test is positive and session is exec'ed.
+
In the case of Openmoko, this test is positive and session is exec'ed.
  
 
Taking a quick look at the script shows that one can override the use of /etc/matchbox/session with their own $HOME/.matchbox/session if they wish to experiment without touching the rest of the system.
 
Taking a quick look at the script shows that one can override the use of /etc/matchbox/session with their own $HOME/.matchbox/session if they wish to experiment without touching the rest of the system.
Line 188: Line 195:
 
</pre>
 
</pre>
  
The Matchbox [[ Top Panel ]] dynamically links in a series of shared objects that are called applets.  If any of these shared objects has a problem that causes abnormal termination, the whole Matchbox Panel goes down.  Many users have already observed this when using the [[ GSM & GPRS Connection Status ]] (openmoko-panel-gsm) applet.  Turning it off and on repeatedly will eventually cause the code in the shared object to crash, bringing down the whole Matchbox Panel.
+
The Matchbox [[ Top Panel ]] dynamically links in a series of shared objects that are called applets.  If any of these shared objects has a problem that causes abnormal termination, the whole Top Panel goes down.  Many users have already observed this when using the [[ GSM & GPRS Connection Status ]] (openmoko-panel-gsm) applet.  Turning it off and on repeatedly will eventually cause the code in the shared object to crash, bringing down the whole Top Panel.
  
The best methods for bring the Matchbox Panel back up (besides rebooting) are to run the Matchbox Panel from the command line, as above) or to restart the X Server:
+
The best methods for bring the Top Panel back up (besides rebooting) are to run the Top Panel from the command line, as above) or to restart the X Server:
 
<pre>
 
<pre>
 
/etc/init.d/xserver-nodm restart
 
/etc/init.d/xserver-nodm restart
Line 196: Line 203:
 
Note that with the above, the X Server will fail to stop because of the bug described with the script above.
 
Note that with the above, the X Server will fail to stop because of the bug described with the script above.
  
Because the Matchbox Panel seems to be essential to normal operation of the phone, execution of the panel should be wrapped in a loop to restart it in the event of a failure.  Take into account this program runs in the background and it may not be wise to keep restarting it in tight loop, using up CPU, etc.
+
Because the Top Panel seems to be essential to normal operation of the phone, execution of the panel should be wrapped in a loop to restart it in the event of a failure.  Take into account this program runs in the background and it may not be wise to keep restarting it in tight loop, using up CPU, etc.
  
 
=== Matchbox Input Manager ===
 
=== Matchbox Input Manager ===
Line 224: Line 231:
 
Initializes the audio system state.  More information for ALSA can be found on the [http://www.alsa-project.org/ ALSA] Project home page.
 
Initializes the audio system state.  More information for ALSA can be found on the [http://www.alsa-project.org/ ALSA] Project home page.
  
=== OpenMoko Footer ===
+
=== Openmoko Footer ===
 
A binary at:
 
A binary at:
 
<pre>
 
<pre>
Line 237: Line 244:
 
More about [[Footer]].
 
More about [[Footer]].
  
=== OpenMoko Today ===
+
=== Openmoko Today ===
 
A binary at:
 
A binary at:
 
<pre>
 
<pre>
Line 250: Line 257:
 
More about [[Today]].
 
More about [[Today]].
  
=== OpenMoko Dialer ===
+
=== Openmoko Dialer ===
 
A binary at:
 
A binary at:
 
<pre>
 
<pre>
Line 278: Line 285:
 
== Final ==
 
== Final ==
 
At this point, the user interface is up and ready for service.
 
At this point, the user interface is up and ready for service.
 +
 +
[[Category:Middleware]]

Latest revision as of 09:31, 19 July 2009

Describes the scripts and programs used to bring up the X Windows Server and the Matchbox Window Manager. The series of events that occur when the window manager starts follows the order of the table of contents.

Contents

[edit] X Server Init Script

A standard init script:

/etc/init.d/xserver-nodm

To start the X Server:

/etc/init.d/xserver-nodm start

To stop the X Server

/etc/init.d/xserver-nodm stop

Using the stop parameter currently causes an error. ps is being called with an invalid parameter. (Bug #605)

When using the start parameter, it eventually calls Xserver.

[edit] X Server Environment Setup

A script at:

/etc/X11/Xserver

Called as:

/etc/X11/Xserver &

Configures system and sets up environment variables. Especially important are the environment variables XSERVER, DISPLAY, and ARGS. It finishes by calling and transferring control to xinit.

[edit] X Window System Initializer

A script at:

/usr/bin/xinit

Called as:

xinit /etc/X11/Xsession -- /usr/bin/Xfbdev :0 -br -pn -fp \
  built-ins,/usr/share/fonts/ttf,/usr/share/fonts/truetype \
  -screen 480x640x16

Executes Linux framebuffer generic X server (Xfbdev) and the scripts in /etc/X11/Xsession.d. The scripts are described in the next section of subtopics.

[edit] Screen Calibration

A script at:

/etc/X11/Xsession.d/30xTs_Calibrate

Checks to see if the pointer is calibrated (existence of /etc/pointercal). If not, then executes xtscal to calibrate it:

/usr/bin/xtscal

What program(s) eventually open and use the data in /etc/pointercal?

[edit] 45gtkstylus

A script at:

/etc/X11/Xsession.d/45gtkstylus

This script sets the GTK_MODULES environment variable to point to a libgtksylus.so shared object with:

GTK_MODULES=libgtkstylus.so

It makes no attempt to append this shared object to the end of an already existing GTK_MODULES environment variable. Is this correct?

This module provides a possibility to send a right click to applications by holding the stylus down for a while. This method works only in GTK applications.

[edit] 46gtkinput

A script at:

/etc/X11/Xsession.d/46gtkinput

This script appends a libgtkinput.so shared object to the end of the GTK_MODULES environment variable. This seems to be more correct than the above (and indeed, if this was not appended, you would lose the previous value).

It accomplishes this task with:

GTK_MODULES=${GTK_MODULES}:libgtkinput.so

(Please elaborate about the purpose of this shared object)

[edit] X Server Resource Database Load

A script at:

/etc/X11/Xsession.d/60xXDefaults

Loads the X server preferences from $HOME/.Xdefaults if it exists. The command is:

xdb -merge -nocpp < $HOME/.Xdefaults

There is currently not an .Xdefaults file in the Openmoko image, therefore this script does nothing.

[edit] Gnome Configuration Server

A script at:

/etc/X11/Xsession.d/69gconfd-dbus

This script executes:

/usr/libexec/gconfd-2 &

More information about gconfd can be found in the GConf Implementation Overview.

[edit] Settings Daemon

A script at:

/etc/X11/Xsession.d/70settings-daemon

This script executes:

/usr/bin/settings-daemon &

The current description in the Openmoko repository says that the "settings-daemon provides a bridge between gconf and xsettings".

[edit] Window Manager Startup

A script at:

/etc/X11/Xsession.d/90xXWindowManager

Calls the window manager with:

exec /usr/bin/x-window-manager

[edit] X Window Manager

A soft link at:

/usr/bin/x-window-manager

This soft link points to:

/usr/bin/matchbox-session

This script simply adds a level indirection so one can easily change the window manager being used.

[edit] Matchbox Session

A script at:

/usr/bin/matchbox-session

Test for the existence of:

/etc/matchbox/session

In the case of Openmoko, this test is positive and session is exec'ed.

Taking a quick look at the script shows that one can override the use of /etc/matchbox/session with their own $HOME/.matchbox/session if they wish to experiment without touching the rest of the system.

[edit] Matchbox Window Manager Setup

A script at:

/etc/matchbox/session

This is where the key ingredients of the Matchbox Window Manager are mixed together and executed. Because these elements are key to the user interface, this script is described in detail here.

It is interesting that after the setting of GTK_MODULES in the X Window System Initializer phase (scripts in /etc/X11/Xsession.d) that it is all overwritten by a single statement here:

export GTK_MODULES=libgtkstylus.so

This loses an old value for GTK_MODULES that also contained libgtkinput.so. Perhaps this was something that was overlooked?

[edit] Matchbox Top Panel

A binary at:

/usr/bin/matchbox-panel-2

Called as:

matchbox-panel-2 --start-applets=openmoko-panel-mainmenu,systray,startup \
  --end-applets=openmoko-panel-battery,openmoko-panel-gsm,\
  openmoko-panel-gps,openmoko-panel-usb,openmoko-panel-bt,\
  openmoko-panel-clock &

The Matchbox Top Panel dynamically links in a series of shared objects that are called applets. If any of these shared objects has a problem that causes abnormal termination, the whole Top Panel goes down. Many users have already observed this when using the GSM & GPRS Connection Status (openmoko-panel-gsm) applet. Turning it off and on repeatedly will eventually cause the code in the shared object to crash, bringing down the whole Top Panel.

The best methods for bring the Top Panel back up (besides rebooting) are to run the Top Panel from the command line, as above) or to restart the X Server:

/etc/init.d/xserver-nodm restart

Note that with the above, the X Server will fail to stop because of the bug described with the script above.

Because the Top Panel seems to be essential to normal operation of the phone, execution of the panel should be wrapped in a loop to restart it in the event of a failure. Take into account this program runs in the background and it may not be wise to keep restarting it in tight loop, using up CPU, etc.

[edit] Matchbox Input Manager

A binary at:

/usr/bin/mbinputmgr

Called as:

mbinputmgr &

This program is described as "A tray application for managing software input methods". It seems to be the white Matchbox Panel applet that brings up the software keyboard. This needs to be verified.

[edit] ALSA Control

A binary at:

/usr/sbin/alsactl

Called as:

alsactl restore 0 -f /etc/alsa/stereoout.state

Initializes the audio system state. More information for ALSA can be found on the ALSA Project home page.

[edit] Openmoko Footer

A binary at:

/usr/bin/openmoko-footer

Called as:

openmoko-footer &

More about Footer.

[edit] Openmoko Today

A binary at:

/usr/bin/openmoko-today

Called as:

openmoko-today --desktop &

More about Today.

[edit] Openmoko Dialer

A binary at:

/usr/bin/openmoko-dialer

Called as:

openmoko-dialer &

More about Dialer.

[edit] Matchbox Window Manager

An binary at:

/usr/bin/matchbox-window-manager

Called as:

matchbox-window-manager -use_titlebar no -use_cursor no

The Matchbox Window Manager home page.

[edit] Final

At this point, the user interface is up and ready for service.

Personal tools

Overview

Describes the scripts and programs used to bring up the Window Manager. The series of events that occur when the window manager starts follows the order of the table of contents.

X Server Init Script

A standard init script:

/etc/init.d/xserver-nodm

To start the X Server:

/etc/init.d/xserver-nodm start

To stop the X Server

/etc/init.d/xserver-nodm stop

Using the stop parameter currently causes an error. ps is being called with an invalid parameter. (Bug #605)

When using the start parameter, it eventually calls Xserver.

X Server Environment Setup

A script at:

/etc/X11/Xserver

Called as:

/etc/X11/Xserver &

Configures system and sets up environment variables. Especially important are the environment variables XSERVER, DISPLAY, and ARGS. It finished by calling and transferring control to xinit.

X Window System Initializer

A script at:

/usr/bin/xinit

Called as:

xinit /etc/X11/Xsession -- /usr/bin/Xfbdev :0 -br -pn -fp \
  built-ins,/usr/share/fonts/ttf,/usr/share/fonts/truetype \
  -screen 480x640x16

Executes Linux framebuffer generic X server (Xfbdev) and the scripts in /etc/X11/Xsession.d. The scripts are described in the next section of subtopics.

Screen Calibration

A script at:

/etc/X11/Xsession.d/30xTs_Calibrate

Checks to see if the pointer is calibrated (existence of /etc/pointercal). If not, then executes xtscal to calibrate it:

/usr/bin/xtscal

What program(s) eventually open and use the data in /etc/pointercal?

45gtkstylus

A script at:

/etc/X11/Xsession.d/45gtkstylus

This script sets the GTK_MODULES environment variable to point to a libgtksylus.so shared object with:

GTK_MODULES=libgtkstylus.so

It makes no attempt to append this shared object to the end of an already existing GTK_MODULES environment variable. Is this correct?

(Please elaborate about the purpose of this shared object)

46gtkinput

A script at:

/etc/X11/Xsession.d/46gtkinput

This script appends a libgtkinput.so shared object to the end of the GTK_MODULES environment variable. This seems to be more correct that the above (and indeed, if this was not appended, you would lose the previous value).

It accomplishes this task with:

GTK_MODULES=${GTK_MODULES}:libgtkinput.so

(Please elaborate about the purpose of this shared object)

60xXDefaults

A script at:

/etc/X11/Xsession.d/60xXDefaults

Gnome Configuration Server

A script at:

/etc/X11/Xsession.d/69gconfd-dbus

This script executes:

/usr/libexec/gconfd-2 &

More information about gconfd can be found in the GConf Implementation Overview.

Settings Daemon

A script at:

/etc/X11/Xsession.d/70settings-daemon

This script executes:

/usr/bin/settings-daemon &

What is this? It seems to be some sort of daemon that is used to access GConf. Is this really gnome-settings-daemon?

Window Manager Startup

A script at:

/etc/X11/Xsession.d/90xXWindowManager

Calls the window manager with:

exec /usr/bin/x-window-manager

X Window Manager

A soft link at:

/usr/bin/x-window-manager

This soft link points to:

/usr/bin/matchbox-session

This script simply adds a level indirection so one can easily change the window manager being used.

Matchbox Session

A script at:

/usr/bin/matchbox-session

Test for the existence of:

/etc/matchbox/session

In the case of OpenMoko, this test is positive and session is exec'ed.

Taking a quick look at the script shows that one can override the use of /etc/matchbox/session with their own $HOME/.matchbox/session if they wish to experiment without touching the rest of the system.

Matchbox Window Manager Setup

A script at:

/etc/matchbox/session

This is where the key ingredients of the Matchbox Window Manager are mixed together and executed. Because these elements are key to the user interface, this script is described in detail here.

It is interesting that after the setting of GTK_MODULES in the X Window System Initializer phase (scripts in /etc/X11/Xsession.d) that it is all overwritten by a single statement here:

export GTK_MODULES=libgtkstylus.so

This loses an old value for GTK_MODULES that also contained libgtkinput.so. Perhaps this was something that was overlooked?

Matchbox Top Panel

A binary at:

/usr/bin/matchbox-panel-2

Called as:

matchbox-panel-2 --start-applets=openmoko-panel-mainmenu,systray,startup \
  --end-applets=openmoko-panel-battery,openmoko-panel-gsm,\
  openmoko-panel-gps,openmoko-panel-usb,openmoko-panel-bt,\
  openmoko-panel-clock &

The Matchbox Top Panel dynamically links in a series of shared objects that are called applets. If any of these shared objects has a problem that causes abnormal termination, the whole Matchbox Panel goes down. Many users have already observed this when using the GSM & GPRS Connection Status (openmoko-panel-gsm) applet. Turning it off and on repeatedly will eventually cause the code in the shared object to crash, bringing down the whole Matchbox Panel.

The best methods for bring the Matchbox Panel back up (besides rebooting) are to run the Matchbox Panel from the command line, as above) or to restart the X Server:

/etc/init.d/xserver-nodm restart

Note that with the above, the X Server will fail to stop because of the bug described with the script above.

Because the Matchbox Panel seems to be essential to normal operation of the phone, execution of the panel should be wrapped in a loop to restart it in the event of a failure. Take into account this program runs in the background and it may not be wise to keep restarting it in tight loop, using up CPU, etc.

Matchbox Input Manager

A binary at:

/usr/bin/mbinputmgr

Called as:

mbinputmgr &

This program is described as "A tray application for managing software input methods". It seems to be the white Matchbox Panel applet that brings up the software keyboard. This needs to be verified.

ALSA Control

A binary at:

/usr/sbin/alsactl

Called as:

alsactl restore 0 -f /etc/alsa/stereoout.state

Initializes the audio system state. More information for ALSA can be found on the ALSA Project home page.

OpenMoko Footer

A binary at:

/usr/bin/openmoko-footer

Called as:

openmoko-footer &

More about Footer.

OpenMoko Today

A binary at:

/usr/bin/openmoko-today

Called as:

openmoko-today --desktop &

More about Today.

OpenMoko Dialer

A binary at:

/usr/bin/openmoko-dialer

Called as:

openmoko-dialer &

More about Dialer.

Matchbox Window Manager

An binary at:

/usr/bin/matchbox-window-manager

Called as:

matchbox-window-manager -use_titlebar no -use_cursor no

The Matchbox Window Manager home page.

Final

At this point, the user interface is up and ready for service.