Merge lp:~azzar1/compiz-core/fix-832631 into lp:compiz-core/0.9.5

Proposed by Andrea Azzarone
Status: Merged
Merged at revision: 2799
Proposed branch: lp:~azzar1/compiz-core/fix-832631
Merge into: lp:compiz-core/0.9.5
Prerequisite: lp:~compiz-team/compiz-core/compiz-core.dont_require_version
Diff against target: 54 lines (+14/-6)
2 files modified
plugins/scale/scale.xml.in (+7/-0)
plugins/scale/src/scale.cpp (+7/-6)
To merge this branch: bzr merge lp:~azzar1/compiz-core/fix-832631
Reviewer Review Type Date Requested Status
Sam Spilsbury Approve
Review via email: mp+73692@code.launchpad.net

This proposal supersedes a proposal from 2011-09-01.

Description of the change

Does not reset the spread dnd timeout every single motion.

Reset it:
* when a new spread window is selected
* when the mouse motion is quite evident (i use a rect of 8x8px, feel free to use a bigger/lower one)

To post a comment you must log in.
lp:~azzar1/compiz-core/fix-832631 updated
2800. By Andrea Azzarone

Adds an option to edit the dnd distance.
Uses pointerX and pointerY instead of x and y
Uses lastPointerX/Y instead of the rect.

Revision history for this message
Andrea Azzarone (azzar1) wrote :

Updated as discussed on IRC.

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Looks great. Thanks Andrea!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/scale/scale.xml.in'
2--- plugins/scale/scale.xml.in 2010-05-25 06:26:27 +0000
3+++ plugins/scale/scale.xml.in 2011-09-01 18:04:36 +0000
4@@ -84,6 +84,13 @@
5 <min>50</min>
6 <max>10000</max>
7 </option>
8+ <option name="dnd_distance" type="int">
9+ <_short>Drag and Drop Distance</_short>
10+ <_long>The minimum distance (in px) beyond which the timeout is reset.</_long>
11+ <default>6</default>
12+ <min>0</min>
13+ <max>250</max>
14+ </option>
15 <option name="multioutput_mode" type="int">
16 <_short>Multi Output Mode</_short>
17 <_long>Selects where windows are scaled if multiple output devices are used.</_long>
18
19=== modified file 'plugins/scale/src/scale.cpp'
20--- plugins/scale/src/scale.cpp 2011-03-14 16:12:45 +0000
21+++ plugins/scale/src/scale.cpp 2011-09-01 18:04:36 +0000
22@@ -1524,10 +1524,7 @@
23 state != ScaleScreen::In &&
24 w->id () == dndTarget)
25 {
26- int x = event->xclient.data.l[2] >> 16;
27- int y = event->xclient.data.l[2] & 0xffff;
28-
29- ScaleWindow *sw = checkForWindowAt (x, y);
30+ ScaleWindow *sw = checkForWindowAt (pointerX, pointerY);
31 if (sw && sw->priv->isScaleWin ())
32 {
33 int time;
34@@ -1536,14 +1533,18 @@
35
36 if (hover.active ())
37 {
38- if (w->id () != selectedWindow)
39+ int lastMotion = sqrt (pow (pointerX - lastPointerX, 2) + pow (pointerY - lastPointerY, 2));
40+
41+ if (sw->window->id () != selectedWindow || lastMotion > optionGetDndDistance ())
42 hover.stop ();
43 }
44
45 if (!hover.active ())
46+ {
47 hover.start (time, (float) time * 1.2);
48+ }
49
50- selectWindowAt (x, y, focus);
51+ selectWindowAt (pointerX, pointerY, focus);
52 }
53 else
54 {

Subscribers

People subscribed via source and target branches