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

Missing tray icon #31

Closed
Andrzej-W opened this issue Sep 25, 2019 · 10 comments
Closed

Missing tray icon #31

Andrzej-W opened this issue Sep 25, 2019 · 10 comments
Labels
can't reproduce Not reproducible with information provided, need more details.

Comments

@Andrzej-W
Copy link
Contributor

I have found an interesting behaviour of rbtray program.

  1. Open Notepad.
  2. Press Win+Alt+Down. Program is hidden, I see an icon in tray.
  3. Click icon in tray. Program is restored, icon disappears.
  4. Press Win+Alt+Down. Program is hidden, no icon in tray.
  5. Press Win+Alt+Down again - icon appears.

If you write something in Notepad after step 3 or click anywhere in Notepad window then you can press Win+Alt+Down and everything works correctly (program disappears, icon in tray is visible).

@benbuck
Copy link
Owner

benbuck commented Sep 30, 2019

Hi @Andrzej-W,

Yes, that's very strange. I haven't been able to reproduce it so far. Just to make sure I understand correctly, step 2 and step 4 are identical right? But you are seeing different results the second time?

Do you have any other window management tools running that might be interacting with this functionality in unexpected ways?

Thanks,
Benbuck

@benbuck benbuck added the can't reproduce Not reproducible with information provided, need more details. label Sep 30, 2019
@Andrzej-W
Copy link
Contributor Author

Hi @benbuck
Step 2 and 4 are identical. I don't use any window management tools. My desktop computer has a lot of programs but all of them are trustworthy standard programs like Total Commander, MS Office, Thunderbird, Firefox, Chrome, Adobe Reader, ESET Internet Security, etc. plus Visual Studio 2008 with tools for Windows CE programming, VS 2015, VS 2017. I have Windows 10 Pro x64 1803 and it was updated at least 2 times from previous versions.

I have just checked your program on my laptop. Here I have fresh Windows 10 x64 1903 with some standard programs and VS 2019. Rbtray behaviour is exactly the same. To be sure that there is no interaction with other programs I disabled all programs which show tray icons like Skype, Sysinternals Process Explorer, Canon Network Scanner Selector. The only left was from ESET Internet Security + system icons. I don't have other strange programs running in the background.

I have made some additional tests. Please look at updated steps below with some important comments:

  1. Open Notepad.
  2. Press Win+Alt+Down. Program is now hidden, I see an icon in tray. PROBABLY VERY IMPORTANT: my taskbar is configured to show all tray icons. Notepad icon appears as first icon from the left.
  3. Click icon in tray. Program is restored, icon disappears. VERY IMPORTANT: don't move your mouse after clicking.
  4. Press Win+Alt+Down. Program is hidden, no icon in tray. On laptop which has slower, low voltage processor I see that icon is added to the tray and it immediately disappears. Remember: don't move your mouse.
  5. Press Win+Alt+Down again - icon appears.

I was able to reproduce this bug with almost 100% probability on both computers. If I move my mouse after step 3 program works correctly (I can press Win+Alt+Down and I see Notepad icon in tray immediately). Now let's assume that you cannot reproduce the bug. Move your mouse a few pixels and repeat steps 2 and 3 a few times. Still works correctly, move your mouse a few pixels and repeat.

Now let's assume that you are able to reproduce the bug. If you move your mouse after step 4 and click somewhere you will loose access to notepad completely because there is no window and no icon in tray. You can only kill it.

I'm C/C++ programmer but I have no experience with good old low level Windows programming. If you still have no idea what is going on I can try to debug it myself.

@benbuck
Copy link
Owner

benbuck commented Oct 2, 2019

Hi @Andrzej-W,

Thanks for all the detailed information. I still haven't been able to reproduce this, even without moving my mouse at all. However, based on your description, it sounds like either RBTray or Windows may be expecting another event to be processed for the icon to appear correctly. I'll dig around the code when I have a chance to see if anything looks problematic, but please feel free to debug it yourself if you're capable. I'll warn you though that since RBTray is hooking into mouse events at a very low level, it's very easy to freeze your system when trying to debug it.

Thanks,
Benbuck

@benbuck
Copy link
Owner

benbuck commented Oct 2, 2019

Hi @Andrzej-W,

I noticed I had some local commits that I hadn't released yet, so I just pushed version 4.9. Hopefully one of those local changes fixed something and is the reason I wasn't able to reproduce this, but please let me know either way.

Thanks,
Benbuck

@Andrzej-W
Copy link
Contributor Author

@benbuck, I have just replaced version 4.8 with 4.9 and unfortunately I see exactly the same behaviour. Maybe I will try to find the problem myself but first I have to read some doc to understand all these "magic" data structures and constants.

Andrzej-W added a commit to Andrzej-W/rbtray that referenced this issue Oct 2, 2019
@Andrzej-W
Copy link
Contributor Author

Hi @benbuck
It looks that I have fixed the bug. Check my pull request.

@stavultras
Copy link

stavultras commented Oct 3, 2019

Just FYI: I was able to reproduce the described steps with Total Commander. The tray icon and the Total Commander's window disappeared after the second "hiding" and I had to kill totalcmd.exe process manually.

P.S. Was able to do it 3 times in a row.

benbuck added a commit that referenced this issue Oct 4, 2019
@benbuck
Copy link
Owner

benbuck commented Oct 4, 2019

Hi @Andrzej-W,

I really appreciate you taking the time to look into this. I've merged your commit and released version 4.10. Please let me know if this build resolves the issue for you (and for you as well @stavultras).

Thanks,
Benbuck

@stavultras
Copy link

stavultras commented Oct 4, 2019

@Andrzej-W @benbuck thanks for the fix and merge! Works properly now. Wasn't able to reproduce the issue.

@Andrzej-W
Copy link
Contributor Author

Hi @benbuck
New version works correctly - I'm closing this issue.

Thank you for maintaining this useful program,
Andrew

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can't reproduce Not reproducible with information provided, need more details.
Projects
None yet
Development

No branches or pull requests

3 participants