gitbutler icon indicating copy to clipboard operation
gitbutler copied to clipboard

Can't open , after closing the app - Ubuntu (gnome)

Open oussamaeljabbari opened this issue 1 year ago • 6 comments

Can't open the app after closing, until I close it from the tray icon and open it again

Ubuntu: 22.04.3 Gnome: 42.9 WM: Wayland

Screencast from 02-13-2024 05:13:23 PM.webm

oussamaeljabbari avatar Feb 13 '24 17:02 oussamaeljabbari

I have the same problem under arch 6.7.4, i3 4.23, X11 21.1.11.

When clicking on the tray-icon and on Show gitbutler, if i have GB open, it closes. If it wasn't open, nothing happen

Legrems avatar Feb 13 '24 18:02 Legrems

I am also facing the same issue in ubuntu 22.04, gnome default.

Once i one the app for the 1st time it works fine but as soon as i close, then it wont open the 2nd time.

shrutsureja avatar Feb 14 '24 18:02 shrutsureja

Actually, as it turns out, GitButler is running in background, and user should be able to open it from system tray. The issue is:

  1. There is no system tray icons at all in Gnome.
  2. It is not launching from tray icon in other DE as well. But we can simply close it and open a new instance, if there is a Tray Icon

How it should be fixed:

  1. System Tray Icon should be fixed.
  2. If a user launches the Gitbutler again, while it is in hidden state, it should come to the visible state again.

( 2nd point seems tough to implement I guess )

namanlp avatar Feb 14 '24 21:02 namanlp

I had the same issue but it was because a bug happened first #2725 - speaking about it in Discord, I was pointed here and turns out I hadn't realised there was a tray icon due to it being practically hidden on dark mode in Ubuntu 22.04.3.

With dark mode this is what the icon looks like (hint: its between the emoji gnome-shell extension and jetbrains toolbox): image

Hover over it shows it a little bit better: image

I think the icon should either be designed to work in both light/dark themes (note: I'm using the default Ubuntu dark theme) or have alternate versions displayed depending on the detected theme.

I know gnome has a command-line way of detected the user's preference which is:

gsettings get org.gnome.desktop.interface color-scheme

Which will output either:

  1. default
  2. prefer-dark
  3. prefer-light

e.g. image

So it might be worth utilising that (if gsettings exists) to poke it. There might also be a way to get the setting somehow elsewhere in .local possibly or .config - but I'm unsure about that.

hazrpg avatar Feb 15 '24 15:02 hazrpg

I think the best solution to this issue would be to provide a system wide option for the "Close to tray" function.

When enabled, closing the window would keep the process running in the background and allow the window to be re-opened via the tray icon. Ideally it should also open a window to the existing process if the user attempts to open a second instance of GitButler.

When disabled, closing the window would also kill the background process.

KroniK907 avatar Feb 15 '24 21:02 KroniK907

Looking into the code, it appears that this behavior originates here:

https://github.com/gitbutlerapp/gitbutler/blob/f084b6bcf79266b075877dda3f0943f3c4d54c85/gitbutler-app/src/bin.rs#L60-L64

Tauri Docs on this behavior are documented here: https://tauri.app/v1/guides/features/system-tray/

KroniK907 avatar Feb 15 '24 21:02 KroniK907

I found a fix for this issue 🎉

I will create a PR after code cleanup.

namanlp avatar Feb 19 '24 08:02 namanlp

Issue Summary: When I close GitButler and attempt to reopen it by clicking on the system tray icon, the application fails to appear on the screen. I have to quit the application entirely and relaunch it to use it again.

Steps to Reproduce:

  1. Open GitButler.
  2. Close GitButler by clicking the "X" button.
  3. Attempt to reopen GitButler by clicking on the system tray icon.

Expected Behavior: GitButler should reopen and appear on the screen when clicked on from the system tray.

Actual Behavior: GitButler does not appear on the screen when reopened from the system tray. It requires quitting and relaunching the application to use it again.

Additional Information:

  • Operating System: [Ubuntu 22.04 LTS]
  • GitButler Version: [0.10.9]

Screencast from 19-02-24 07:56:30 PM IST.webm

pravinkori avatar Feb 19 '24 14:02 pravinkori

The issue still happens even after upgrading to ./git-butler_0.10.13_amd64.AppImage

mnecas avatar Feb 21 '24 10:02 mnecas

I can also confirm that the AppImage on both Ubuntu and Fedora still have the issue of the process not being killed when the window is closed.

KroniK907 avatar Feb 21 '24 19:02 KroniK907

I'm facing the same issue, my OS is Linux Mint 21.3 x86_64 MATE.

When i close the app it stay runs in the background like as a trail-icon waiting for be activated, but i don't have trail-icons showing, click in the gitbutler icon for open again not works.

The solution for me now is close all process about gitbutler and re-run the app.

https://github.com/gitbutlerapp/gitbutler/assets/97265556/d45e59b4-bdda-4947-87d9-6d317317d422

LopesLs avatar Feb 21 '24 22:02 LopesLs

Yup the https://github.com/gitbutlerapp/gitbutler/pull/2861 did it, thank you!

mnecas avatar Feb 26 '24 08:02 mnecas