diff options
author | Yair Hershkovitz <yairhr@yahoo.com> | 2007-05-25 14:36:12 +0000 |
---|---|---|
committer | Thomas James Alexander Thurman <tthurman@src.gnome.org> | 2007-05-25 14:36:12 +0000 |
commit | 5194df842c06269c1ae690368384f7759c842b32 (patch) | |
tree | 0810dc4cd42335158bb5afb6d1a9d31759df4bd0 /src/frames.c | |
parent | a7053d3d479637c49aab3b6c9f5142627ed60e5a (diff) | |
download | metacity-5194df842c06269c1ae690368384f7759c842b32.tar.gz |
Add support for RTL languages so that alt-tab, etc., go the other way. In
2007-05-25 Yair Hershkovitz <yairhr@yahoo.com>
* src/workspace.c (meta_workspace_get_neighbor): Add support
for RTL languages so that alt-tab, etc., go the other way.
* src/keybindings.c (handle_activate_menu): In RTL locales,
pop up the menu on the right-hand side when the menu keystroke
is pressed.
* src/fixedtip.c (meta_fixed_tip_show): right-justify tooltips
in RTL locales.
* src/menu.c (popup_position_func): popup menus in RTL locales
are flush with the right-hand side of the window where possible.
* src/frames.c (show_tip_now, meta_frames_button_press_event):
tooltips are aligned with the right-hand side of buttons in
RTL locales.
* src/ui.[ch] (meta_ui_get_direction, enum MetaUIDirection):
New content.
* src/window.c (meta_window_show_menu): "move left" appears above
"move right" in the window menu for LTR locales, and vice versa
for RTL locales.
This is all to close bug #387893.
svn path=/trunk/; revision=3222
Diffstat (limited to 'src/frames.c')
-rw-r--r-- | src/frames.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/frames.c b/src/frames.c index 0c82f1d4..623563bb 100644 --- a/src/frames.c +++ b/src/frames.c @@ -34,6 +34,7 @@ #include "theme.h" #include "prefs.h" #include "errors.h" +#include "ui.h" #ifdef HAVE_SHAPE #include <X11/extensions/shape.h> @@ -1134,6 +1135,11 @@ show_tip_now (MetaFrames *frames) /* 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, @@ -1432,6 +1438,10 @@ meta_frames_button_press_event (GtkWidget *widget, 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, |