Comments (17)
I can't reproduce this in Bitwig or Reaper on Ubuntu 20.04, or on Bitwig on Mac. Does creating new objects with shortcuts work? ("n" for empty object, make sure canvas has keyboard focus)
from plugdata.
'n' works! Is there is a list of shortcuts?
from plugdata.
n = empty
b = bang
t = toggle
m = message
s = vertical slider
i = number box
f = floatatom
c = comment
These are Max/MSP like instead of Pd-like because I find them much easier to memorise, but not every object has a shortcut right now. You can also create any GUI object by just typing its name, like "msg", "tgl", "bng", "hsl", "cnv".
The fact that it works like this and not when clicked from the callout menu suggests that there is somehow no event triggered when the callout menu closes, I'll see if I can find something.
from plugdata.
@ensonic I think this was a bug in JUCE, I've updated JUCE to the latest version so it might be fixed now
from plugdata.
Thanks, I've updated my checkout and rebuild everything, but it does not help. You might have also introduced a bug. When I save a patch, it break it (there is some garbage appended to the pure data file).
from plugdata.
Oh no, I'll try that out, thanks for reporting. Unfortunate that the JUCE update doesn't help. Did you update the submodules? I've changed the submodule structure quite a lot so I'd recommend cloning it from scratch.
The new version does add a comment to the pd file, to store extra information to the patch. I've also seen that it sometimes adds a newline at the end of a patch...
Does it completely break, or does it just show an error in the console?
edit: Found and solved the problem, by calling pd's save functions directly instead of getting the canvas content and saving that manually.
from plugdata.
@ensonic I wonder if this is still happening?
from plugdata.
I did not rebuild recently and I am using my distros package (0.3.2+git.13.b8ab75a-7.11). With that one the problem still exists.
from plugdata.
Very likely that it's still an issue then... Problem is, it works fine on all my linux installations, making it very hard to solve.
from plugdata.
I'll rebuild from git. Can you point me to the code for the menu an for the keyboard handling. I can add some log statements to figure what's different from the event to the object creation.
from plugdata.
Thanks, that might help!
It happens here:
https://github.com/timothyschoen/PlugData/blob/main/Source/Dialogs/Dialogs.cpp
in "Dialogs::showObjectMenu", the last line spawns the menu. You could place a log statement in the callback function it passes in, I'm curious if that gets called. And if it does, what is the "result" value it passes in?
Then you could add a second log statement here:
https://github.com/timothyschoen/PlugData/blob/main/Source/PluginEditor.cpp
in function "perform", case "CommandIDs::NewObject"
I assume that it never gets to that point, but it'd be nice to confirm that.
from plugdata.
Done. This is my patch for reference:
diff --git a/Source/Dialogs/Dialogs.cpp b/Source/Dialogs/Dialogs.cpp
index 174dd20..349e3a8 100644
--- a/Source/Dialogs/Dialogs.cpp
+++ b/Source/Dialogs/Dialogs.cpp
@@ -110,11 +110,15 @@ void Dialogs::showObjectMenu(PlugDataPluginEditor* parent, Component* target)
menu.showMenuAsync(PopupMenu::Options().withMinimumWidth(100).withMaximumNumColumns(1).withTargetComponent(target).withParentComponent(parent),
[parent](int result)
{
+ parent->pd.logMessage(String(__FILE__) + ":" + String(__LINE__) + ":" + String(__FUNCTION__) + ": popup result=" + String(result));
+
if (result != 0)
{
if (auto* cnv = parent->getCurrentCanvas())
{
cnv->attachNextObjectToMouse = true;
+ } else {
+ parent->pd.logMessage(String(__FILE__) + ":" + String(__LINE__) + ":" + String(__FUNCTION__) + ": Can't get canvas");
}
}
});
diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp
index 9f707db..b29e0ad 100644
--- a/Source/PluginEditor.cpp
+++ b/Source/PluginEditor.cpp
@@ -781,6 +781,8 @@ void PlugDataPluginEditor::getCommandInfo(const CommandID commandID, Application
case CommandIDs::NewObject:
{
+ pd.logMessage(String(__FILE__) + ":" + String(__LINE__) + ":" + String(__FUNCTION__) + ": CommandIDs::NewObject");
+
result.setInfo("New Object", "Create new object", "Objects", 0);
result.addDefaultKeypress(78, ModifierKeys::noModifiers);
result.setActive(pd.locked == var(false));
@@ -795,6 +797,8 @@ void PlugDataPluginEditor::getCommandInfo(const CommandID commandID, Application
}
case CommandIDs::NewBang:
{
+ pd.logMessage(String(__FILE__) + ":" + String(__LINE__) + ":" + String(__FUNCTION__) + ": CommandIDs::NewBang");
+
result.setInfo("New Bang", "Create new bang", "Objects", 0);
result.addDefaultKeypress(66, ModifierKeys::noModifiers);
result.setActive(pd.locked == var(false));
When I open the menu, by left or right clicking the +
, I see invocations for
- Source/PluginEditor.cpp:781
- Source/PluginEditor.cpp:800
- (and probably all the other rmenu items)
followed by Source/Dialogs/Dialogs.cpp:113 with a popup result of=0 after I left or right clocked the menu item.
I also added some logging to createCommandItem() in Dialogs.cpp and there I get non-zero itemIDs. So I am not sure where the menu item id is lost.
FYI: https://github.com/timothyschoen/PlugData/blob/main/Source/Dialogs/Dialogs.cpp#L72 looks fishy, the if and else branch are the same.
from plugdata.
Thanks Stefan!
Nice catch about the if-statement btw, it's a bit of modified JUCE code, I think I changed the thing that made the branches unique at first ;)
createCommandItem is not actually performing the action, it only registers the action and updates the state of the action.
I'd be interesting to see if "pd.locked == var(false)" returns true here, if it doesn't that's obviously a problem.
In function "perform", Source/PluginEditor.cpp:903, the action will get performed. I wonder if you get a log message there, but I assume not.
The fact that it returns 0 in the callback is telling though: almost like clicking the popupmenu makes it lose focus instead of triggering it.
from plugdata.
I added a
if (parent->pd.locked == var(false))
{
parent->pd.logMessage(String(__FILE__) + ":" + String(__LINE__) + ":" + String(__FUNCTION__) + ": not locked?");
}
to createCommandItem() in Dialogs.cpp and no warning shows up, which I take as a good sign. I have been searching the net a bit, but can't find anything obvious why result would always be 0. I think your hunch could be right that for some reasons the focus has been lost and juce believes I clicked outside of the menu.
Any idea how we can verify this?
from plugdata.
But the the right-click menu on canvas does work right? Odd, because it's the same thing. I could try to make all these menus non-modal, that might help.
What distro are you on btw? I'll install it in a VM to see if I can reproduce it like that.
from plugdata.
Good point, just tested. I created an object using 'n' key and then used the context menu to try to copy and paste and this does not work either (ctrl-c, ctrl-v works though).
I am using opensuse tumbleweed (https://get.opensuse.org/tumbleweed/) using the default gnome desktop (on wayland). I just tried under X11 and there it works, so it looks like there is a JUCE incompatibility with wayland :/
from plugdata.
Thanks for figuring that out, looks like I won't be able to fix this :(
from plugdata.
Related Issues (20)
- GEM Library is crashing when creating a window (Plugdata version 0.8.3, GEM version 0.94) HOT 4
- Bug: unable to build due to undefined reference to `scope_tilde_setup' HOT 1
- Develop `Branch` - Mouse Position Issue HOT 5
- Plug Data (Standalone or plugin versions) don't open on some apple silicon macs after crash HOT 2
- PlugData 0.9.0 nightly built, can't open [oscope~] from Show Object Browser HOT 2
- Number box doesn't show numbers HOT 11
- Switch focus to newly opened patch HOT 1
- keyboard gets inactive while clicking and holding HOT 1
- [Feature request][External] ReacTIVision TUIO client HOT 2
- [bug] patch that is closed still running in the background HOT 5
- [feature] Implement the note on/off "extra byte" for microtuning HOT 11
- [0.9.0-test] The color of object's name is not updated after switching themes. HOT 3
- [bug} Settings and Compile menus make entire program stuck "on top" HOT 3
- [bug] file dialog doesn't close when compile dialog is closed HOT 3
- wont run on ipad air 1st gen ios 12.5 HOT 3
- Button widget doesnโt respond to Toggle message HOT 4
- GEM getting error while creating a window inside Cubase
- Rendering / Disabling Track / Exporting VST3 HOT 6
- [bug] palette menu renders below canvas
- Internal GM Synth outputs weird noises
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plugdata.