-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Surge OkCancel dialog not shown in Linux, preventing re-saving preset #749
Comments
This is actually kind of a dup of #562 - the linux user interactions are not implemented. When i stubbed them in to get the port going I made OK Cancel choose “cancel” which is a conservative choice. I could be convinced to switch it to OK because of the behavior here. The save dialog is really the only place OK cancel issued in earnest. So if you want to change it to return OK in src/Linux/UserInteractionsLinux.cpp I would be OK to merge that (and we could then close this issue and focus on #562) But the real answer is for someone to implement those user interactions. @jsakkine had threatened to look at it one day. |
Both options, defaulting to cancel and defaulting to ok cause data loss. Defaulting to cancel will cause them more often, but defaulting to ok will more likely to cause loosing some preset you don't remember anymore how to create it. Bit hard to pick which of these is worse. |
Yeah I agree. The best thing is to implement that dialog on linux. but that's tricky. Like I said: the only place the dialog is used right now is in the save chicken box so I'm OK for it to default to OK with a comment for now. I think it is more likely you would click OK than Cancel if the dialog appeared. But really your choice. Why not chat with @tank-trax who also has done a lot of linux testing and stuff and if you guys agree I'm fine with a change. |
I'll finish the things that I have in WiP ATM (wavetable work and ARM to be exact). If this is still undone after that, I can push it further. I know it is high priority but I do not want to cumulate anymore unfinished tasks. |
I think the hard part is gonna be that since Linux kinda isn’t a desktop os api set like Mac and win are, the implied modal dialog in ok cancel is going to be hard to port. Moving ok cancel to a callback structure may be how we have to do this which could be a bit painful at this point in the code path |
@baconpaul, It could be engineered with a bit of a stretch: fork a process to show the dialog and use the exit code for that process to IPC the interaction. To make it clean we would it'd be better to have a So yes doable with some stretch :) But yeah, do not want to start with that before landing my previous items. |
@baconpaul, If we had |
@jsakkine Check out https://github.com/GNOME/zenity |
Title and message are the arguments - just two strings. And either present a choice or ok cancel or just an ok |
https://github.com/KDE/kdialog Seems like a kde version of same. It actually implements the curses dialog command line so is super easy to fork Wonder if there is a way for the deb file to figure out which dependency to add. So “if you are kde add dep a; if you are gnome add dep b” But don’t think we need to write a forkable dialog. Good thought @tank-trax In and remember @jsakkine - it’s vfork not fork :) |
If fact if you read http://www.linux-magazine.com/Issues/2009/99/Zenity-and-KDialog It seems that either kdialog or Zenity will be installed. So I propose we check for one then the other in the path and fork accordingly. The fork/waitpid will hang the ui thread but the audio thread should still keep going. So it’s at least an improvement. I’m gonna add a comment to #562 also |
Oh and I typed @tank-trax and should have said @tavasti !! Oops sorry folks. |
@tavasti, @baconpaul: not supporting that solution. GTK would be a weaker dependency in the end. Practically all KDE based systems have GTK installed. If I want to scale down to a BuildRoot image, I would have to compile enormous amount of dependencies compared to plain GTK. It pulls in half of Gnome in. I would probably give up with the ARM work at this point if we do this because things don't scale nicely down anymore. |
It is like going from bad to worse: everybody has GTK installed and still we want to add KDE and/or GNOME to the stack. This is not going to work out well. |
Zenity is installed in my ubuntu 18 |
Also why does this change buldroot? We’re suggssting vfork Type thing |
Basically: I think @tavasti was suggesting fork this for the implementation of promptError and then waitpid it rather than writing our own thing. And if zenity isn't installed, kdialog will be; and if neither is installed fall back to cerr. |
So: Do exactly your proposal; but don't roll our own |
Vim is installed on my system but we do not require Vim do we? Being installed in your system is not an argument. |
@baconpaul, Just look at How have you verified that XFCE, Enlightenment, i3 etc. desktops have either installed? You rely on a random application based on a 10 year old article instead of a library that exists practically in all Linux installations. |
I'm not saying my solution is great but at least it is sustainable. If you want to look for alternatives, maybe they can be found from other plugins. Would not hurry with the implementation. Doesn't VSTGUI have any support for dialogs? |
There is no even build recipe for BuildRoot for Zenity, which does not come to me as a surprise. BuildRoot does not support the use of Zenity at all right now. If I this easily bump into environment that does not support the approach, how likely do you think that others will not? |
Whatever you guys like. Right now linux users can’t save a patch twice. So we can improve that immediately. If zenity isn’t there you could fall back to current behavior and have basically ever active user get desired behavior in 20 lines of code. I didn’t say require zenity. I said if it is there use it. But hey I use Mac. You guys figure out if saving patches is a feature Linux users need or not. I’m happy to review changes if you have em and would merge an if zentity fork else stderr diff |
OH and tp amswer upper other question: VSTGUI doesn't have dialogs. Has some modal support but it is flaky.What you could do is copy CAboutBox to cover the entire UI with a dialog, draw it with vstgui, and then turn the code into callback style rather than modal style. That's probably better than writing your own subordinate process from scratch - less work I think. Basically just follow the CAboutBox example. |
@baconpaul, this is not really a question what I like or do not like. Using Zenity will not work at all. I would have to stop ARM work completely if we choose that just to name an example. I guess CControl is worth of pursuing... |
OK, it seems I have to postpone my other PRs. because this cannot really go like this. I'll try to get something available with next couple of days. |
I’m not sure why checking if Zenity is in your path would break ARM. ARM machines can check their path for an executable right? |
Also: Tjhere’s no rush here. If we just change the default to “OK” then it means you can save but you don’t get a chicken box at overwrite. I think rather than dropping stuff I would change to OK for now. Moving to CDialog is going to have changes which modify code on mac and win also. It’s not easy (again because of modality). |
Oooh actually I just had a clever idea about implementing this using exactly the about box. I'll update the other issue. Here's what I propose
|
Oh and my first item takes some of the time pressure off this issue, @jsakkine |
OKCancel is only used to chicken box overwritign a patch. Neither default is great, but chosing OK means at least the user action is not silently ignored. Closes surge-synthesizer#749 Will be greatly improved by the correct implementation of surge-synthesizer#562
@baconpaul, well I build my test images straight from the source code and build recipe for Zenity does not exist in BuildRoot. I cannot build binary for Zenity. And by requiring Zenity you enfornce people who use lightweight desktops to install half of GNOME libraries rather being fine with the GTK DLL that they already have installed. Do we want to enforce people to install huge portion of the desktop that they don't use? Especially in audio production I'd go for lightweight desktop to minimize the side-effect in a studio environment, and if Surge required me to pull enormous GNOME dependencies I would ignore the whole plugin. You are looking at just Zenity and not its dependencies. That is where the dilation comes from. |
I understand your point fully @jsakkine - just you are missing mine! We could - right now - write code which looks like this
then you don't have to install it at all. All the conversation about "if zenity else if KDialog else if fall back" I feel like either I'm not saying loudly enough or you aren't hearing! I was never suggesting requiring gnome. Just using it if you happen to have it! (and KDE if you happen to have that). And I was assuming that all of our users today have either gnome or KDE so the only person who falls into the cerr if is your ARM port. So everything would just work. See? |
OKCancel is only used to chicken box overwritign a patch. Neither default is great, but chosing OK means at least the user action is not silently ignored. Closes surge-synthesizer#749 Will be greatly improved by the correct implementation of surge-synthesizer#562 Former-commit-id: ce10a4c1ba842ddc8fa92654c9505f53133db58d [formerly ee8dcca] Former-commit-id: 3d535d44f84c4fd994dbd5696470b259bc276af9 Former-commit-id: bb6df1148a16c417842da807e30636e3c8f5b626
Describe the bug
When saving preset again with same name, it will fail silently. If using Surge with Ardour, I can see on console:
To Reproduce
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: