Index: src/workspace.c
===================================================================
--- src/workspace.c	(revision 3197)
+++ src/workspace.c	(working copy)
@@ -721,6 +721,7 @@
 {
   MetaWorkspaceLayout layout;  
   int i, current_space, num_workspaces;
+  gboolean ltr;
 
   current_space = meta_workspace_index (workspace);
   num_workspaces = meta_screen_get_n_workspaces (workspace->screen);
@@ -730,13 +731,15 @@
   meta_verbose ("Getting neighbor of %d in direction %s\n",
                 current_space, meta_motion_direction_to_string (direction));
   
+  ltr = meta_ui_get_direction() == META_UI_DIRECTION_LTR;
+
   switch (direction) 
     {
     case META_MOTION_LEFT:
-      layout.current_col -= 1;
+      layout.current_col -= ltr ? 1 : -1;
       break;
     case META_MOTION_RIGHT:
-      layout.current_col += 1;
+      layout.current_col += ltr ? 1 : -1;
       break;
     case META_MOTION_UP:
       layout.current_row -= 1;
Index: src/keybindings.c
===================================================================
--- src/keybindings.c	(revision 3197)
+++ src/keybindings.c	(working copy)
@@ -3229,6 +3229,9 @@
       meta_window_get_position (display->focus_window,
                                 &x, &y);
       
+      if (meta_ui_get_direction() == META_UI_DIRECTION_RTL)
+	  x += display->focus_window->rect.width;
+
       meta_window_show_menu (display->focus_window,
                              x, y,
                              0,
Index: src/fixedtip.c
===================================================================
--- src/fixedtip.c	(revision 3197)
+++ src/fixedtip.c	(working copy)
@@ -23,6 +23,7 @@
 
 #include <config.h>
 #include "fixedtip.h"
+#include "ui.h"
 
 static GtkWidget *tip = NULL;
 static GtkWidget *label = NULL;
@@ -87,6 +88,10 @@
   gtk_label_set_markup (GTK_LABEL (label), markup_text);
   
   gtk_window_get_size (GTK_WINDOW (tip), &w, &h);
+
+  if (meta_ui_get_direction() == META_UI_DIRECTION_RTL)
+      root_x = MAX(0, root_x - w);
+
   if ((root_x + w) > screen_right_edge)
     root_x -= (root_x + w) - screen_right_edge;
   
Index: src/menu.c
===================================================================
--- src/menu.c	(revision 3197)
+++ src/menu.c	(working copy)
@@ -32,6 +32,7 @@
 #include "core.h"
 #include "themewidget.h"
 #include "metaaccellabel.h"
+#include "ui.h"
 
 typedef struct _MenuItem MenuItem;
 typedef struct _MenuData MenuData;
@@ -119,6 +120,9 @@
   *x = pos->x;
   *y = pos->y;
   
+  if (meta_ui_get_direction() == META_UI_DIRECTION_RTL)
+    *x = MAX (0, *x - req.width); 
+
   /* Ensure onscreen */
   *x = CLAMP (*x, 0, MAX (0, gdk_screen_width () - req.width));
   *y = CLAMP (*y, 0, MAX (0, gdk_screen_height () - req.height));
Index: src/frames.c
===================================================================
--- src/frames.c	(revision 3197)
+++ src/frames.c	(working copy)
@@ -34,6 +34,7 @@
 #include "theme.h"
 #include "prefs.h"
 #include "errors.h"
+#include "ui.h"
 
 #ifdef HAVE_SHAPE
 #include <X11/extensions/shape.h>
@@ -1132,6 +1133,11 @@
       /* get conversion delta for root-to-frame coords */
       dx = root_x - x;
       dy = root_y - y;
+
+      /* Align the tooltip to the button right end if RTL */
+      if (meta_ui_get_direction() == META_UI_DIRECTION_RTL)
+        dx += rect->width;
+
       screen_number = gdk_screen_get_number (gtk_widget_get_screen (GTK_WIDGET (frames)));
       
       meta_fixed_tip_show (gdk_display,
@@ -1430,6 +1436,10 @@
           dx = event->x_root - event->x;
           dy = event->y_root - event->y;
           
+	  /* Align to the right end of the menu rectangle if RTL */
+	  if (meta_ui_get_direction() == META_UI_DIRECTION_RTL)
+	    dx += rect->width;
+
           meta_core_show_window_menu (gdk_display,
                                       frame->xwindow,
                                       rect->x + dx,
Index: src/ui.c
===================================================================
--- src/ui.c	(revision 3197)
+++ src/ui.c	(working copy)
@@ -952,3 +952,12 @@
 
   return threshold;
 }
+
+MetaUIDirection
+meta_ui_get_direction (void)
+{
+  if (gtk_widget_get_default_direction() == GTK_TEXT_DIR_RTL)
+    return META_UI_DIRECTION_RTL;
+
+  return META_UI_DIRECTION_LTR;
+}
Index: src/ui.h
===================================================================
--- src/ui.h	(revision 3197)
+++ src/ui.h	(working copy)
@@ -40,6 +40,12 @@
 
 typedef gboolean (* MetaEventFunc) (XEvent *xevent, gpointer data);
 
+typedef enum
+{
+  META_UI_DIRECTION_LTR,
+  META_UI_DIRECTION_RTL
+} MetaUIDirection;
+
 void meta_ui_init (int *argc, char ***argv);
 
 Display* meta_ui_get_display (void);
@@ -194,6 +200,8 @@
 
 int      meta_ui_get_drag_threshold       (MetaUI *ui);
 
+MetaUIDirection meta_ui_get_direction (void);
+
 #include "tabpopup.h"
 
 #endif
Index: src/window.c
===================================================================
--- src/window.c	(revision 3197)
+++ src/window.c	(working copy)
@@ -6478,6 +6478,7 @@
   MetaWindowMenu *menu;
   MetaWorkspaceLayout layout;
   int n_workspaces;
+  gboolean ltr;
   
   if (window->display->window_menu)
     {
@@ -6508,12 +6509,13 @@
 
   if (!window->on_all_workspaces)
     {
+      ltr = meta_ui_get_direction() == META_UI_DIRECTION_LTR;
 
       if (layout.current_col > 0)
-        ops |= META_MENU_OP_MOVE_LEFT;
+        ops |= ltr ? META_MENU_OP_MOVE_LEFT : META_MENU_OP_MOVE_RIGHT;
       if ((layout.current_col < layout.cols - 1) &&
           (layout.current_row * layout.cols + (layout.current_col + 1) < n_workspaces))
-        ops |= META_MENU_OP_MOVE_RIGHT;
+        ops |= ltr ? META_MENU_OP_MOVE_RIGHT : META_MENU_OP_MOVE_LEFT;
       if (layout.current_row > 0)
         ops |= META_MENU_OP_MOVE_UP;
       if ((layout.current_row < layout.rows - 1) &&
