I recently asked a question about Locators not behaving properly (see Locators and Table within a Manipulate are not behaving) and thought I had figured out the answer. However, as I played around to figure out why the problem existed in the first place I discovered that using Deploy caused the problem to return. Here is as simple of an example as I can come up with that reproduces the problem and maintains some of the features that I need in the Manipulate. Particularly, I need to link the two sliders with the Locator. The following works fine:
Manipulate[
vector = Graphics[{Green, Arrow[{{0, 0}, p}],
Locator[Dynamic[p, (p = #; x = p[[1]]; y = p[[2]]) &]]}];
Show[{vector}, PlotRange -> {{-2.1, 2.1}, {-2.1, 2.1}},
ImageSize -> 500],
Row[{"Ax", Manipulator[Dynamic[x, (x = #; p[[1]] = x) &], {-2, 2}],
Spacer[4], Dynamic[x]}],
Row[{"Ay", Manipulator[Dynamic[y, (y = #; p[[2]] = y) &], {-2, 2}],
Spacer[4], Dynamic[y]}],
{{p, {1, 1}}, None},
{{x, 1}, None},
{{y, 1}, None},
TrackedSymbols -> {x, y, p}]
You get a green arrow that you can move with either the Locator or the Sliders (one component at a time).
However, if the user clicks slightly off of the Locator they highlight the whole graphics image and go into an editing mode. Users unfamiliar with this may not know what to do so I want to prevent this by using Deploy.
Adding Deployed->True as an option to the Manipulate doesn't work. The documentation for Manipulate says that it should, but for some reason it does nothing here.
So instead I wrapped Deploy around Show:
Deploy@Show[{vector}, PlotRange -> {{-2.1, 2.1}, {-2.1, 2.1}},
ImageSize -> 500],
Now the user doesn't accidentally go into editing mode, but the Locator doesn't work. The Sliders do move the vector around and the Locator moves with them, but I can't move the locator with the mouse except for a VERY small distance at a time.
I'm wondering if this might have something to do with how I have linked the various control variables using the second argument of Dynamic. Perhaps the solution to this is also ultimately the solution to the question I referenced above. Thanks!