From 6b98644c58256eed7e67f987754adc2a70824186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 15 Nov 2010 17:25:22 +0100 Subject: [PATCH] workspace: Consider text direction when switching A direction parameter is passed to meta_compositor_switch_workspace(), to indicate the direction of the switch depending on the workspace layout. In contrast to the switcher popup, this parameter does not take the text direction of the locale into account. Change this, so that the workspace switching animations move in the correct direction. https://bugzilla.gnome.org/show_bug.cgi?id=636083 --- src/core/workspace.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/core/workspace.c b/src/core/workspace.c index 67a4d2354..c5c9d6af6 100644 --- a/src/core/workspace.c +++ b/src/core/workspace.c @@ -618,10 +618,20 @@ meta_workspace_activate_with_focus (MetaWorkspace *workspace, meta_screen_calc_workspace_layout (workspace->screen, num_workspaces, new_space, &layout2); - if (layout1.current_col < layout2.current_col) - direction = META_MOTION_RIGHT; - if (layout1.current_col > layout2.current_col) - direction = META_MOTION_LEFT; + if (meta_ui_get_direction() == META_UI_DIRECTION_RTL) + { + if (layout1.current_col > layout2.current_col) + direction = META_MOTION_RIGHT; + else if (layout1.current_col < layout2.current_col) + direction = META_MOTION_LEFT; + } + else + { + if (layout1.current_col < layout2.current_col) + direction = META_MOTION_RIGHT; + else if (layout1.current_col > layout2.current_col) + direction = META_MOTION_LEFT; + } if (layout1.current_row < layout2.current_row) {