summaryrefslogtreecommitdiff
path: root/src
diff options
authorNeil Jagdish Patel <neil.patel@canonical.com>2011-01-27 16:50:16 +0000
committerNeil Jagdish Patel <neil.patel@canonical.com>2011-01-27 16:50:16 +0000
commitabcaca8c2e636b0c8d98b5e1bc3c5688cbf9d09a (patch)
tree04e1be140bff25c8c2b3b0eab4671d7ed2ee7751 /src
parent54b3a22e236314550a12692bf214dd0c43953e98 (diff)
parentc25c21944e7390e0a775ab85e1e8acd8b268267b (diff)
[merge] trunk
(bzr r697.4.41)
Diffstat (limited to 'src')
-rw-r--r--src/BamfLauncherIcon.cpp7
-rw-r--r--src/Launcher.cpp13
-rw-r--r--src/LauncherController.cpp3
-rw-r--r--src/PanelMenuView.cpp36
-rw-r--r--src/PanelMenuView.h3
-rw-r--r--src/PanelTitlebarGrabAreaView.cpp58
-rw-r--r--src/PanelTitlebarGrabAreaView.h16
-rw-r--r--src/PlacesGroup.cpp4
-rw-r--r--src/PlacesResultsController.cpp1
-rw-r--r--src/PlacesResultsView.cpp5
-rw-r--r--src/PlacesSimpleTile.cpp3
-rw-r--r--src/StaticCairoText.cpp11
-rw-r--r--src/TrashLauncherIcon.cpp3
-rw-r--r--src/unity-util-accessible.cpp4
-rw-r--r--src/unitya11y.cpp13
-rw-r--r--src/unitya11y.h4
-rw-r--r--src/unityshell.cpp10
17 files changed, 145 insertions, 49 deletions
diff --git a/src/BamfLauncherIcon.cpp b/src/BamfLauncherIcon.cpp
index ad037d588..c8865cc6e 100644
--- a/src/BamfLauncherIcon.cpp
+++ b/src/BamfLauncherIcon.cpp
@@ -25,6 +25,7 @@
#include "PluginAdapter.h"
#include "FavoriteStore.h"
+#include <glib/gi18n-lib.h>
#include <gio/gdesktopappinfo.h>
#include <libindicator/indicator-desktop-shortcuts.h>
#include <core/core.h>
@@ -645,7 +646,7 @@ BamfLauncherIcon::EnsureMenuItemsReady ()
menu_item = dbusmenu_menuitem_new ();
g_object_ref (menu_item);
- dbusmenu_menuitem_property_set (menu_item, DBUSMENU_MENUITEM_PROP_LABEL, "Open New Window");
+ dbusmenu_menuitem_property_set (menu_item, DBUSMENU_MENUITEM_PROP_LABEL, _("Open New Window"));
dbusmenu_menuitem_property_set_bool (menu_item, DBUSMENU_MENUITEM_PROP_ENABLED, true);
dbusmenu_menuitem_property_set_bool (menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE, true);
@@ -661,7 +662,7 @@ BamfLauncherIcon::EnsureMenuItemsReady ()
g_object_ref (menu_item);
dbusmenu_menuitem_property_set (menu_item, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE, DBUSMENU_MENUITEM_TOGGLE_CHECK);
- dbusmenu_menuitem_property_set (menu_item, DBUSMENU_MENUITEM_PROP_LABEL, "Keep In Launcher");
+ dbusmenu_menuitem_property_set (menu_item, DBUSMENU_MENUITEM_PROP_LABEL, _("Keep In Launcher"));
dbusmenu_menuitem_property_set_bool (menu_item, DBUSMENU_MENUITEM_PROP_ENABLED, true);
dbusmenu_menuitem_property_set_bool (menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE, true);
@@ -683,7 +684,7 @@ BamfLauncherIcon::EnsureMenuItemsReady ()
menu_item = dbusmenu_menuitem_new ();
g_object_ref (menu_item);
- dbusmenu_menuitem_property_set (menu_item, DBUSMENU_MENUITEM_PROP_LABEL, "Quit");
+ dbusmenu_menuitem_property_set (menu_item, DBUSMENU_MENUITEM_PROP_LABEL, _("Quit"));
dbusmenu_menuitem_property_set_bool (menu_item, DBUSMENU_MENUITEM_PROP_ENABLED, true);
dbusmenu_menuitem_property_set_bool (menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE, true);
diff --git a/src/Launcher.cpp b/src/Launcher.cpp
index c1de3c5b9..165c1d517 100644
--- a/src/Launcher.cpp
+++ b/src/Launcher.cpp
@@ -971,26 +971,32 @@ void Launcher::StartKeyShowLauncher ()
{
_key_show_launcher = true;
EnsureHiddenState ();
+ // trigger the timer now as we want to hide the launcher immediately
+ // if we release the key after 1s happened.
+ SetupAutohideTimer ();
}
void Launcher::EndKeyShowLauncher ()
{
_key_show_launcher = false;
- SetupAutohideTimer ();
+ EnsureHiddenState ();
}
void Launcher::OnPlaceViewShown (GVariant *data, void *val)
{
Launcher *self = (Launcher*)val;
self->_placeview_show_launcher = true;
+ // trigger the timer now as we want to hide the launcher immediately
+ // if we close the dash after 1s happened.
self->EnsureHiddenState ();
+ self->SetupAutohideTimer ();
}
void Launcher::OnPlaceViewHidden (GVariant *data, void *val)
{
Launcher *self = (Launcher*)val;
self->_placeview_show_launcher = false;
- self->SetupAutohideTimer ();
+ self->EnsureHiddenState ();
}
void Launcher::SetHidden (bool hidden)
@@ -1010,8 +1016,8 @@ gboolean Launcher::OnAutohideTimeout (gpointer data)
{
Launcher *self = (Launcher*) data;
- self->EnsureHiddenState ();
self->_autohide_handle = 0;
+ self->EnsureHiddenState ();
return false;
}
@@ -1024,6 +1030,7 @@ Launcher::EnsureHiddenState ()
!_placeview_show_launcher &&
_launcher_action_state == ACTION_NONE &&
!QuicklistManager::Default ()->Current() &&
+ !_autohide_handle &&
_window_over_launcher)
SetHidden (true);
else
diff --git a/src/LauncherController.cpp b/src/LauncherController.cpp
index e82ea354a..cc0c34930 100644
--- a/src/LauncherController.cpp
+++ b/src/LauncherController.cpp
@@ -24,6 +24,7 @@
#include "PluginAdapter.h"
#include "TrashLauncherIcon.h"
+#include <glib/gi18n-lib.h>
#include <Nux/Nux.h>
#include <Nux/BaseWindow.h>
@@ -207,7 +208,7 @@ LauncherController::InsertExpoAction ()
SimpleLauncherIcon *expoIcon;
expoIcon = new SimpleLauncherIcon (_launcher);
- expoIcon->SetTooltipText ("Workspace Switcher");
+ expoIcon->SetTooltipText (_("Workspace Switcher"));
expoIcon->SetIconName ("workspace-switcher");
expoIcon->SetQuirk (LauncherIcon::QUIRK_VISIBLE, true);
expoIcon->SetQuirk (LauncherIcon::QUIRK_RUNNING, false);
diff --git a/src/PanelMenuView.cpp b/src/PanelMenuView.cpp
index c22d45e87..1e5637486 100644
--- a/src/PanelMenuView.cpp
+++ b/src/PanelMenuView.cpp
@@ -43,6 +43,10 @@ static void on_active_window_changed (BamfMatcher *matcher,
BamfView *new_view,
PanelMenuView *self);
+static void on_name_changed (BamfView* bamf_view,
+ gchar* old_name,
+ gchar* new_name,
+ PanelMenuView* self);
PanelMenuView::PanelMenuView (int padding)
: _matcher (NULL),
@@ -68,6 +72,8 @@ PanelMenuView::PanelMenuView (int padding)
_layout = _menu_layout;
_padding = padding;
+ _name_changed_callback_instance = NULL;
+ _name_changed_callback_id = 0;
_window_buttons = new WindowButtons ();
_window_buttons->NeedRedraw ();
@@ -78,6 +84,7 @@ PanelMenuView::PanelMenuView (int padding)
_panel_titlebar_grab_area = new PanelTitlebarGrabArea ();
_panel_titlebar_grab_area->mouse_down.connect (sigc::mem_fun (this, &PanelMenuView::OnMaximizedGrab));
+ _panel_titlebar_grab_area->mouse_doubleclick.connect (sigc::mem_fun (this, &PanelMenuView::OnRestoreClicked));
win_manager = WindowManager::Default ();
@@ -574,11 +581,19 @@ PanelMenuView::AllMenusClosed ()
}
void
+PanelMenuView::OnNameChanged (gchar* new_name, gchar* old_name)
+{
+ Refresh ();
+ FullRedraw ();
+}
+
+void
PanelMenuView::OnActiveWindowChanged (BamfView *old_view,
BamfView *new_view)
{
_is_maximized = false;
+
if (BAMF_IS_WINDOW (new_view))
{
BamfWindow *window = BAMF_WINDOW (new_view);
@@ -587,6 +602,18 @@ PanelMenuView::OnActiveWindowChanged (BamfView *old_view,
if (_decor_map.find (xid) == _decor_map.end ())
_decor_map[xid] = true;
+
+ // first see if we need to remove and old callback
+ if (_name_changed_callback_id != 0)
+ g_signal_handler_disconnect (_name_changed_callback_instance,
+ _name_changed_callback_id);
+
+ // register callback for new view and store handler-id
+ _name_changed_callback_instance = G_OBJECT (new_view);
+ _name_changed_callback_id = g_signal_connect (_name_changed_callback_instance,
+ "name-changed",
+ (GCallback) on_name_changed,
+ this);
}
Refresh ();
@@ -771,3 +798,12 @@ on_active_window_changed (BamfMatcher *matcher,
{
self->OnActiveWindowChanged (old_view, new_view);
}
+
+static void
+on_name_changed (BamfView* bamf_view,
+ gchar* old_name,
+ gchar* new_name,
+ PanelMenuView* self)
+{
+ self->OnNameChanged (new_name, old_name);
+}
diff --git a/src/PanelMenuView.h b/src/PanelMenuView.h
index 56cad37c8..9bb743d90 100644
--- a/src/PanelMenuView.h
+++ b/src/PanelMenuView.h
@@ -65,6 +65,7 @@ public:
void OnEntryRefreshed (PanelIndicatorObjectEntryView *view);
void OnActiveChanged (PanelIndicatorObjectEntryView *view, bool is_active);
void OnActiveWindowChanged (BamfView *old_view, BamfView *new_view);
+ void OnNameChanged (gchar* new_name, gchar* old_name);
void OnSpreadInitiate (std::list <guint32> &);
void OnSpreadTerminate (std::list <guint32> &);
@@ -111,5 +112,7 @@ private:
std::map<guint32, bool> _decor_map;
int _padding;
+ gpointer _name_changed_callback_instance;
+ gulong _name_changed_callback_id;
};
#endif
diff --git a/src/PanelTitlebarGrabAreaView.cpp b/src/PanelTitlebarGrabAreaView.cpp
index 2ed79e01c..b76a16988 100644
--- a/src/PanelTitlebarGrabAreaView.cpp
+++ b/src/PanelTitlebarGrabAreaView.cpp
@@ -15,6 +15,7 @@
*
* Authored by: Neil Jagdish Patel <neil.patel@canonical.com>
* Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
+ * Authored by: Didier Roche <didier.roche@canonical.com>
*/
#include "Nux/Nux.h"
@@ -30,6 +31,8 @@
#include <glib.h>
+#define DELTA_MOUSE_DOUBLE_CLICK 500000000
+
enum
{
BUTTON_CLOSE=0,
@@ -40,7 +43,16 @@ enum
PanelTitlebarGrabArea::PanelTitlebarGrabArea ()
: InputArea (NUX_TRACKER_LOCATION)
-{
+{
+ // FIXME: the two following functions should be used instead of the insane trick with fixed value. But nux is broken
+ // right now and we need jay to focus on other things
+ /*InputArea::EnableDoubleClick (true);
+ InputArea::OnMouseDoubleClick.connect (sigc::mem_fun (this, &PanelTitlebarGrabArea::RecvMouseDoubleClick));*/
+ InputArea::OnMouseClick.connect (sigc::mem_fun (this, &PanelTitlebarGrabArea::RecvMouseClick));
+ _last_click_time.tv_sec = 0;
+ _last_click_time.tv_nsec = 0;
+
+ // connect the *Click events before the *Down ones otherwise, weird race happens
InputArea::OnMouseDown.connect (sigc::mem_fun (this, &PanelTitlebarGrabArea::RecvMouseDown));
}
@@ -49,6 +61,43 @@ PanelTitlebarGrabArea::~PanelTitlebarGrabArea ()
{
}
+void PanelTitlebarGrabArea::RecvMouseDown (int x, int y, unsigned long button_flags, unsigned long key_flags)
+{
+ mouse_down.emit (x, y);
+}
+
+void PanelTitlebarGrabArea::RecvMouseDoubleClick (int x, int y, unsigned long button_flags, unsigned long key_flags)
+{
+ mouse_doubleclick.emit ();
+}
+
+// TODO: can be safely removed once OnMouseDoubleClick is fixed in nux
+void PanelTitlebarGrabArea::RecvMouseClick (int x, int y, unsigned long button_flags, unsigned long key_flags)
+{
+ struct timespec event_time, delta;
+ clock_gettime(CLOCK_MONOTONIC, &event_time);
+ delta = time_diff (_last_click_time, event_time);
+
+ if ((delta.tv_sec == 0) && (delta.tv_nsec < DELTA_MOUSE_DOUBLE_CLICK))
+ RecvMouseDoubleClick (x, y, button_flags, key_flags);
+
+ _last_click_time.tv_sec = event_time.tv_sec;
+ _last_click_time.tv_nsec = event_time.tv_nsec;
+}
+
+struct timespec PanelTitlebarGrabArea::time_diff (struct timespec start, struct timespec end)
+{
+ struct timespec temp;
+ if ((end.tv_nsec - start.tv_nsec) < 0) {
+ temp.tv_sec = end.tv_sec - start.tv_sec-1;
+ temp.tv_nsec = 1000000000 + end.tv_nsec - start.tv_nsec;
+ } else {
+ temp.tv_sec = end.tv_sec - start.tv_sec;
+ temp.tv_nsec = end.tv_nsec - start.tv_nsec;
+ }
+ return temp;
+}
+
const gchar *
PanelTitlebarGrabArea::GetName ()
{
@@ -72,10 +121,3 @@ PanelTitlebarGrabArea::AddProperties (GVariantBuilder *builder)
g_variant_builder_add (builder, "{sv}", "width", g_variant_new_int32 (geo.width));
g_variant_builder_add (builder, "{sv}", "height", g_variant_new_int32 (geo.height));
}
-
-void PanelTitlebarGrabArea::RecvMouseDown (int x, int y, unsigned long button_flags, unsigned long key_flags)
-{
- mouse_down.emit (x, y);
-}
-
-
diff --git a/src/PanelTitlebarGrabAreaView.h b/src/PanelTitlebarGrabAreaView.h
index 184e5cd04..0dfd4555d 100644
--- a/src/PanelTitlebarGrabAreaView.h
+++ b/src/PanelTitlebarGrabAreaView.h
@@ -15,11 +15,16 @@
*
* Authored by: Neil Jagdish Patel <neil.patel@canonical.com>
* Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
+ * Authored by: Didier Roche <didier.roche@canonical.com>
*/
#ifndef PANEL_TITLEBAR_GRAB_AREA_H
#define PANEL_TITLEBAR_GRAB_AREA_H_H
+
+// TODO: remove once double click will work in nux
+#include <time.h>
+
#include <Nux/View.h>
#include "Introspectable.h"
@@ -34,13 +39,20 @@ public:
~PanelTitlebarGrabArea ();
sigc::signal <void, int, int> mouse_down;
+ sigc::signal <void> mouse_doubleclick;
protected:
+ void RecvMouseDown (int x, int y, unsigned long button_flags, unsigned long key_flags);
+ void RecvMouseDoubleClick (int x, int y, unsigned long button_flags, unsigned long key_flags);
+ // TODO: can be safely removed once OnMouseDoubleClick is fixed in nux
+ void RecvMouseClick (int x, int y, unsigned long button_flags, unsigned long key_flags);
+ struct timespec time_diff (struct timespec start, struct timespec end);
+
+ struct timespec _last_click_time;
+
const gchar * GetName ();
const gchar * GetChildsName ();
void AddProperties (GVariantBuilder *builder);
-
- void RecvMouseDown (int x, int y, unsigned long button_flags, unsigned long key_flags);
};
#endif
diff --git a/src/PlacesGroup.cpp b/src/PlacesGroup.cpp
index 1209463b4..76db84ade 100644
--- a/src/PlacesGroup.cpp
+++ b/src/PlacesGroup.cpp
@@ -124,7 +124,9 @@ void PlacesGroup::SetLayout (nux::Layout *layout)
_content = layout;
_content->Reference ();
- _group_layout->AddLayout (_content);
+ // By setting the stretch factor of the GridHLayout to 0, the height of the grid
+ // will be forced to the height that is necessary to include all its elements.
+ _group_layout->AddLayout (_content, 0);
ComputeChildLayout ();
NeedRedraw ();
diff --git a/src/PlacesResultsController.cpp b/src/PlacesResultsController.cpp
index 67208f0c1..af54a5571 100644
--- a/src/PlacesResultsController.cpp
+++ b/src/PlacesResultsController.cpp
@@ -109,7 +109,6 @@ PlacesResultsController::RemoveResultFromGroup (const char *groupname,
_tiles.erase (*id);
- delete &(_tile_group_relations[*id]);
_tile_group_relations.erase (*id);
delete group_name;
diff --git a/src/PlacesResultsView.cpp b/src/PlacesResultsView.cpp
index 5d24aa089..6aaef6c54 100644
--- a/src/PlacesResultsView.cpp
+++ b/src/PlacesResultsView.cpp
@@ -33,6 +33,9 @@ PlacesResultsView::PlacesResultsView (NUX_FILE_LINE_DECL)
m_vertical_scrollbar_enable = true;
_layout = new nux::VLayout ("", NUX_TRACKER_LOCATION);
_layout->SinkReference ();
+
+ _layout->SetContentDistribution(nux::MAJOR_POSITION_TOP);
+
setBorder (12);
EnableVerticalScrollBar (true);
@@ -92,7 +95,7 @@ PlacesResultsView::DrawContent (nux::GraphicsEngine &GfxContext, bool force_draw
void
PlacesResultsView::AddGroup (PlacesGroup *group)
{
- _layout->AddView (group);
+ _layout->AddView (group, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
ComputeChildLayout ();
}
diff --git a/src/PlacesSimpleTile.cpp b/src/PlacesSimpleTile.cpp
index 7de95f1a4..8f1671e03 100644
--- a/src/PlacesSimpleTile.cpp
+++ b/src/PlacesSimpleTile.cpp
@@ -44,7 +44,6 @@ PlacesTile (NUX_TRACKER_LOCATION)
_cairotext->SetMaximumWidth (140);
_layout->AddLayout (new nux::SpaceLayout (0, 0, 12, 12));
- _layout->SinkReference ();
_layout->AddView (_icontex, 0, nux::eCenter, nux::eFull);
_layout->AddSpace (6, 0);
_layout->AddView (_cairotext, 0, nux::eCenter, nux::eFull);
@@ -66,7 +65,7 @@ PlacesSimpleTile::~PlacesSimpleTile ()
{
_icontex->UnReference ();
_cairotext->UnReference ();
- _layout->UnReference ();
+
g_free ((void *)_label);
g_free ((void *)_icon);
}
diff --git a/src/StaticCairoText.cpp b/src/StaticCairoText.cpp
index 9611885cb..607a7b1da 100644
--- a/src/StaticCairoText.cpp
+++ b/src/StaticCairoText.cpp
@@ -53,11 +53,11 @@ StaticCairoText::~StaticCairoText ()
g_signal_handlers_disconnect_by_func (settings,
(void *) &StaticCairoText::OnFontChanged,
this);
- if (_cairoGraphics)
- delete (_cairoGraphics);
if (_texture2D)
delete (_texture2D);
- g_free (_fontstring);
+
+ if (_fontstring)
+ g_free (_fontstring);
}
void
@@ -331,7 +331,6 @@ void StaticCairoText::DrawText (cairo_t* cr,
GetTextExtents (fontName, textWidth, textHeight);
-
cairo_set_font_options (cr, gdk_screen_get_font_options (screen));
layout = pango_cairo_create_layout (cr);
desc = pango_font_description_from_string (fontName);
@@ -401,7 +400,7 @@ void StaticCairoText::UpdateTexture ()
_cairoGraphics = new CairoGraphics (CAIRO_FORMAT_ARGB32,
GetBaseWidth (),
GetBaseHeight ());
- cairo_t *cr = _cairoGraphics->GetContext ();
+ cairo_t *cr = cairo_reference (_cairoGraphics->GetContext ());
DrawText (cr, GetBaseWidth (), GetBaseHeight (), _textColor);
@@ -418,6 +417,8 @@ void StaticCairoText::UpdateTexture ()
_texture2D = GetThreadGLDeviceFactory()->CreateSystemCapableTexture ();
_texture2D->Update (bitmap);
+ cairo_destroy (cr);
+
delete _cairoGraphics;
}
diff --git a/src/TrashLauncherIcon.cpp b/src/TrashLauncherIcon.cpp
index e156dcf13..ffb2b3dd7 100644
--- a/src/TrashLauncherIcon.cpp
+++ b/src/TrashLauncherIcon.cpp
@@ -20,11 +20,12 @@
#include "TrashLauncherIcon.h"
#include <gio/gio.h>
+#include <glib/gi18n-lib.h>
TrashLauncherIcon::TrashLauncherIcon (Launcher* IconManager)
: SimpleLauncherIcon(IconManager)
{
- SetTooltipText ("Trash");
+ SetTooltipText (_("Trash"));
SetIconName ("user-trash");
SetQuirk (QUIRK_VISIBLE, true);
SetQuirk (QUIRK_RUNNING, false);
diff --git a/src/unity-util-accessible.cpp b/src/unity-util-accessible.cpp
index 4aa3124a4..821d65e44 100644
--- a/src/unity-util-accessible.cpp
+++ b/src/unity-util-accessible.cpp
@@ -194,6 +194,6 @@ unity_util_accessible_remove_global_event_listener (guint remove_listener)
void
unity_util_accessible_add_window (nux::BaseWindow *window)
{
- unity_root_accessible_add_window (UNITY_ROOT_ACCESSIBLE (root),
- window);
+ unity_root_accessible_add_window
+ (UNITY_ROOT_ACCESSIBLE (unity_util_accessible_get_root ()), window);
}
diff --git a/src/unitya11y.cpp b/src/unitya11y.cpp
index 2ad77291d..aad3b5e80 100644
--- a/src/unitya11y.cpp
+++ b/src/unitya11y.cpp
@@ -37,7 +37,6 @@
static GHashTable *accessible_table = NULL;
/* FIXME: remove accessible objects when not required anymore */
-static gboolean a11y_initialized = FALSE;
static void
unity_a11y_restore_environment (void)
@@ -191,8 +190,6 @@ unity_a11y_init (void)
{
g_debug ("Unity accessibility started, using bridge on %s",
bridge_path);
-
- a11y_initialized = TRUE;
}
g_free (bridge_path);
@@ -211,7 +208,6 @@ unity_a11y_finalize (void)
g_hash_table_unref (accessible_table);
accessible_table = NULL;
}
- a11y_initialized = FALSE;
}
@@ -294,12 +290,3 @@ unity_a11y_get_accessible (nux::Object *object)
return accessible_object;
}
-
-
-/*
- * Returns if the accessibility support is properly initialized
- */
-gboolean unity_a11y_initialized (void)
-{
- return a11y_initialized;
-}
diff --git a/src/unitya11y.h b/src/unitya11y.h
index bc76e6d9b..a583fd1bd 100644
--- a/src/unitya11y.h
+++ b/src/unitya11y.h
@@ -27,10 +27,6 @@
void unity_a11y_preset_environment (void);
void unity_a11y_init (void);
void unity_a11y_finalize (void);
-
-gboolean unity_a11y_initialized (void);
-
AtkObject *unity_a11y_get_accessible (nux::Object *object);
-
#endif /* UNITY_A11Y_H */
diff --git a/src/unityshell.cpp b/src/unityshell.cpp
index 5d4b8bf83..a6d094ee2 100644
--- a/src/unityshell.cpp
+++ b/src/unityshell.cpp
@@ -36,6 +36,7 @@
#include <dbus/dbus.h>
#include <dbus/dbus-glib.h>
+#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
#include <core/atoms.h>
@@ -43,6 +44,8 @@
#include "perf-logger-utility.h"
#include "unitya11y.h"
+#include "config.h"
+
/* FIXME: once we get a better method to add the toplevel windows to
the accessible root object, this include would not be required */
#include "unity-util-accessible.h"
@@ -476,6 +479,10 @@ UnityScreen::UnityScreen (CompScreen *screen) :
unity_a11y_init ();
+ /* i18n init */
+ bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+
wt->Run (NULL);
uScreen = this;
@@ -546,8 +553,7 @@ void UnityScreen::initLauncher (nux::NThread* thread, void* InitData)
/* FIXME: this should not be manual, should be managed with a
show/hide callback like in GAIL*/
- if (unity_a11y_initialized () == TRUE)
- unity_util_accessible_add_window (self->launcherWindow);
+ unity_util_accessible_add_window (self->launcherWindow);
self->launcher->SetIconSize (54, 48);
self->launcher->SetBacklightAlwaysOn (true);