Giter Club home page Giter Club logo

Comments (34)

diovudau avatar diovudau commented on June 14, 2024

I just added seq66 to the Agordejo internal database.
I noticed that seq66 does not have the hide/show NSM toggle yet. That is a very useful feature to have.
For qt mainWindow.hide() is often enough for this.

Once implemented this bug report becomes actionable. If you intercept Qts closeEvent and just hide the window instead it is done.
The real quit is then only when nsm sends the quit osc message.

see also:

https://new-session-manager.jackaudio.org/api/index.html#_close_as_distinguished_from_quit_or_exit

Quit or Exit
[...] When the client supports :optional-gui: this option SHOULD be replaced with hiding the client’s GUI so a quit by window manager hides.

from seq66.

ahlstromcj avatar ahlstromcj commented on June 14, 2024

from seq66.

diovudau avatar diovudau commented on June 14, 2024

Using the NSM protocol the user has functions like "hide all session clients".

And more important: The session becomes robust. Accidental closing of the software will not happen anymore, the program will just be hidden. This mimics the same as plugins in a DAW. If you close their GUI window they still run.

from seq66.

diovudau avatar diovudau commented on June 14, 2024

For an example of a usecase have a look at my program Patroneo:

  • When added newly to a session it starts hidden, so it does not get in the way.
  • It can be shown/hidden through NSM
  • It saves its own visibility status in its session save dir and restores it on startup
  • When you close the window via the window manager (Alt+F4, [X] Button etc.) it NSM-hides instead.

This is a very solid and robust user experience and also the NSM API recommendation. Again, it mimcs the workflow of a DAW plugin.

One of the worst experiences the user can have is to open a session it sudden 5 or more windows open (with slight delay each) and you have to manage them all manually afterwards. Or even worse: with a tiling window manager and everything consists just of small rectangles :)

from seq66.

ahlstromcj avatar ahlstromcj commented on June 14, 2024

from seq66.

ahlstromcj avatar ahlstromcj commented on June 14, 2024

from seq66.

diovudau avatar diovudau commented on June 14, 2024

Sorry for the late reply.

I've got the basics done: tell NSM about "optional-gui", respond to its command to hide, and tell it when the user has toggled visibility [I added a MIDI control and annunciation for toggling visibility, which works fine outside of NSM]. So I start the session,

Very nice :)

Seq66 pops up for an instant, then disappears.

I assume this is coming from the cirucmstances that you had to integrate hiding after the program existed for years. I think this is a very acceptable outcome.

However, when the user toggles it back on, it disappears again.

This sounds like a bug. I am currently compiling to have a look myself. But maybe it is connected to the next issue:

Also, in the NSM UI, I don't see a way to hide, just close and resume And I don't see a way to have NSM keep the GUI open via the UI.

Are you reporting :optional-gui: in your client capabilities when doing the NSM announce handshake? See the table at https://new-session-manager.jackaudio.org/api/index.html#_announce

If Close means only to hide, then is the only way to exit Seq66 to stop the session? The NSM documentation may have a couple of holes in it, at least as far as this humble programmer can tell. Any clarifications you can make would be most welcome! Thanks!

You can stop any NSM client from the NSM-GUI individually. You said it yourself above: "close".
You can offer as many internal options to close seq66 as you want. All my programs have a main menu point Quit, but without a shortcut (if run in NSM mode).
The point of rerouting the usual ways to "Quit" to "Hide" is to prevent accidental closing. The main cause it the window manager, hence overriding Qts mainWindow CloseEvent. You don't have to go overboard. If someone sends a SIGNAL they know what they are doing.

from seq66.

ahlstromcj avatar ahlstromcj commented on June 14, 2024

I have a fix for Seq66 not showing or hiding upon command pending in the 0.97.3 in the "optimizing" branch. However, the main reason that feature was broken was because agordejo and its non-session-manager reimplementation do no send a Hide command, as I believe the original NSM author documented. They send only a Show command. So my work-around is to use the Show command as a toggle. I will probably check the code in later tonight.

from seq66.

diovudau avatar diovudau commented on June 14, 2024

Please tell me the steps to replicate, because I believe you are mistaken. The show/hide code in New-SM was not touched, compared to Non-SM, and it is dead simple to use. Every other program hides properly.

from seq66.

ahlstromcj avatar ahlstromcj commented on June 14, 2024

from seq66.

falkTX avatar falkTX commented on June 14, 2024

What is the confusion here? "optional-gui" is a capability string the nsm client reports to the nsm server.
When that is present the nsm server will call the show/hide optional gui things as expected.

Is the question about the initial state that the GUI should have? If yes, this was simply undefined before.

from seq66.

ahlstromcj avatar ahlstromcj commented on June 14, 2024

from seq66.

falkTX avatar falkTX commented on June 14, 2024

The NSM documentation and the NSM code specify hide_optional_gui and show_optional_gui, with callbacks for both.

How does that contradict "No response to the message is required." ?

Still not seeing the issue here, please be more clear.

from seq66.

ahlstromcj avatar ahlstromcj commented on June 14, 2024

from seq66.

falkTX avatar falkTX commented on June 14, 2024

The issue is new non-session-manager re-implementations providing only the "show" message

Please clarify where you saw this, thanks.

from seq66.

ahlstromcj avatar ahlstromcj commented on June 14, 2024

from seq66.

falkTX avatar falkTX commented on June 14, 2024

I already stated that... In the documentation in the NSM project. And existing functions in its code. Please move on.

With all due respect, no.
I take this as critical issue, if something got broken like this it is critical that it gets resolved. So I want to get to the bottom of the situation here.

Documentation at https://new-session-manager.jackaudio.org/api/index.html still says the same as before.
Both show_optional_gui and hide_optional_gui are mentioned.

nsmd still provides both https://github.com/jackaudio/new-session-manager/blob/e90fa99a5b94f9a93cf209003aad486a37bea07c/src/nsmd.cpp#L2641

the fltk/original gui still has code for both https://github.com/jackaudio/new-session-manager/blob/e90fa99a5b94f9a93cf209003aad486a37bea07c/src/nsm-legacy-gui.cpp#L293

I really, really would like some collaboration and clarification here please.
You do not have to reply now, but do please clarify the issue you noticed when possible. Thank you.
I mean with actual references to the code, since you stated:

new non-session-manager re-implementations providing only the "show" message

These new reimplementations still need to be fixed. But I do not know/understand which one(s) you are referring to in particular.

from seq66.

ahlstromcj avatar ahlstromcj commented on June 14, 2024

from seq66.

falkTX avatar falkTX commented on June 14, 2024

You should have mentioned agordejo from the start haha, thanks for clarifying.

I dont see here anything being inherently broken. from what I understand the gui-button on agordejo is a really a "show gui" trigger, not a show/hide toggle. but @diovudau can clarify
could be 100% intentional, why not

Different applications can work in different ways, nothing wrong with that.
The old fltk-based NSM GUI is still possible to build and run and use, that is not going away.

from seq66.

ahlstromcj avatar ahlstromcj commented on June 14, 2024

from seq66.

falkTX avatar falkTX commented on June 14, 2024

there are mirrors out there like https://git.kx.studio/non/non or https://github.com/linuxaudio/non in case the https://github.com/jackaudio/new-session-manager/ repo is not good for some reason. very sad that we cannot use the original repo anymore.
that said, good night!

from seq66.

diovudau avatar diovudau commented on June 14, 2024

To summarize and finally clarify. Nothing in either New-Session-Manager or Agordejo is broken or different:

  • The server nsmd and the documentation ("API") of "New Session Manager" are in all things equal or superior to the old Non Session Manager. Nothing was ever left out; only clarified, added or fixed. The code is not a re-implementation but a fork, starting from an exact copy.
  • Agordejo is a GUI that controls the nsmd server. Seq66 and other clients to not know if they are controlled through Agordejo, commandline instructions or other matters. Everything comes from nsmd.
  • Agordejo has a right-click client context menu that is duplicated in the actual menu. There you can find the command "Toggle Visibility", which is in fact a toggle and hides/shows as instructed. Additionally there is a tray icon for Agordejo that offers the very same toggle as well as "show all clients" and "hide all clients" which do what they say.
  • As written in the Agordejo manual a double click on a client will toggle show/hide as well.
  • There is no "GUI" button (what @ahlstromcj said) in the whole program. The "GUI" button is part of the old legacy nsm gui. Which also works as toggle, btw.

from seq66.

diovudau avatar diovudau commented on June 14, 2024

here In arch it is easy to build the optimizing branch. If you remove the "use show as toggle" hack I can have a look at the actual behaviour.
I just tried it myself but there is also a crash on save so I can't comment on all your other github issues regarding NSM. If you come to irc libera #lad we can talk there in realtime (CET Timezone), that would make things easier.

from seq66.

ahlstromcj avatar ahlstromcj commented on June 14, 2024

from seq66.

ahlstromcj avatar ahlstromcj commented on June 14, 2024

Also, if you have weird issues after pulling and rebuilding, do this to remove kruft and start again:

./bootstrap --full-clean
./bootstrap -ed # --enable-debug
make ....

Or you can create a shadow directory and use qmake via the qbuild script in contrib/scripts:

qbuild debug rtmidi

(I had to create that process because for a long time the debug autoconf build was broken at link time and it took me a long time to figure it out.)

from seq66.

ahlstromcj avatar ahlstromcj commented on June 14, 2024

from seq66.

diovudau avatar diovudau commented on June 14, 2024
  1. Agordejo has nothing to do with anything in this feature request or the seq66 problems. It is just a GUI for the nsm-daemon nsmd. Let's leave that out to make things easier

  2. What you are using is the FLTK gui which binary is named "nsm-legacy-gui" and symlinked to e.g. "/usr/bin/non-session-manager"

  3. The FLTK GUI provides a toggle button with a color changing "LED" for each client that has :optional-gui: in it's capability string. seq66 has that button available. As comparison so has e.g. carla-rack or patroneo. You will see that for the last two programs the LED is either on or off, depending if the client is shown or not.

If you click on this toggle button, depending on the current GUI state of the client, nsmd will either send show or hide. The console log message, defined by old NSM is "Sending hide/show GUI.". This is specified in https://new-session-manager.jackaudio.org/api/index.html#_show_optional_gui
The message that the server will send to seq66 is either /nsm/client/show_optional_gui or /nsm/client/hide_optional_gui.
The legacy GUI has no epxlicit show/hide but just a toggle button that send show/hide depending on the last reported client state (see below)

The client (seq66 etc.) then has to send an answer about it's current GUI state. The message is given here:
https://new-session-manager.jackaudio.org/api/index.html#_client_to_server_informational_messages

It is either /nsm/client/gui_is_hidden or /nsm/client/gui_is_shown

The client state is always known because, as the API dictates, [the client] also MUST send this message after its announce message to indicate the initial visibility state of the optional GUI.. Therefore each clients starts with a known state and each change is announced through the client->server messages gui_is_hidden and gui_is_shown.

Seq66 is not sending any of these. Therefore the server does not know what state your gui is in. The "LED" will always be off and the button will always send "show" because you never reported that you were visible.
Instead seq66 replies to the server messages with "Show OK" which is not in the API and means nothing. In fact the API says that the server instruction to show/hide the GUI: This message does not require a response.

Your next steps should be to remove the "Show OK" reply and send the required messages. You also have to send this message once after the announce message and you have to send it every time the GUI visibility changes from within your client. e.g. if you intercept the Windowmanager or Qt CloseEvent to replace quit with "hide gui", as reccommended by https://new-session-manager.jackaudio.org/api/index.html#_quit_or_exit

from seq66.

ahlstromcj avatar ahlstromcj commented on June 14, 2024

from seq66.

ahlstromcj avatar ahlstromcj commented on June 14, 2024

from seq66.

diovudau avatar diovudau commented on June 14, 2024

This is when a client is first added to the session. It is not a MUST but SHOULD. It is nice to have because then the very typical session-creation with adding multiple programs in quick sucession does not become that painful because so many windows get opened automatically. Especially for tiling window people.

from seq66.

moonshaadow avatar moonshaadow commented on June 14, 2024

Hi there @ahlstromcj,
First, thanks for the good work to implement nsm features.
According to my user experience, I think that it could be better to hide on closing window, rather than to quit. Just like plugins behavior in a DAW.

  • Seq66 gui could be on top of session manager gui, so the show/hide button is not immediately visible ,
  • as said before, it prevents for an accidental quit .
  • It it close to most of nsm clients behavior, I think it's a good idea to harmonize it

from seq66.

ahlstromcj avatar ahlstromcj commented on June 14, 2024

Man, I fixed a raft of bugs and boners along the way! It should work now; so many things to test! Let me know of any remaining issues. Thanks again!

from seq66.

ahlstromcj avatar ahlstromcj commented on June 14, 2024

from seq66.

ahlstromcj avatar ahlstromcj commented on June 14, 2024

Just re-verified that hide/show still works, so closing it now.

from seq66.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.