diff --git src/Fl_Tabs.cxx src/Fl_Tabs.cxx
index 353dc49..622629e 100644
--- src/Fl_Tabs.cxx
+++ src/Fl_Tabs.cxx
@@ -78,24 +78,23 @@ int Fl_Tabs::tab_positions() {
   }
   fl_draw_shortcut = prev_draw_shortcut;
 
-  int r = w();
-  if (tab_pos[i] <= r) return selected;
-  // uh oh, they are too big:
-  // pack them against right edge:
-  tab_pos[i] = r;
-  for (i = nc; i--;) {
-    int l = r-tab_width[i];
-    if (tab_pos[i+1] < l) l = tab_pos[i+1];
-    if (tab_pos[i] <= l) break;
-    tab_pos[i] = l;
-    r -= EXTRASPACE;
-  }
-  // pack them against left edge and truncate width if they still don't fit:
-  for (i = 0; i<nc; i++) {
-    if (tab_pos[i] >= i*EXTRASPACE) break;
-    tab_pos[i] = i*EXTRASPACE;
-    int W = w()-1-EXTRASPACE*(nc-i) - tab_pos[i];
-    if (tab_width[i] > W) tab_width[i] = W;
+  // Make tabs compress to fill the tab bar when space is limited.
+  // This function is accurate within one pixel.
+  long double r = (long double)(w()-tab_width[selected])/(long double)(nc-1);
+  long double uptick = r - (long)r;
+  long double count = 0;
+  r = (long)r;
+  if (tab_pos[i] > w()) {
+    for (i = 0; i < nc; i++) {
+      if (selected != i)
+        tab_width[i] = r + (count>=1?1:0) - BORDER;
+      tab_pos[i+1] = tab_pos[i] + tab_width[i] + BORDER;
+      if (count >= 1) count = count - (long)count;
+      count = count+uptick;
+    }
+    // Backtrack and fill the rest of the tab bar.
+    tab_width[nc-1] = w() - tab_pos[nc-1];
+    tab_pos[nc] = tab_pos[nc-1] + tab_width[nc-1] + BORDER;
   }
   // adjust edges according to visiblity:
   for (i = nc; i > selected; i--) {
@@ -343,11 +342,15 @@ enum {LEFT, RIGHT, SELECTED};
 void Fl_Tabs::draw() {
   Fl_Widget *v = value();
   int H = tab_height();
+  const int nc = children();
 
   if (damage() & FL_DAMAGE_ALL) { // redraw the entire thing:
     Fl_Color c = v ? v->color() : color();
 
-    draw_box(box(), x(), y()+(H>=0?H:0), w(), h()-(H>=0?H:-H), c);
+    if (!nc)
+      draw_box(box(), x(), y(), w(), h(), c);
+    else
+      draw_box(box(), x(), y()+(H>=0?H:0), w(), h()-(H>=0?H:-H), c);
 
     if (selection_color() != c) {
       // Draw the top or bottom SELECTION_BORDER lines of the tab pane in the
@@ -362,10 +365,12 @@ void Fl_Tabs::draw() {
     if (v) update_child(*v);
   }
   if (damage() & (FL_DAMAGE_SCROLL|FL_DAMAGE_ALL)) {
-    const int nc = children();
     int selected = tab_positions();
     int i;
     Fl_Widget*const* a = array();
+    if (nc)
+      draw_box(box(), x(), y() + (H >= 0 ? 0 : h() + H), w(),
+               (H >= 0 ? H : -H), color());
     for (i=0; i<selected; i++)
       draw_tab(x()+tab_pos[i], x()+tab_pos[i+1],
                tab_width[i], H, a[i], LEFT);
@@ -385,6 +390,7 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) {
   int dh = Fl::box_dh(box());
   int dy = Fl::box_dy(box());
   char prev_draw_shortcut = fl_draw_shortcut;
+  // Fl_Align align = FL_ALIGN_CENTER;					// STR #3334
   fl_draw_shortcut = 1;
 
   Fl_Boxtype bt = (o == push_ && !sel) ? fl_down(box()) : box();
@@ -403,6 +409,9 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) {
 
   if ((x2 < x1+W) && what == RIGHT) x1 = x2 - W;
 
+  // Left align tab text if space gets tight, this should be adjustable. // STR #3334
+  // if (W < w() * 0.07) align = FL_ALIGN_LEFT;				 // STR #3334
+
   if (H >= 0) {
     if (sel) fl_push_clip(x1, y(), x2 - x1, H + dh - dy);
     else fl_push_clip(x1, y(), x2 - x1, H);
@@ -413,6 +422,7 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) {
 
     // Draw the label using the current color...
     o->labelcolor(sel ? labelcolor() : o->labelcolor());
+    // o->draw_label(x1, y() + yofs, W, H - yofs, align);		// STR #3334
     o->draw_label(x1, y() + yofs, W, H - yofs, tab_align());
 
     if (Fl::focus() == this && o->visible())
@@ -431,6 +441,7 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) {
 
     // Draw the label using the current color...
     o->labelcolor(sel ? labelcolor() : o->labelcolor());
+    // o->draw_label(x1, y() + h() - H, W, H - yofs, align);		// STR #3334
     o->draw_label(x1, y() + h() - H, W, H - yofs, tab_align());
 
     if (Fl::focus() == this && o->visible())
