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

Feature/issue 14/open in system tray #26

Closed

Conversation

ioki9
Copy link

@ioki9 ioki9 commented Jun 26, 2023

Implementation of SystemTrayManager class. The class purpose is to bind to a main window of a program and manage tray icon of that window.

I have a question implementation wise. Do you see your app using multiple tray icons? Because I can implement the class in different ways. I was thinking of a singleton pattern in case you will ever need only one tray icon or I can do it the way it will be able to create multiple tray icons for different windows (I will probably have to make a more general class then). So let me know which of those you see more fit for your app, thanks.

@ioki9
Copy link
Author

ioki9 commented Jun 26, 2023

Oh, and about the multiple tray icons, I am not 100% sure if my idea will work, so don't take it for granted.

@hetulbhatt
Copy link
Owner

hello @ioki9, I am not able to compile your code. What command do you use for compilation?

I use: g++ -std=c++17 src/main.cpp

getting the following error while compiling your code:
err.txt

@ioki9
Copy link
Author

ioki9 commented Jun 27, 2023

hello @ioki9, I am not able to compile your code. What command do you use for compilation?

I use: g++ -std=c++17 src/main.cpp

getting the following error while compiling your code: err.txt

Sorry, I forgot to mention you need to link Gdi32 library for some functions to work. ( -lGdi32)

@hetulbhatt
Copy link
Owner

Okay, thanks.

@ioki9
Copy link
Author

ioki9 commented Jun 27, 2023

Oh, you have std mutex/thread errors. May I ask what compiler are you using? If you use mingw then I think you need a version with POSIX threads for std mutex/threads to work. I can rewrite that with winapi threads instead of std if you want, although I never used them before,

@hetulbhatt
Copy link
Owner

Actually i am AFK currently, will check the posix version once i get back. Until then, i just wanted to convey the plan that i have already made an issue to start with the GUI interface of this software - so it's already on the roadmap. Now, I believe, with whatever lightweight GUI library we use, we will get some API to make the program run in background - either accessible in the tray or in the task manager. Due to which I think, we can focus on GUI part first, and incorporate this change with that.

@hetulbhatt
Copy link
Owner

@ioki9, first of all, thank you so much for your contribution. I couldn't test it previously as my version of MinGW g++ didn't support threads and mutex, which is why I migrated my project from g++-based compilation to cl (MSVC)-based compilation locally. By doing so, I was able to compile your source code correctly, after making some amendments, of course.

While testing, I noticed that your implementation minimizes the window automatically when it loses focus, which is a clever solution. However, it can still be annoying for the user who may see the program running in the taskbar. Taking these factors into consideration, I won't be able to merge this pull request. Please let me know your thoughts.

@ioki9
Copy link
Author

ioki9 commented Jun 30, 2023

@hetulbhatt Behavior of window minimization on focus loss (when you click somewhere else AND the window you clicked is on fullscreen) is a default Windows behavior, it just goes behind that window. Maybe I am not understanding you correctly and you mean window hiding. If so then I haven't written the code for such behavior and I don't get it this behavior on my machine. Can you explain in more details what do you mean?

@ioki9
Copy link
Author

ioki9 commented Jun 30, 2023

  1. Focus on your app.
  2. I pressed on vscode, focus is on vscode, your window is not minimized.
    image
    image

@hetulbhatt
Copy link
Owner

Closing this pull request due to merge conflicts. Thanks @ioki9 for your efforts. If you are still interested in this project, you can check this spike: #18

@hetulbhatt hetulbhatt closed this Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants