summaryrefslogtreecommitdiff
path: root/src
diff options
authorJason Smith <jason.smith@canonical.com>2011-01-31 08:55:03 -0500
committerJason Smith <jason.smith@canonical.com>2011-01-31 08:55:03 -0500
commit06d2187c055f7e80633dbc9fd2fae45a8e31c8c9 (patch)
treedcef32feedba1787d8e4a6fd78f0cf8a39284d92 /src
parent5647ffac1a59e1bd777a1511218f835b7c59af63 (diff)
parentfb94897ed4398d3e5066b0ea36d0c099720127c1 (diff)
merge trunk
(bzr r785.7.6)
Diffstat (limited to 'src')
-rw-r--r--src/Launcher.cpp7
-rw-r--r--src/Launcher.h1
-rw-r--r--src/LauncherModel.cpp28
-rw-r--r--src/LauncherModel.h2
-rw-r--r--src/PluginAdapter.cpp2
-rw-r--r--src/unitya11y.cpp12
-rw-r--r--src/unitya11y.h1
-rw-r--r--src/unityshell.cpp3
8 files changed, 53 insertions, 3 deletions
diff --git a/src/Launcher.cpp b/src/Launcher.cpp
index 6f71bb529..fab9fed2a 100644
--- a/src/Launcher.cpp
+++ b/src/Launcher.cpp
@@ -282,6 +282,7 @@ Launcher::Launcher(nux::BaseWindow *parent, CompScreen *screen, NUX_FILE_LINE_DE
_window_over_launcher = false;
_render_drag_window = false;
_backlight_always_on = false;
+ _last_button_press = 0;
// 0 out timers to avoid wonky startups
@@ -1918,6 +1919,7 @@ void Launcher::UpdateDragWindowPosition (int x, int y)
void Launcher::RecvMouseDown(int x, int y, unsigned long button_flags, unsigned long key_flags)
{
+ _last_button_press = nux::GetEventButton (button_flags);
SetMousePosition (x, y);
MouseDownLogic (x, y, button_flags, key_flags);
@@ -1943,6 +1945,7 @@ void Launcher::RecvMouseUp(int x, int y, unsigned long button_flags, unsigned lo
_launcher_action_state = ACTION_NONE;
_dnd_delta_x = 0;
_dnd_delta_y = 0;
+ _last_button_press = 0;
EnsureHoverState ();
EnsureAnimation ();
}
@@ -1979,7 +1982,9 @@ void Launcher::RecvMouseDrag(int x, int y, int dx, int dy, unsigned long button_
{
LauncherIcon *drag_icon = MouseIconIntersection ((int) (GetGeometry ().x / 2.0f), y);
- if (drag_icon)
+ // FIXME: nux doesn't give nux::GetEventButton (button_flags) there, relying
+ // on an internal Launcher property then
+ if (drag_icon && (_last_button_press == 1) && _model->IconHasSister (drag_icon))
{
StartIconDrag (drag_icon);
_launcher_action_state = ACTION_DRAG_ICON;
diff --git a/src/Launcher.h b/src/Launcher.h
index bb62627a9..3e0c337a4 100644
--- a/src/Launcher.h
+++ b/src/Launcher.h
@@ -315,6 +315,7 @@ private:
int _launcher_drag_delta;
int _dnd_security;
int _enter_y;
+ int _last_button_press;
nux::BaseTexture* _icon_bkg_texture;
nux::BaseTexture* _icon_shine_texture;
diff --git a/src/LauncherModel.cpp b/src/LauncherModel.cpp
index 834a6e12e..6bb7676d9 100644
--- a/src/LauncherModel.cpp
+++ b/src/LauncherModel.cpp
@@ -119,6 +119,34 @@ LauncherModel::Sort (SortFunc func)
order_changed.emit ();
}
+bool
+LauncherModel::IconHasSister (LauncherIcon *icon)
+{
+ iterator (LauncherModel::*begin_it)(void);
+ iterator (LauncherModel::*end_it)(void);
+ iterator it;
+
+ if (IconShouldShelf (icon))
+ {
+ begin_it = &LauncherModel::shelf_begin;
+ end_it = &LauncherModel::shelf_end;
+ }
+ else
+ {
+ begin_it = &LauncherModel::main_begin;
+ end_it = &LauncherModel::main_end;
+ }
+
+ for (it = (this->*begin_it) (); it != (this->*end_it) (); it++)
+ {
+ if ((*it != icon)
+ && (*it)->Type () == icon->Type ())
+ return true;
+ }
+
+ return false;
+}
+
int
LauncherModel::Size ()
{
diff --git a/src/LauncherModel.h b/src/LauncherModel.h
index a63138e73..4a06b8c5e 100644
--- a/src/LauncherModel.h
+++ b/src/LauncherModel.h
@@ -43,6 +43,8 @@ public:
void OnIconRemove (LauncherIcon *icon);
+ bool IconHasSister (LauncherIcon *icon);
+
iterator begin ();
iterator end ();
reverse_iterator rbegin ();
diff --git a/src/PluginAdapter.cpp b/src/PluginAdapter.cpp
index 72412e771..af8f9e9aa 100644
--- a/src/PluginAdapter.cpp
+++ b/src/PluginAdapter.cpp
@@ -23,7 +23,7 @@
PluginAdapter * PluginAdapter::_default = 0;
#define MAXIMIZABLE (CompWindowActionMaximizeHorzMask & CompWindowActionMaximizeVertMask & CompWindowActionResizeMask)
-#define COVERAGE_AREA_BEFORE_AUTOMAXIMIZE 0.6
+#define COVERAGE_AREA_BEFORE_AUTOMAXIMIZE 0.75
/* static */
PluginAdapter *
diff --git a/src/unitya11y.cpp b/src/unitya11y.cpp
index aad3b5e80..358366ac0 100644
--- a/src/unitya11y.cpp
+++ b/src/unitya11y.cpp
@@ -38,6 +38,8 @@
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)
{
@@ -190,6 +192,7 @@ unity_a11y_init (void)
{
g_debug ("Unity accessibility started, using bridge on %s",
bridge_path);
+ a11y_initialized = TRUE;
}
g_free (bridge_path);
@@ -208,6 +211,7 @@ unity_a11y_finalize (void)
g_hash_table_unref (accessible_table);
accessible_table = NULL;
}
+ a11y_initialized = FALSE;
}
@@ -290,3 +294,11 @@ 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 a583fd1bd..7e0768407 100644
--- a/src/unitya11y.h
+++ b/src/unitya11y.h
@@ -28,5 +28,6 @@ void unity_a11y_preset_environment (void);
void unity_a11y_init (void);
void unity_a11y_finalize (void);
AtkObject *unity_a11y_get_accessible (nux::Object *object);
+gboolean unity_a11y_initialized (void);
#endif /* UNITY_A11Y_H */
diff --git a/src/unityshell.cpp b/src/unityshell.cpp
index 404c5d6cf..7869fdcff 100644
--- a/src/unityshell.cpp
+++ b/src/unityshell.cpp
@@ -556,7 +556,8 @@ 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*/
- unity_util_accessible_add_window (self->launcherWindow);
+ if (unity_a11y_initialized () == TRUE)
+ unity_util_accessible_add_window (self->launcherWindow);
self->launcher->SetIconSize (54, 48);
self->launcher->SetBacklightAlwaysOn (true);