Merge lp:~mjuhasz/unity/fix-for-754565 into lp:unity

Proposed by Miklos Juhasz on 2012-04-11
Status: Superseded
Proposed branch: lp:~mjuhasz/unity/fix-for-754565
Merge into: lp:unity
Diff against target: 159 lines (+33/-29)
6 files modified
plugins/unityshell/src/AbstractLauncherIcon.h (+3/-3)
plugins/unityshell/src/Launcher.cpp (+4/-4)
plugins/unityshell/src/LauncherIcon.cpp (+9/-5)
plugins/unityshell/src/LauncherIcon.h (+5/-5)
plugins/unityshell/src/SimpleLauncherIcon.cpp (+9/-9)
plugins/unityshell/src/SimpleLauncherIcon.h (+3/-3)
To merge this branch: bzr merge lp:~mjuhasz/unity/fix-for-754565
Reviewer Review Type Date Requested Status
Alex Launi (community) quality 2012-04-11 Needs Fixing on 2012-04-12
Review via email: mp+101635@code.launchpad.net

This proposal has been superseded by a proposal from 2012-05-02.

Description of the Change

Fix for bug #754565 - Shift+Click on a launcher icon should open a new instance of the application.

Also see: https://code.launchpad.net/~yeganeh/unity/fix-for-754565/+merge/77739

To post a comment you must log in.
Alex Launi (alexlauni) wrote :

Please add an autopilot test to ensure that this feature does not regress, and is working properly. A new test should go into tests/autopilot/autopilot/tests/test_launcher.py

review: Needs Fixing (quality)
Miklos Juhasz (mjuhasz) wrote :

@thomir: Is your offer to write the test still valid?

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/unityshell/src/AbstractLauncherIcon.h'
--- plugins/unityshell/src/AbstractLauncherIcon.h 2012-03-30 15:24:34 +0000
+++ plugins/unityshell/src/AbstractLauncherIcon.h 2012-04-11 19:21:24 +0000
@@ -207,9 +207,9 @@
207 207
208 virtual void UnStick() = 0;208 virtual void UnStick() = 0;
209209
210 sigc::signal<void, int, int> mouse_down;210 sigc::signal<void, int, int, unsigned long> mouse_down;
211 sigc::signal<void, int, int> mouse_up;211 sigc::signal<void, int, int, unsigned long> mouse_up;
212 sigc::signal<void, int, int> mouse_click;212 sigc::signal<void, int, int, unsigned long> mouse_click;
213 sigc::signal<void, int> mouse_enter;213 sigc::signal<void, int> mouse_enter;
214 sigc::signal<void, int> mouse_leave;214 sigc::signal<void, int> mouse_leave;
215215
216216
=== modified file 'plugins/unityshell/src/Launcher.cpp'
--- plugins/unityshell/src/Launcher.cpp 2012-04-10 01:41:16 +0000
+++ plugins/unityshell/src/Launcher.cpp 2012-04-11 19:21:24 +0000
@@ -2533,7 +2533,7 @@
2533 g_source_remove(_start_dragicon_handle);2533 g_source_remove(_start_dragicon_handle);
2534 _start_dragicon_handle = g_timeout_add(START_DRAGICON_DURATION, &Launcher::StartIconDragTimeout, this);2534 _start_dragicon_handle = g_timeout_add(START_DRAGICON_DURATION, &Launcher::StartIconDragTimeout, this);
25352535
2536 launcher_icon->mouse_down.emit(nux::GetEventButton(button_flags), monitor);2536 launcher_icon->mouse_down.emit(nux::GetEventButton(button_flags), monitor, key_flags);
2537 }2537 }
2538}2538}
25392539
@@ -2549,17 +2549,17 @@
25492549
2550 if (_icon_mouse_down && (_icon_mouse_down == launcher_icon))2550 if (_icon_mouse_down && (_icon_mouse_down == launcher_icon))
2551 {2551 {
2552 _icon_mouse_down->mouse_up.emit(nux::GetEventButton(button_flags), monitor);2552 _icon_mouse_down->mouse_up.emit(nux::GetEventButton(button_flags), monitor, key_flags);
25532553
2554 if (GetActionState() == ACTION_NONE)2554 if (GetActionState() == ACTION_NONE)
2555 {2555 {
2556 _icon_mouse_down->mouse_click.emit(nux::GetEventButton(button_flags), monitor);2556 _icon_mouse_down->mouse_click.emit(nux::GetEventButton(button_flags), monitor, key_flags);
2557 }2557 }
2558 }2558 }
25592559
2560 if (launcher_icon && (_icon_mouse_down != launcher_icon))2560 if (launcher_icon && (_icon_mouse_down != launcher_icon))
2561 {2561 {
2562 launcher_icon->mouse_up.emit(nux::GetEventButton(button_flags), monitor);2562 launcher_icon->mouse_up.emit(nux::GetEventButton(button_flags), monitor, key_flags);
2563 }2563 }
25642564
2565 if (GetActionState() == ACTION_DRAG_LAUNCHER)2565 if (GetActionState() == ACTION_DRAG_LAUNCHER)
25662566
=== modified file 'plugins/unityshell/src/LauncherIcon.cpp'
--- plugins/unityshell/src/LauncherIcon.cpp 2012-04-10 00:39:14 +0000
+++ plugins/unityshell/src/LauncherIcon.cpp 2012-04-11 19:21:24 +0000
@@ -620,13 +620,13 @@
620 return true;620 return true;
621}621}
622622
623void LauncherIcon::RecvMouseDown(int button, int monitor)623void LauncherIcon::RecvMouseDown(int button, int monitor, unsigned long key_flags)
624{624{
625 if (button == 3)625 if (button == 3)
626 OpenQuicklist();626 OpenQuicklist();
627}627}
628628
629void LauncherIcon::RecvMouseUp(int button, int monitor)629void LauncherIcon::RecvMouseUp(int button, int monitor, unsigned long key_flags)
630{630{
631 if (button == 3)631 if (button == 3)
632 {632 {
@@ -635,14 +635,18 @@
635 }635 }
636}636}
637637
638void LauncherIcon::RecvMouseClick(int button, int monitor)638void LauncherIcon::RecvMouseClick(int button, int monitor, unsigned long key_flags)
639{639{
640 ActionArg arg(ActionArg::LAUNCHER, button);640 ActionArg arg(ActionArg::LAUNCHER, button);
641 arg.monitor = monitor;641 arg.monitor = monitor;
642642
643 if (button == 1)643 bool shift_pressed = nux::GetKeyModifierState(key_flags, nux::NUX_STATE_SHIFT);
644
645 // Click without shift
646 if (button == 1 && !shift_pressed)
644 Activate(arg);647 Activate(arg);
645 else if (button == 2)648 // Middle click or click with shift
649 else if ((button == 2) || (button == 1 && shift_pressed))
646 OpenInstance(arg);650 OpenInstance(arg);
647}651}
648652
649653
=== modified file 'plugins/unityshell/src/LauncherIcon.h'
--- plugins/unityshell/src/LauncherIcon.h 2012-04-03 22:18:36 +0000
+++ plugins/unityshell/src/LauncherIcon.h 2012-04-11 19:21:24 +0000
@@ -76,11 +76,11 @@
7676
77 void RecvMouseLeave(int monitor);77 void RecvMouseLeave(int monitor);
7878
79 void RecvMouseDown(int button, int monitor);79 void RecvMouseDown(int button, int monitor, unsigned long key_flags = 0);
8080
81 void RecvMouseUp(int button, int monitor);81 void RecvMouseUp(int button, int monitor, unsigned long key_flags = 0);
8282
83 void RecvMouseClick(int button, int monitor);83 void RecvMouseClick(int button, int monitor, unsigned long key_flags = 0);
8484
85 void HideTooltip();85 void HideTooltip();
8686
8787
=== modified file 'plugins/unityshell/src/SimpleLauncherIcon.cpp'
--- plugins/unityshell/src/SimpleLauncherIcon.cpp 2012-03-25 22:52:20 +0000
+++ plugins/unityshell/src/SimpleLauncherIcon.cpp 2012-04-11 19:21:24 +0000
@@ -69,15 +69,15 @@
69 g_signal_handler_disconnect(gtk_icon_theme_get_default(), theme_changed_id_);69 g_signal_handler_disconnect(gtk_icon_theme_get_default(), theme_changed_id_);
70}70}
7171
72void SimpleLauncherIcon::OnMouseDown(int button, int monitor)72void SimpleLauncherIcon::OnMouseDown(int button, int monitor, unsigned long key_flags)
73{73{
74}74}
7575
76void SimpleLauncherIcon::OnMouseUp(int button, int monitor)76void SimpleLauncherIcon::OnMouseUp(int button, int monitor, unsigned long key_flags)
77{77{
78}78}
7979
80void SimpleLauncherIcon::OnMouseClick(int button, int monitor)80void SimpleLauncherIcon::OnMouseClick(int button, int monitor, unsigned long key_flags)
81{81{
82}82}
8383
8484
=== modified file 'plugins/unityshell/src/SimpleLauncherIcon.h'
--- plugins/unityshell/src/SimpleLauncherIcon.h 2012-03-25 22:52:20 +0000
+++ plugins/unityshell/src/SimpleLauncherIcon.h 2012-04-11 19:21:24 +0000
@@ -49,9 +49,9 @@
49 std::string GetName() const;49 std::string GetName() const;
50 void AddProperties(GVariantBuilder* builder);50 void AddProperties(GVariantBuilder* builder);
5151
52 virtual void OnMouseDown(int button, int monitor);52 virtual void OnMouseDown(int button, int monitor, unsigned long key_flags = 0);
53 virtual void OnMouseUp(int button, int monitor);53 virtual void OnMouseUp(int button, int monitor, unsigned long key_flags = 0);
54 virtual void OnMouseClick(int button, int monitor);54 virtual void OnMouseClick(int button, int monitor, unsigned long key_flags = 0);
55 virtual void OnMouseEnter(int monitor);55 virtual void OnMouseEnter(int monitor);
56 virtual void OnMouseLeave(int monitor);56 virtual void OnMouseLeave(int monitor);
57 virtual void ActivateLauncherIcon(ActionArg arg);57 virtual void ActivateLauncherIcon(ActionArg arg);