Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I've tested Linux Mathematica versions 7-9 on various Linux distributions, with identical problem: after suspend/resume cycle my Manipulate controls (i.e. sliders&buttons) appear unresponsive, though I can enter the values manually. This looks much like this question, but before suspend I can use the controls normally, and if they stop working, restarting Mathematica also helps (killing and restarting math kernel doesn't help). Easy way to test this would be using this code:

Manipulate[Plot[a x, {x, -3, 3}, PlotRange -> {-1, 1}], {a, -1, 1}]

Then making the machine suspend to RAM, waiting 5 seconds and resuming it. If the controls still work (I rarely encounter such situation), second suspend does kill them.

Does anyone reproduce this problem? Are there any better workarounds than restarting Mathematica UI?

share|improve this question
    
I can confirm this on Ubuntu 13.04 and Mathematica 9 –  swish May 2 '13 at 16:37
    
Can confirm this bug on Ubuntu 12.04.02, 64 bit. –  Danvil May 10 '13 at 8:32
    
Confirm Mathematica 8.0.4 64bit. Fedora 16 and 18, Intel HD3000 card and nvidia card (official driver and nouveau), KDE 4. Also happens for mouse-controled Dynamic things like Slider and Locator. –  ssch May 16 '13 at 1:13

2 Answers 2

up vote 8 down vote accepted

I've also noticed this bug, although buttons/drop down menus do continue to work, for me only sliders become unresponsive after suspend (Ubuntu 12.10/Mathematica 9.0.0.0 x86 64 bits).

A possible workaround is thus to change all parameter controls to buttons/dropdown menus by providing a finite list of values the parameter is allowed to take:

Manipulate[Plot[a x, {x, -3, 3}, PlotRange -> {-1, 1}], {a, Range[-2,2,.5]}

Let's hope someone at Wolfram notices this thread! Have you already filed a bug report?

share|improve this answer
    
Yes, I've reported the bug and gave them a link to this question. –  Ruslan May 7 '13 at 17:18
2  
Today I've received a reply from Wolfram Technical Support. They say this issue is known and being worked on. –  Ruslan May 29 '13 at 21:26
1  
I am running into this with Mathematica 10. I'd poke the Wolfram people to actually work on this issue ;-). –  rubenvb Sep 22 '14 at 9:48
    
I wonder whether it happens on every laptop or only on some particular ones. It does happen on my Lenovo Thinkpad X200t. –  Andrew Neitzke Oct 14 '14 at 23:30
    
@AndrewNeitzke, it's not limited to laptops. It happens to me on all my desktops as well as netbooks. –  Ruslan Oct 15 '14 at 10:33

Another workaround, which allows to still have slider-like input, but is currently a bit inconvenient (ideas (with code) to improve are welcome!), is making a custom control. I've taken this answer as a starting example and reworked it to make it function when LocatorPane and the like don't work.

It appears that MousePosition and EventHandler still appear to work even when this bug is active. So, here's the code for the custom control:

customSlider[Dynamic[i_], str_, b_, e_] :=
 Dynamic[
  With[{diskSize = Abs[e - b]/60},
   EventHandler[
      Graphics[{Red, Disk[{i, 0}, diskSize]}, 
       PlotRange -> {{b, e}, {-diskSize, diskSize}}, 
       Axes -> {True, False}, ImageSize -> 300, Background -> None, 
       ImagePadding -> 10, PlotLabel -> Row[{str, i}]],
    {"MouseMoved" :> (If[Abs[Last@#] < diskSize, i = First@#]&@MousePosition["Graphics"])}
    ]
   ]
  ]

And here's how to use it with the example in the OP:

Manipulate[Plot[a x, {x, -3, 3}, PlotRange -> {-1, 1}],
    {{a, 0}, (customSlider[#1, "a=", -1, 1] &)}]

It looks like this:

enter image description here

To use it, just move the cursor in the scale, and the red disk will follow it. I tried using "MouseDragged" as the event, but it works strangely and isn't really usable. Another possible alternative is to use "MouseClicked". Even better might be to somehow make a local active variable and set it to True on MouseDown, False on MouseRelease and work according to this, but I failed to make Dynamic work with Block/Module...

EDIT

It appears that "MouseDragged" doesn't work as expected because while the mouse button is pressed, no events are generated at all. Thus the only way I see to have some sort of "click to start drag" process is using keyboard keys instead of mouse buttons, i.e. checking state of keyboard keys such as Ctrl via CurrentValue["ControlKey"] and only setting i if it returns True.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.