Merge lp:~manuel-nicetto/unity/bug-754565 into lp:unity

Proposed by Manuel Nicetto
Status: Superseded
Proposed branch: lp:~manuel-nicetto/unity/bug-754565
Merge into: lp:unity
Diff against target: 147 lines (+37/-4)
4 files modified
plugins/unityshell/src/Launcher.cpp (+22/-1)
plugins/unityshell/src/Launcher.h (+2/-0)
plugins/unityshell/src/LauncherIcon.cpp (+11/-3)
plugins/unityshell/src/LauncherIcon.h (+2/-0)
To merge this branch: bzr merge lp:~manuel-nicetto/unity/bug-754565
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+64907@code.launchpad.net

This proposal has been superseded by a proposal from 2011-06-24.

To post a comment you must log in.
lp:~manuel-nicetto/unity/bug-754565 updated
1242. By Manuel Nicetto

fixed _shift_pressed assigned twice in LauncherIcon.cpp

1243. By Manuel Nicetto

-- Fixed key release checking the correct shift pressed event reported by Tim Penhey
-- Fixed identation errors reported from Marco Biscaro

1244. By Manuel Nicetto

-- fixed another identation error

1245. By Manuel Nicetto

Pass shift_pressed on click behavior as suggested by Jason

Unmerged revisions

1245. By Manuel Nicetto

Pass shift_pressed on click behavior as suggested by Jason

1244. By Manuel Nicetto

-- fixed another identation error

1243. By Manuel Nicetto

-- Fixed key release checking the correct shift pressed event reported by Tim Penhey
-- Fixed identation errors reported from Marco Biscaro

1242. By Manuel Nicetto

fixed _shift_pressed assigned twice in LauncherIcon.cpp

1241. By Manuel Nicetto

* Regression: shift+click on a launcher icon to open a new application instance gone

-- Manuel Nicetto <email address hidden> Thu 16 Jun 2011 23:31

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/Launcher.cpp'
2--- plugins/unityshell/src/Launcher.cpp 2011-06-22 19:18:47 +0000
3+++ plugins/unityshell/src/Launcher.cpp 2011-06-24 20:43:44 +0000
4@@ -258,6 +258,7 @@
5 _parent = parent;
6 _screen = screen;
7 _active_quicklist = 0;
8+ _shift_pressed=false;
9
10 _hide_machine = new LauncherHideMachine ();
11 _set_hidden_connection = (sigc::connection) _hide_machine->should_hide_changed.connect (sigc::mem_fun (this, &Launcher::SetHidden));
12@@ -276,6 +277,7 @@
13 OnMouseMove.connect (sigc::mem_fun (this, &Launcher::RecvMouseMove));
14 OnMouseWheel.connect (sigc::mem_fun (this, &Launcher::RecvMouseWheel));
15 OnKeyPressed.connect (sigc::mem_fun (this, &Launcher::RecvKeyPressed));
16+ OnKeyReleased.connect (sigc::mem_fun (this, &Launcher::RecvKeyReleased));
17 OnMouseDownOutsideArea.connect (sigc::mem_fun (this, &Launcher::RecvMouseDownOutsideArea));
18 //OnEndFocus.connect (sigc::mem_fun (this, &Launcher::exitKeyNavMode));
19
20@@ -3050,6 +3052,7 @@
21
22 void Launcher::RecvMouseDown(int x, int y, unsigned long button_flags, unsigned long key_flags)
23 {
24+ UnGrabKeyboard ();
25 _last_button_press = nux::GetEventButton (button_flags);
26 SetMousePosition (x, y);
27
28@@ -3142,6 +3145,7 @@
29 {
30 SetMousePosition (x, y);
31 SetStateMouseOverLauncher (true);
32+ GrabKeyboard ();
33
34 // make sure we actually get a chance to get events before turning this off
35 if (x > 0)
36@@ -3156,6 +3160,7 @@
37 SetMousePosition (x, y);
38 SetStateMouseOverLauncher (false);
39 LauncherIcon::SetSkipTooltipDelay (false);
40+ UnGrabKeyboard ();
41
42 EventLogic ();
43 EnsureAnimation ();
44@@ -3277,6 +3282,12 @@
45 {
46
47 LauncherModel::iterator it;
48+
49+ if(key_sym==NUX_VK_SHIFT){
50+ _shift_pressed=true;
51+ } else {
52+ _shift_pressed=false;
53+ }
54
55 /*
56 * all key events below are related to keynavigation. Make an additional
57@@ -3383,6 +3394,14 @@
58 }
59 }
60
61+void
62+Launcher::RecvKeyReleased (unsigned int key_sym,
63+ unsigned long key_code,
64+ unsigned long key_state)
65+{
66+ _shift_pressed=false;
67+}
68+
69 void Launcher::RecvQuicklistOpened (QuicklistView *quicklist)
70 {
71 _hide_machine->SetQuirk (LauncherHideMachine::QUICKLIST_OPEN, true);
72@@ -3465,7 +3484,9 @@
73 _icon_mouse_down->MouseUp.emit (nux::GetEventButton (button_flags));
74
75 if (GetActionState () == ACTION_NONE) {
76- _icon_mouse_down->MouseClick.emit (nux::GetEventButton (button_flags));
77+ _icon_mouse_down->_shift_pressed=_shift_pressed;
78+ _icon_mouse_down->MouseClick.emit (nux::GetEventButton (button_flags));
79+ _shift_pressed=false;
80 }
81 }
82
83
84=== modified file 'plugins/unityshell/src/Launcher.h'
85--- plugins/unityshell/src/Launcher.h 2011-06-09 07:23:27 +0000
86+++ plugins/unityshell/src/Launcher.h 2011-06-24 20:43:44 +0000
87@@ -156,6 +156,7 @@
88 virtual void RecvMouseDownOutsideArea (int x, int y, unsigned long button_flags, unsigned long key_flags);
89
90 virtual void RecvKeyPressed (unsigned int key_sym, unsigned long key_code, unsigned long key_state);
91+ virtual void RecvKeyReleased (unsigned int key_sym, unsigned long key_code, unsigned long key_state);
92
93 virtual void RecvQuicklistOpened (QuicklistView *quicklist);
94 virtual void RecvQuicklistClosed (QuicklistView *quicklist);
95@@ -424,6 +425,7 @@
96 bool _shortcuts_shown;
97 bool _super_pressed;
98 bool _keynav_activated;
99+ bool _shift_pressed;
100 guint64 _latest_shortcut;
101
102 BacklightMode _backlight_mode;
103
104=== modified file 'plugins/unityshell/src/LauncherIcon.cpp'
105--- plugins/unityshell/src/LauncherIcon.cpp 2011-06-21 12:10:09 +0000
106+++ plugins/unityshell/src/LauncherIcon.cpp 2011-06-24 20:43:44 +0000
107@@ -60,6 +60,7 @@
108 LauncherIcon::LauncherIcon(Launcher* launcher)
109 {
110 _folding_angle = 0;
111+ _shift_pressed=false;
112 _launcher = launcher;
113 m_TooltipText = "blank";
114
115@@ -608,10 +609,17 @@
116
117 void LauncherIcon::RecvMouseClick (int button)
118 {
119- if (button == 1)
120+ if (button == 1 && !_shift_pressed){
121 Activate ();
122- else if (button == 2)
123- OpenInstance ();
124+ }
125+ else if (button == 1 && _shift_pressed){
126+ OpenInstance ();
127+ }
128+ else if (button == 2){
129+ OpenInstance ();
130+ }
131+
132+ _shift_pressed=false;
133 }
134
135 void LauncherIcon::HideTooltip ()
136
137=== modified file 'plugins/unityshell/src/LauncherIcon.h'
138--- plugins/unityshell/src/LauncherIcon.h 2011-05-27 18:57:49 +0000
139+++ plugins/unityshell/src/LauncherIcon.h 2011-06-24 20:43:44 +0000
140@@ -234,6 +234,8 @@
141 bool _mouse_inside;
142 float _folding_angle;
143
144+ bool _shift_pressed;
145+
146 nux::Tooltip *_tooltip;
147 QuicklistView *_quicklist;
148