Skip to content
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

Clicking the close button should minimise to tray [$5] #144

Open
hellocatfood opened this issue Nov 20, 2013 · 23 comments
Open

Clicking the close button should minimise to tray [$5] #144

hellocatfood opened this issue Nov 20, 2013 · 23 comments
Labels

Comments

@hellocatfood
Copy link

On Ubuntu Smuxi has an entry in the messaging menu. It should make persistent use of it by allowing Smuxi to remain open but minimised to the tray icon.

There is a $5 open bounty on this issue. Add to the bounty at Bountysource.

@meebey
Copy link
Owner

meebey commented Mar 31, 2014

Is this issue about closing the window and Smuxi quits or clicking Smuxi in the messaging menu will start another instance?

@hellocatfood
Copy link
Author

It's about closing the window and Smuxi quits

@meebey
Copy link
Owner

meebey commented Apr 3, 2014

That is already supported then. See preferences interface notfications.

On Apr 3, 2014 12:47 AM, "Antonio" [email protected] wrote:

It's about closing the window and Smuxi quits


Reply to this email directly or view it on GitHub.

@hellocatfood
Copy link
Author

Maybe what I'm describing is something different. When I click X on the Smuxi window I am disconnected from chats. When I click on the Smuxi icon the window appears and I am reconnected.

I want the former. It is similar to how Banshee continues to play music even if the window is no longer open

@meebey
Copy link
Owner

meebey commented Apr 14, 2014

Have you changed the setting in Preferences -> Interace -> Notification -> Notification Area Icon -> Enable, Select "Show when window is closed"?

@hellocatfood
Copy link
Author

Hi meebey

I think I'm either not using the right terminology to describe what it is I'm requesting or there is some other misunderstanding. I've made this video to explain what I'm after https://www.youtube.com/watch?v=GSm4szuuI00

@knocte
Copy link
Contributor

knocte commented Apr 18, 2014

So I guess the real feature request here is Smuxi-instance detection, @meebey didn't you already have this implemented via DBUS?

@meebey
Copy link
Owner

meebey commented Apr 18, 2014

@hellocatfood thank you for making that video. Now it is very clear what this request is about. The solution is called single-instance support. When Smuxi starts it needs to check if another instance is present, if so, bring that instance to the front and terminate the 2nd launch.

@meebey
Copy link
Owner

meebey commented Apr 18, 2014

PS: the close to tray feature is working here, but you would need to restore the already running Smuxi by using the tray icon, not the application launcher. This is indeed not very intuitive and needs to be fixed, as you requested.

@mehdisadeghi
Copy link

I have the same issue even though I use the messaging indicator and it seems to be broken in ubuntu 14.04 because it brings up a new instance and not the old one. So currently there is noway to bring up your previouse instance.

@meebey
Copy link
Owner

meebey commented May 3, 2014

@mehdix you can bring back the existing instance using the unity launcher. You can't restore the existing Smuxi instance via the messaging menu because of a feature regression of the messaging menu, see: https://bugs.launchpad.net/indicator-messages/+bug/1065732. A closed window can't be restored from the Unity launcher that is correct.

Smuxi should probably default to close to gtk tray icon with the messaging menu and implement single instance support via IPC in the long term.

@mehdisadeghi
Copy link

Just to be more precise, when I click x button on main window the icon in the unity launcher is gone (even if I lock it to launcher it will bring up a new instance). In the messaging menu I see smuxi's icon and a small arrow on the left side of it that shows the app is running in the background but clicking on it doesn't bring it up, instead it opens a new instance. After repeating a few times when I check system monitor I see many mono instances dangling out there and I should finally issue

killall mono

to get rid of them.
Moreover, if you could put more explanation on the architecture of your application it would be easier for others to figure out how to contribute, since I downloaded the code and built it but with out a design guide it takes a while to understand what is going under the hood.

@mehdisadeghi
Copy link

@meebey
Today I did a research on this topic and as I see there is no proper support for ipc in mono. People are taking different approaches such as creating files ans watching them, using unix domain sockets or detecting platform and the using whatever works there. Some people even iterate over process list to see if their process is still running. However, none of the above solutions are cross platform. Which approach could we take to fix this?

I also tried different ideas to see how they work. First I tried to find a proper ipc solution which I mentioned earlier. Then I though maybe we could make a separate app-indicator for Ubuntu (since I use it) and keep a reference to the application and then open the existing instance. One other approach was running smuxi in a separate process and keeping its pid, but then I didn't know how to bring up smuxi's window only with its pid.
Then I tried Gtk plugs and sockets. In this case we can embedd smuxi (which uses Gtk) inside another Gtk window. But then I didn't know how to open smuxi programmatically and get the window ID as it is required for embedding.

After tweaking these solutions for a few hours I would say above solutions need some tweaks in smuxi. For example supporting either dbus or providing an API to run smuxi inside another Gtk app.

What do you think?

@meebey
Copy link
Owner

meebey commented Apr 2, 2015

Thank you for your insightful analysis. It matches my findings and conclusions. And I have some good news on this issue, I have written an abstraction for cross-platform single-instance
support, the code (b6f538d) is already in the master branch but the GNOME frontend does not use that yet. The frontend code is already in a branch but not merged. Odd I can't find this branch on github so maybe I forgot to push that branch. The reason I haven't merged it yet is that I believe my implementation has bugs, since the code has critical sections and I am not sure if I avoided all race conditions.

@meebey
Copy link
Owner

meebey commented Apr 2, 2015

I will push the single-instance frontend code when I am home

@mehdisadeghi
Copy link

Great, looking forward to getting the new code and testing in on Ubuntu.

@mehdisadeghi
Copy link

Hey @meebey,
Could you please push your branch then I can use your frontend implementation and merge it locally for myself to see how things work.
Thanks.

@meebey
Copy link
Owner

meebey commented Apr 5, 2015

Ups sorry, I forgot about it :-D I invite you to join #smuxi-devel @ freenode that is where the devs hang around :)

@meebey
Copy link
Owner

meebey commented Apr 5, 2015

ok I have found the code and didn't even commit it because there is the issue of how can you still open a 2nd instance of Smuxi if you need/want that. I checked other applications for parameters and it seems like there is no standard to do this :( maybe any parameter is sufficient then...

@meebey
Copy link
Owner

meebey commented Apr 5, 2015

@mehdisadeghi
Copy link

Thanks! 👍 I will check devel channel soon. Actually that's why I need a working irc app which gets out of my way but stays tune...

@hellocatfood
Copy link
Author

I've seen that version 1.0 has instance detection but when I close (with the x button) and reopen smuxi I'm disconnected/reconnected to the server. Is this by design?

@meebey
Copy link
Owner

meebey commented Dec 29, 2015

Well the default behavior hasnt changed since single application instance support was added. For Unity Smuxi should do the 'closing main window will leave Smuxi running in the background' thing but for GNOME it needs to be opt-in as per HIG.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants