Merge lp:~ianchou821/ubuntu/utopic/unity/fix-lp1372130 into lp:unity

Proposed by Yu-Cheng Chou
Status: Needs review
Proposed branch: lp:~ianchou821/ubuntu/utopic/unity/fix-lp1372130
Merge into: lp:unity
Diff against target: 108 lines (+43/-24)
2 files modified
debian/changelog (+6/-0)
launcher/Launcher.cpp (+37/-24)
To merge this branch: bzr merge lp:~ianchou821/ubuntu/utopic/unity/fix-lp1372130
Reviewer Review Type Date Requested Status
Stephen M. Webb (community) Needs Fixing
Review via email: mp+235419@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Stephen M. Webb (bregma) wrote :

I'm sorry, this merge proposal does not appear on the usual bug-fix radar so got missed. I'm assuming it's because of the unusual path of the proposed branch in Launchpad (it's a diff against the Ubuntu package rather than the upstream project).

Please remove the debian/changelog changes and set the change message as a commit message to this merge proposal instead so that the Ubuntu autolander will handle it correctly.

review: Needs Fixing
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

hey, any news in this merge proposal? Can you fix it?

Revision history for this message
Yu-Cheng Chou (ianchou821) wrote :

it has been a long time, I'll check it out this weekend. If you could
provide me some tutorial or document on how to create a pr for ubuntu, that
will be great.

Thanks

On Tue, Oct 27, 2015 at 12:13 AM, Marco Trevisan (Treviño) <mail@3v1n0.net>
wrote:

> hey, any news in this merge proposal? Can you fix it?
> --
>
> https://code.launchpad.net/~ianchou821/ubuntu/utopic/unity/fix-lp1372130/+merge/235419
> You are the owner of lp:~ianchou821/ubuntu/utopic/unity/fix-lp1372130.
>

Unmerged revisions

3877. By Yu-Cheng Chou

Launcher: handle Trash icon under "steal drag" mode. (LP: #1372130)

3876. By Yu-Cheng Chou

Launcher: handle the switch between steal_drag and enter Trash.
(LP: #1372130)

3875. By Yu-Cheng Chou

Launcher.cpp: just ignore Trash in "steal drag" mode. (LP: #1372130)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-09-15 12:35:46 +0000
3+++ debian/changelog 2014-09-25 16:10:37 +0000
4@@ -1,3 +1,9 @@
5+unity (7.3.1+14.10.20140915-0ubuntu4) UNRELEASED; urgency=medium
6+
7+ * Launcher: handle Trash icon under "steal drag" mode. (LP: #1372130)
8+
9+ -- Yu-Cheng Chou <ianchou821@gmail.com> Fri, 26 Sep 2014 00:07:05 +0800
10+
11 unity (7.3.1+14.10.20140915-0ubuntu1) utopic; urgency=low
12
13 [ Michael Zanetti ]
14
15=== modified file 'launcher/Launcher.cpp'
16--- launcher/Launcher.cpp 2014-09-04 22:11:33 +0000
17+++ launcher/Launcher.cpp 2014-09-25 16:10:37 +0000
18@@ -2517,16 +2517,18 @@
19 #ifdef USE_X11
20 SetActionState(ACTION_NONE);
21
22- if (steal_drag_ && dnd_hovered_icon_)
23- {
24- dnd_hovered_icon_->SetQuirk(AbstractLauncherIcon::Quirk::VISIBLE, false, monitor());
25- dnd_hovered_icon_->remove.emit(dnd_hovered_icon_);
26- }
27-
28- if (!steal_drag_ && dnd_hovered_icon_)
29- {
30- dnd_hovered_icon_->SendDndLeave();
31- dnd_hovered_icon_->SetQuirk(AbstractLauncherIcon::Quirk::GLOW, false, monitor());
32+ if (dnd_hovered_icon_)
33+ {
34+ if (dnd_hovered_icon_->GetIconType() == AbstractLauncherIcon::IconType::SPACER)
35+ {
36+ dnd_hovered_icon_->SetQuirk(AbstractLauncherIcon::Quirk::VISIBLE, false, monitor());
37+ dnd_hovered_icon_->remove.emit(dnd_hovered_icon_);
38+ }
39+ else
40+ {
41+ dnd_hovered_icon_->SendDndLeave();
42+ dnd_hovered_icon_->SetQuirk(AbstractLauncherIcon::Quirk::GLOW, false, monitor());
43+ }
44 }
45
46 steal_drag_ = false;
47@@ -2602,19 +2604,20 @@
48 EventLogic();
49 auto const& hovered_icon = MouseIconIntersection(mouse_position_.x, mouse_position_.y);
50
51- bool hovered_icon_is_appropriate = false;
52- if (hovered_icon)
53- {
54- if (hovered_icon->GetIconType() == AbstractLauncherIcon::IconType::TRASH)
55- steal_drag_ = false;
56-
57- if (hovered_icon->position() == AbstractLauncherIcon::Position::FLOATING)
58- hovered_icon_is_appropriate = true;
59- }
60-
61- if (steal_drag_)
62+ bool hovered_icon_is_appropriate = hovered_icon && hovered_icon->position() == AbstractLauncherIcon::Position::FLOATING;
63+ bool hovered_icon_is_trash = hovered_icon && hovered_icon->GetIconType() == AbstractLauncherIcon::IconType::TRASH;
64+ bool dnd_hovered_icon_is_trash = dnd_hovered_icon_ && dnd_hovered_icon_->GetIconType() == AbstractLauncherIcon::IconType::TRASH;
65+
66+ if (steal_drag_ && !hovered_icon_is_trash)
67 {
68 drag_action_ = nux::DNDACTION_COPY;
69+ if (dnd_hovered_icon_is_trash)
70+ {
71+ dnd_hovered_icon_->SendDndLeave();
72+ dnd_hovered_icon_->SetQuirk(AbstractLauncherIcon::Quirk::GLOW, false, monitor());
73+ dnd_hovered_icon_ = nullptr;
74+ }
75+
76 if (!dnd_hovered_icon_ && hovered_icon_is_appropriate)
77 {
78 dnd_hovered_icon_ = new SpacerLauncherIcon(monitor());
79@@ -2657,8 +2660,16 @@
80
81 if (dnd_hovered_icon_)
82 {
83- dnd_hovered_icon_->SendDndLeave();
84- dnd_hovered_icon_->SetQuirk(AbstractLauncherIcon::Quirk::GLOW, false, monitor());
85+ if (dnd_hovered_icon_->GetIconType() == AbstractLauncherIcon::IconType::SPACER)
86+ {
87+ dnd_hovered_icon_->SetQuirk(AbstractLauncherIcon::Quirk::VISIBLE, false, monitor());
88+ dnd_hovered_icon_->remove.emit(dnd_hovered_icon_);
89+ }
90+ else
91+ {
92+ dnd_hovered_icon_->SendDndLeave();
93+ dnd_hovered_icon_->SetQuirk(AbstractLauncherIcon::Quirk::GLOW, false, monitor());
94+ }
95 }
96
97 dnd_hovered_icon_ = hovered_icon;
98@@ -2678,7 +2689,9 @@
99 void Launcher::ProcessDndDrop(int x, int y)
100 {
101 #ifdef USE_X11
102- if (steal_drag_)
103+ bool dnd_hovered_icon_is_trash = dnd_hovered_icon_ && dnd_hovered_icon_->GetIconType() == AbstractLauncherIcon::IconType::TRASH;
104+
105+ if (steal_drag_ && !dnd_hovered_icon_is_trash)
106 {
107 for (auto const& uri : dnd_data_.Uris())
108 {