I would like to control OpenSCAD from emacs via DBus. I have enabled DBus in Preferences-> Features -> input-driver-dbus and Axes -> DBus. It appears that DBus is not being initialized correctly. (To me, it seems as though it is only able to execute commands after the user has manually invoked some actions from the menu.)
To start with, I have built the (helpful) openscad-dbus-reference app by @MichaelPFrey
To reproduce:
Actual result:
Expected result:
Now, manually choose some items from the menu (in my case it was View -> Zoom in, Preferences, etc). After enough tinkering, you can try sending the action from the reference app and the action succeeds. From then on, the DBus interface seems to be working (both from the reference app, and from my test functions within emacs).
I am on Ubuntu 20.04 using openscad-nightly 2020.06.14.nightly (git be16bd8) but get the same behaviour with release 2019.05
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Is the application having input focus? For normal input devices, events are only forwarded to the active window. This may need some special handling for DBus.
Once DBus is up and running, I'm happily sending commands from my emacs (or the reference app), which are the ones that have focus, so that is probably not the issue.
Strange, I'm not aware of other special cases for the action list vs. other calls, but I guess that's what happens with bugs sometimes :wink:.
It's not just the action list (those are just the ones I've been trying out first). The other commands for zooming, etc in the reference app also do nothing.
Once the DBus interface is up and running, it's really handy.
I've put together a simple emacs package utilizing it, at https://github.com/Lenbok/scad-dbus
Most helpful comment
Once the DBus interface is up and running, it's really handy.
I've put together a simple emacs package utilizing it, at https://github.com/Lenbok/scad-dbus