diff --git a/src/ui/theme.c b/src/ui/theme.c
index 4184b1f..0c5ec9b 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -3385,6 +3385,70 @@ fill_env (MetaPositionExprEnv *env,
   env->theme = meta_current_theme;
 }
 
+static void
+meta_draw_bresenham_line (cairo_t  *cr,
+                          GdkColor *color,
+                          int      x1,
+                          int      y1,
+                          int      x2,
+                          int      y2)
+{
+  int steep;
+  int x, y;
+  int deltax, deltay;
+  int ystep;
+  int error;
+
+  steep = (abs (y2 - y1) > abs (x2 - x1));
+
+  if (steep)
+    {
+      y1 ^= x1;
+      x1 ^= y1;
+      y1 ^= x1;
+
+      y2 ^= x2;
+      x2 ^= y2;
+      y2 ^= x2;
+    }    
+
+  if (x1 > x2)
+    {
+      x2 ^= x1;
+      x1 ^= x2;
+      x2 ^= x1;
+
+      y2 ^= y1;
+      y1 ^= y2;
+      y2 ^= y1;
+    } 
+ 
+  deltax = x2 - x1;
+  deltay = abs (y2 - y1);
+  error  = deltax / 2;
+
+  if (y1 < y2)
+    ystep = 1;
+  else
+    ystep = -1;
+
+  y = y1;
+  for (x = x1; x <= x2; x++)
+    {
+      if (steep)
+        cairo_rectangle (cr, y, x, 1, 1);
+      else
+        cairo_rectangle (cr, x, y, 1, 1);
+
+      error -= deltay;
+      if (error < 0)
+        {
+          y += ystep;
+          error += deltax;
+        }  
+    }
+}
+
 /* This code was originally rendering anti-aliased using X primitives, and
  * now has been switched to draw anti-aliased using cairo. In general, the
  * closest correspondence between X rendering and cairo rendering is given
@@ -3485,8 +3549,9 @@ meta_draw_op_draw_with_env (const MetaDrawOp    *op,
               }
             else
               {
-                cairo_move_to (cr, x1 + .5, y1 + .5);
-                cairo_line_to (cr, x2 + .5, y2 + .5);
+                meta_draw_bresenham_line (cr, &color, x1, y1, x2, y2);
+                cairo_fill (cr);
+                break;
               }
             cairo_stroke (cr);
           }
