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
=== modified file 'plugins/scale/scale.xml.in'
--- plugins/scale/scale.xml.in 2010-05-25 06:26:27 +0000
+++ plugins/scale/scale.xml.in 2011-09-01 18:04:36 +0000
@@ -84,6 +84,13 @@
84 <min>50</min>84 <min>50</min>
85 <max>10000</max>85 <max>10000</max>
86 </option>86 </option>
87 <option name="dnd_distance" type="int">
88 <_short>Drag and Drop Distance</_short>
89 <_long>The minimum distance (in px) beyond which the timeout is reset.</_long>
90 <default>6</default>
91 <min>0</min>
92 <max>250</max>
93 </option>
87 <option name="multioutput_mode" type="int">94 <option name="multioutput_mode" type="int">
88 <_short>Multi Output Mode</_short>95 <_short>Multi Output Mode</_short>
89 <_long>Selects where windows are scaled if multiple output devices are used.</_long>96 <_long>Selects where windows are scaled if multiple output devices are used.</_long>
9097
=== modified file 'plugins/scale/src/scale.cpp'
--- plugins/scale/src/scale.cpp 2011-03-14 16:12:45 +0000
+++ plugins/scale/src/scale.cpp 2011-09-01 18:04:36 +0000
@@ -1524,10 +1524,7 @@
1524 state != ScaleScreen::In &&1524 state != ScaleScreen::In &&
1525 w->id () == dndTarget)1525 w->id () == dndTarget)
1526 {1526 {
1527 int x = event->xclient.data.l[2] >> 16;1527 ScaleWindow *sw = checkForWindowAt (pointerX, pointerY);
1528 int y = event->xclient.data.l[2] & 0xffff;
1529
1530 ScaleWindow *sw = checkForWindowAt (x, y);
1531 if (sw && sw->priv->isScaleWin ())1528 if (sw && sw->priv->isScaleWin ())
1532 {1529 {
1533 int time;1530 int time;
@@ -1536,14 +1533,18 @@
15361533
1537 if (hover.active ())1534 if (hover.active ())
1538 {1535 {
1539 if (w->id () != selectedWindow)1536 int lastMotion = sqrt (pow (pointerX - lastPointerX, 2) + pow (pointerY - lastPointerY, 2));
1537
1538 if (sw->window->id () != selectedWindow || lastMotion > optionGetDndDistance ())
1540 hover.stop ();1539 hover.stop ();
1541 }1540 }
15421541
1543 if (!hover.active ())1542 if (!hover.active ())
1543 {
1544 hover.start (time, (float) time * 1.2);1544 hover.start (time, (float) time * 1.2);
1545 }
15451546
1546 selectWindowAt (x, y, focus);1547 selectWindowAt (pointerX, pointerY, focus);
1547 }1548 }
1548 else1549 else
1549 {1550 {

Subscribers

People subscribed via source and target branches