diff -Naur tpb-0.6.3.original/src/tpb.c tpb-0.6.3/src/tpb.c
--- tpb-0.6.3.original/src/tpb.c	2004-08-22 09:45:11.000000000 -0400
+++ tpb-0.6.3/src/tpb.c	2004-10-23 22:28:10.048422939 -0400
@@ -58,6 +58,10 @@
 
 /* global variables  {{{ */
 extern config cfg;
+#ifdef HAVE_LIBXOSD
+xosd *osd_ptr = NULL;
+int osd_initialized = 0;
+#endif /* HAVE_LIBXOSD */
 /* }}} */
 
 /* function prototypes {{{ */
@@ -66,6 +70,7 @@
 #endif /* ENABLE_NLS */
 void daemonize(void);
 #ifdef HAVE_LIBXOSD
+int is_init_xosd(void);
 xosd *init_xosd(void);
 #endif /* HAVE_LIBXOSD */
 #ifdef HAVE_LIBX11
@@ -96,9 +101,6 @@
   char *msg = "";
   char callback_cmd[CALLBACK_CMD_LENGTH];
   struct sigaction signal_action;
-#ifdef HAVE_LIBXOSD
-  xosd *osd_ptr = NULL;
-#endif /* HAVE_LIBXOSD */
 #ifdef HAVE_LIBX11
   Display *display = NULL;
 #endif /* HAVE_LIBX11 */
@@ -146,13 +148,6 @@
     daemonize();
   }
 
-  /* initialize osd */
-#ifdef HAVE_LIBXOSD
-  if(cfg.osd == STATE_ON) {
-    osd_ptr = init_xosd();
-  }
-#endif /* HAVE_LIBXOSD */
-
 #ifdef HAVE_LIBX11
   /* initialize key grabbing */
   if(cfg.xevents == STATE_ON) {
@@ -239,7 +234,7 @@
 	}
       }
 #ifdef HAVE_LIBXOSD
-      if(osd_ptr != NULL) {
+      if(is_init_xosd()) {
 	xosd_display(osd_ptr, 0, XOSD_string, thinkpad_state.zoom_toggle == 1 ? _("Zoom on") : _("Zoom off"));
 	xosd_display(osd_ptr, 1, XOSD_string, "");
       }
@@ -442,7 +437,7 @@
 	}
       }
 #ifdef HAVE_LIBXOSD
-      if(osd_ptr != NULL) {
+      if(is_init_xosd()) {
 	xosd_display(osd_ptr, 0, XOSD_string, thinkpad_state.thinklight_toggle == 1 ? _("ThinkLight on") : _("ThinkLight off"));
 	xosd_display(osd_ptr, 1, XOSD_string, "");
       }
@@ -492,7 +487,7 @@
 	}
       }
 #ifdef HAVE_LIBXOSD
-      if(osd_ptr != NULL) {
+      if(is_init_xosd()) {
 	xosd_display(osd_ptr, 0, XOSD_string, _("Display"));
 	xosd_display(osd_ptr, 1, XOSD_string, msg);
       }
@@ -511,7 +506,7 @@
 	}
       }
 #ifdef HAVE_LIBXOSD
-      if(osd_ptr != NULL) {
+      if(is_init_xosd()) {
 	xosd_display(osd_ptr, 0, XOSD_string, thinkpad_state.expand_toggle == 1 ? _("HV Expansion on") : _("HV Expansion off"));
 	xosd_display(osd_ptr, 1, XOSD_string, "");
       }
@@ -532,7 +527,7 @@
     }
 #ifdef HAVE_LIBXOSD
     if(thinkpad_state.brightness_toggle != last_thinkpad_state.brightness_toggle) {
-      if(osd_ptr != NULL) {
+      if(is_init_xosd()) {
 	xosd_display(osd_ptr, 0, XOSD_string, _("Brightness"));
 	xosd_display(osd_ptr, 1, XOSD_percentage, thinkpad_state.brightness_level * 100 / 7);
       }
@@ -569,7 +564,7 @@
     /* show volume every time a volume button is pressed and not mute */
     if(thinkpad_state.volume_toggle != last_thinkpad_state.volume_toggle &&
        thinkpad_state.mute_toggle == 0) {
-      if(osd_ptr != NULL) {
+      if(is_init_xosd()) {
 	xosd_display(osd_ptr, 0, XOSD_string, _("Volume"));
 	xosd_display(osd_ptr, 1, XOSD_percentage, vol);
       }
@@ -600,7 +595,7 @@
 	}
       }
 
-      if(osd_ptr != NULL) {
+      if(is_init_xosd()) {
 	if(thinkpad_state.mute_toggle == 1) {
 	  xosd_display(osd_ptr, 0, XOSD_string, _("Mute on"));
 	  xosd_display(osd_ptr, 1, XOSD_percentage, 0);
@@ -625,7 +620,7 @@
 	}
       }
 #ifdef HAVE_LIBXOSD
-      if(osd_ptr != NULL) {
+      if(is_init_xosd()) {
 	xosd_display(osd_ptr, 0, XOSD_string, thinkpad_state.ac_state == 1 ? _("AC connected") : _("AC disconnected"));
 	xosd_display(osd_ptr, 1, XOSD_string, "");
       }
@@ -663,7 +658,7 @@
 	}
       }
 #ifdef HAVE_LIBXOSD
-      if(osd_ptr != NULL) {
+      if(is_init_xosd()) {
 	if (cfg.powermgt == STATE_ON ||  (cfg.powermgt == STATE_AUTO && apmiser_running() == 0)) {
 	  xosd_display(osd_ptr, 0, XOSD_string, msg);
 	  xosd_display(osd_ptr, 1, XOSD_string, "");
@@ -703,7 +698,7 @@
 	}
       }
 #ifdef HAVE_LIBXOSD
-      if(osd_ptr != NULL) {
+      if(is_init_xosd()) {
 	if (cfg.powermgt == STATE_ON ||  (cfg.powermgt == STATE_AUTO && apmiser_running() == 0)) {
 	  xosd_display(osd_ptr, 0, XOSD_string, msg);
 	  xosd_display(osd_ptr, 1, XOSD_string, "");
@@ -788,6 +783,18 @@
 } /* }}} */
 
 #ifdef HAVE_LIBXOSD
+int is_init_xosd(void)
+{
+  if (osd_initialized == 1) {
+    return osd_ptr == NULL ? 0 : 1;
+  } else {
+    if(cfg.osd == STATE_ON) {
+      osd_ptr = init_xosd();
+    }
+    osd_initialized = 1;
+  }
+}
+
 /* initialize the on-screen-display */
 xosd *init_xosd(void) /* {{{ */
 {
diff -Naur tpb-0.6.3.original/src/.tpb.c.swp tpb-0.6.3/src/.tpb.c.swp
--- tpb-0.6.3.original/src/.tpb.c.swp	1969-12-31 20:00:00.000000000 -0400
+++ tpb-0.6.3/src/.tpb.c.swp	2004-10-23 22:28:14.047996647 -0400
@@ -0,0 +1,129 @@
+b0VIM 6.2