diff options
| -rw-r--r-- | src/Launcher.cpp | 29 | ||||
| -rw-r--r-- | src/Launcher.h | 4 | ||||
| -rw-r--r-- | src/PlacesTile.cpp | 27 | ||||
| -rw-r--r-- | src/PluginAdapter.cpp | 7 | ||||
| -rw-r--r-- | src/unityshell.cpp | 8 | ||||
| -rw-r--r-- | unityshell.xml.in | 2 |
6 files changed, 53 insertions, 24 deletions
diff --git a/src/Launcher.cpp b/src/Launcher.cpp index abaaaf48d..5a7a9eb54 100644 --- a/src/Launcher.cpp +++ b/src/Launcher.cpp @@ -381,6 +381,9 @@ Launcher::Launcher (nux::BaseWindow* parent, _drag_out_id = 0; _drag_out_delta_x = 0.0f; + // FIXME: remove + _initial_drag_animation = false; + _check_window_over_launcher = true; _postreveal_mousemove_delta_x = 0; _postreveal_mousemove_delta_y = 0; @@ -1322,7 +1325,9 @@ void Launcher::FillRenderArg (LauncherIcon *icon, icon->SetCenter (nux::Point3 (roundf (center.x), roundf (center.y), roundf (center.z))); - if (icon == _drag_icon && _drag_window && _drag_window->Animating ()) + // FIXME: this is a hack, we should have a look why SetAnimationTarget is necessary in SetAnimationTarget + // we should ideally just need it at start to set the target + if (!_initial_drag_animation && icon == _drag_icon && _drag_window && _drag_window->Animating ()) _drag_window->SetAnimationTarget ((int) center.x, (int) center.y + _parent->GetGeometry ().y); center.y += (half_size * size_modifier) + spacing; // move to end @@ -2748,7 +2753,8 @@ gboolean Launcher::StartIconDragTimeout (gpointer data) self->_icon_under_mouse->MouseLeave.emit (); self->_icon_under_mouse->_mouse_inside = false; self->_icon_under_mouse = 0; - } + } + self->_initial_drag_animation = true; self->StartIconDragRequest (self->GetMouseX (), self->GetMouseY ()); } self->_start_dragicon_handle = 0; @@ -2765,7 +2771,11 @@ void Launcher::StartIconDragRequest (int x, int y) { StartIconDrag (drag_icon); SetActionState (ACTION_DRAG_ICON); - UpdateDragWindowPosition (x, y); + UpdateDragWindowPosition (drag_icon->GetCenter ().x, drag_icon->GetCenter ().y); + if(_initial_drag_animation) { + _drag_window->SetAnimationTarget (x, y + _drag_window->GetGeometry ().height/2); + _drag_window->StartAnimation (); + } EnsureAnimation (); } } @@ -2882,6 +2892,9 @@ void Launcher::RecvMouseUp(int x, int y, unsigned long button_flags, unsigned lo void Launcher::RecvMouseDrag(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags) { SetMousePosition (x, y); + + // FIXME: hack (see SetupRenderArg) + _initial_drag_animation = false; _dnd_delta_y += dy; _dnd_delta_x += dx; @@ -3001,9 +3014,10 @@ Launcher::ResetRepeatShorcutTimeout (gpointer data) } gboolean -Launcher::CheckSuperShortcutPressed (unsigned int key_sym, +Launcher::CheckSuperShortcutPressed (unsigned int key_sym, unsigned long key_code, - unsigned long key_state) + unsigned long key_state, + char* key_string) { if (!_super_pressed) return false; @@ -3013,8 +3027,9 @@ Launcher::CheckSuperShortcutPressed (unsigned int key_sym, // Shortcut to start launcher icons. Only relies on Keycode, ignore modifier for (it = _model->begin (); it != _model->end (); it++) { - if (XKeysymToKeycode (screen->dpy (), (*it)->GetShortcut ()) == key_code) - { + if ((XKeysymToKeycode (screen->dpy (), (*it)->GetShortcut ()) == key_code) || + ((gchar)((*it)->GetShortcut ()) == key_string[0])) + { /* * start a timeout while repressing the same shortcut will be ignored. * This is because the keypress repeat is handled by Xorg and we have no diff --git a/src/Launcher.h b/src/Launcher.h index c17a60c4b..68509c6be 100644 --- a/src/Launcher.h +++ b/src/Launcher.h @@ -138,7 +138,7 @@ public: void SetAutoHideAnimation (AutoHideAnimation animation); AutoHideAnimation GetAutoHideAnimation (); - gboolean CheckSuperShortcutPressed (unsigned int key_sym, unsigned long key_code, unsigned long key_state); + gboolean CheckSuperShortcutPressed (unsigned int key_sym, unsigned long key_code, unsigned long key_state, char* key_string); nux::BaseWindow* GetParent () { return _parent; }; @@ -519,6 +519,8 @@ private: gpointer user_data); struct timespec _times[TIME_LAST]; + + bool _initial_drag_animation; sigc::connection _set_hidden_connection; sigc::connection _set_hover_connection; diff --git a/src/PlacesTile.cpp b/src/PlacesTile.cpp index 21dc054ba..9e39e34e8 100644 --- a/src/PlacesTile.cpp +++ b/src/PlacesTile.cpp @@ -26,7 +26,7 @@ #include "PlacesTile.h" #define PADDING 8 -#define BLUR_SIZE 5 +#define BLUR_SIZE 6 PlacesTile::PlacesTile (NUX_FILE_LINE_DECL, const void *id) : View (NUX_FILE_LINE_PARAM), @@ -85,6 +85,7 @@ PlacesTile::DrawHighlight (const char *texid, int width, int height, nux::BaseTe { nux::Geometry base = GetGeometry (); nux::Geometry highlight_geo = GetHighlightGeometry (); + nux::CairoGraphics *cairo_graphics = new nux::CairoGraphics (CAIRO_FORMAT_ARGB32, highlight_geo.width + PADDING + (BLUR_SIZE*3), highlight_geo.height + PADDING + (BLUR_SIZE*3)); @@ -96,10 +97,10 @@ PlacesTile::DrawHighlight (const char *texid, int width, int height, nux::BaseTe cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR); cairo_paint (cr); - int bg_width = highlight_geo.width + PADDING; - int bg_height = highlight_geo.height + PADDING; - int bg_x = BLUR_SIZE; - int bg_y = BLUR_SIZE; + int bg_width = highlight_geo.width + PADDING + 1; + int bg_height = highlight_geo.height + PADDING +1; + int bg_x = BLUR_SIZE-1; + int bg_y = BLUR_SIZE-1; // draw the glow cairo_set_operator (cr, CAIRO_OPERATOR_OVER); @@ -230,10 +231,10 @@ PlacesTile::Draw (nux::GraphicsEngine& gfxContext, { UpdateBackground (); nux::Geometry hl_geo = GetHighlightGeometry (); - nux::Geometry total_highlight_geo = nux::Geometry (base.x + hl_geo.x - (PADDING)/2 - BLUR_SIZE - 1, - base.y + hl_geo.y - (PADDING)/2 - BLUR_SIZE - 1, - hl_geo.width + PADDING + 1 + BLUR_SIZE*2, - hl_geo.height + PADDING + 1 + BLUR_SIZE*2); + nux::Geometry total_highlight_geo = nux::Geometry (base.x + hl_geo.x - (PADDING)/2 - BLUR_SIZE, + base.y + hl_geo.y - (PADDING)/2 - BLUR_SIZE, + hl_geo.width + PADDING + BLUR_SIZE*2, + hl_geo.height + PADDING + BLUR_SIZE*2); _hilight_layer->SetGeometry (total_highlight_geo); nux::GetPainter ().RenderSinglePaintLayer (gfxContext, total_highlight_geo, _hilight_layer); @@ -254,10 +255,10 @@ PlacesTile::DrawContent (nux::GraphicsEngine &GfxContext, bool force_draw) UpdateBackground (); nux::Geometry hl_geo = GetHighlightGeometry (); - nux::Geometry total_highlight_geo = nux::Geometry (base.x + hl_geo.x - (PADDING)/2 - BLUR_SIZE - 1, - base.y + hl_geo.y - (PADDING)/2 - BLUR_SIZE - 1, - hl_geo.width + PADDING + 1 + BLUR_SIZE*2, - hl_geo.height + PADDING + 1 + BLUR_SIZE*2); + nux::Geometry total_highlight_geo = nux::Geometry (base.x + hl_geo.x - (PADDING)/2 - BLUR_SIZE, + base.y + hl_geo.y - (PADDING)/2 - BLUR_SIZE, + hl_geo.width + PADDING + BLUR_SIZE*2, + hl_geo.height + PADDING + BLUR_SIZE*2); nux::GetPainter ().PushLayer (GfxContext, total_highlight_geo, _hilight_layer); } diff --git a/src/PluginAdapter.cpp b/src/PluginAdapter.cpp index 40e5a784b..38c2d2718 100644 --- a/src/PluginAdapter.cpp +++ b/src/PluginAdapter.cpp @@ -284,6 +284,13 @@ PluginAdapter::InitiateScale (std::string *match, int state) { if (std::find (m_SpreadedWindows.begin (), m_SpreadedWindows.end (), w->id ()) == m_SpreadedWindows.end ()) m_SpreadedWindows.push_back (w->id ()); + /* FIXME: + just unminimize minimized window for now, don't minimize them after the scale if not picked as TerminateScale is only + called if you click on the launcher, not on any icon. More generally, we should hook up InitiateScale and TerminateScale + to a Scale plugin signal as the shortcut will have a different behaviour then. + */ + if (w->minimized ()) + w->unminimize (); xids.push_back (w->id ()); } } diff --git a/src/unityshell.cpp b/src/unityshell.cpp index 0f39c6d60..25b9628ff 100644 --- a/src/unityshell.cpp +++ b/src/unityshell.cpp @@ -256,8 +256,12 @@ UnityScreen::handleEvent (XEvent *event) break; case KeyPress: KeySym key_sym; - if (XLookupString (&(event->xkey), NULL, 0, &key_sym, 0) > 0) - skip_other_plugins = launcher->CheckSuperShortcutPressed (key_sym, event->xkey.keycode, event->xkey.state); + char key_string[2]; + int result; + if ((result = XLookupString (&(event->xkey), key_string, 2, &key_sym, 0)) > 0) { + key_string[result] = 0; + skip_other_plugins = launcher->CheckSuperShortcutPressed (key_sym, event->xkey.keycode, event->xkey.state, key_string); + } break; } diff --git a/unityshell.xml.in b/unityshell.xml.in index e46466f97..86838fe09 100644 --- a/unityshell.xml.in +++ b/unityshell.xml.in @@ -33,7 +33,7 @@ </relation> <requirement> <plugin>opengl</plugin> - <plugin>wall</plugin> + <feature>largedesktop</feature> </requirement> </deps> <options> |
