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

Systray 2 #166

Merged
merged 7 commits into from
Oct 21, 2023
Merged

Systray 2 #166

merged 7 commits into from
Oct 21, 2023

Conversation

StevenDoesStuffs
Copy link
Contributor

@StevenDoesStuffs StevenDoesStuffs commented May 8, 2023

Description

Same as #128, but with changes stolen from greentore#1.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

@github-actions
Copy link

github-actions bot commented May 8, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@StevenDoesStuffs
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

1 similar comment
@serxka
Copy link
Contributor

serxka commented May 8, 2023

I have read the CLA Document and I hereby sign the CLA

@serxka serxka mentioned this pull request May 8, 2023
9 tasks
@StevenDoesStuffs
Copy link
Contributor Author

Now that I'm actually using this, I've got two ideas:

  1. There needs to be a way to toggle the systray. From what I can tell, the desktop app is just a wrapper around the webapp, so putting that toggle in the GUI sounds difficult. Maybe a --tray arg? But then we need multiple .desktop files :/, and that also means we have no way of storing the setting.
  2. Usually with systray apps, there's some sort of minimize on startup. Same difficulties as above apply.

Any ideas on how to deal with those issues? I don't really know much about tauri so maybe there's a feature here that could help.

@daegalus
Copy link

daegalus commented Aug 25, 2023

So I have been patiently following along for any sort of tray icon support because using Cinny on Desktop without it has been annoying.

I just wanted to chime in and suggest that we don't scope creep.

Is it absolutely necessary to toggle or configure the system tray at this point in time? System tray things can be hidden or ignored at the window manager level. It is not super urgent to get it in this PR, maybe it can come in a second PR later.

To answer your questions @StevenDoesStuffs

  1. Maybe at first put the toggle in a menu of the desktop wrapper? you can have it automatically hidden, pressing ALT can show it. Its how most desktop chat apps behave. Slack, Discord, Webcord (which is just a custom wrapper around web discord for better compatibility). Because you are correct, that to make a nice toggle, you need to use the provided Tauri/Javascript interop facilities to call functions on the rust side from the JS side (webapp). This would mean that there will need to be a bit of JS code in the webapp that checks for Tauri or desktop mode (could be a global variable that defaults to false, but set to true by Tauri. That then surfaces a toggle. Here is documentation on how to call rust from the frontend: https://tauri.app/v1/guides/features/command
  2. Minimize on startup can be done purely through Tauri/Rust side of things. The Desktop portion of the app can have it's own config file, or it can read a shared config file with the webapp, either way, it can deal with minimize on startup itself.
  1. Check config file for setting
  2. minimize immediately if setting set from Tauri side.
let window = app.get_window("main").unwrap();
window.hide().unwrap();

just call that or equivalent on load if setting is set.

Either way, we need to decide on scope, because there are tons of features and tickets relying on a system tray icon, or being able to run in the background with a hidden window.

Minimize to systray on startup can be postponed to a later PR. Configuring the system tray usage can be done entirely through Desktop app menus at first if needed.

hugeblank added a commit to hugeblank/cinny-desktop that referenced this pull request Sep 26, 2023
Does what title says.

Lifts event handler logic from paste image support (cinnyapp#167).

Includes some commented out logic for compatibility with systray (cinnyapp#166) when/if merged. Requires TRAY_LABEL be exposed as public, however.
hugeblank added a commit to hugeblank/cinny-desktop that referenced this pull request Sep 26, 2023
Does what title says.

Lifts event handler logic from paste image support (cinnyapp#167).

Includes some commented out logic for compatibility with systray (cinnyapp#166) when/if merged. Requires TRAY_LABEL be exposed as public, however.
hugeblank added a commit to hugeblank/cinny-desktop that referenced this pull request Sep 26, 2023
to uncomment when cinnyapp#166 is merged.
@kfiven kfiven merged commit 095b8fc into cinnyapp:main Oct 21, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Oct 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants