TabletFriend icon indicating copy to clipboard operation
TabletFriend copied to clipboard

Sometimes taskbar icon jitters and instacloses.

Open Martenfur opened this issue 4 years ago • 2 comments

This happens every time every first launch. On icon right click, the context menu appears in the wrong place and instantly disappears.

Martenfur avatar Sep 16 '21 08:09 Martenfur

Seems to have something to do with window not being focusable. Not sure how to fix it.

Martenfur avatar Sep 17 '21 19:09 Martenfur

I've spent some time on the topic yesterday. But I could not find a solution till now. I've found some equal behaviors with message boxes insta-closing when there is no main UI thread. After insta-closing, the next message boxes are working: https://stackoverflow.com/questions/28017576/wpf-taskbaricon-contextmenu

I can reproduce it also with:

  1. left-click tray icon (main window is hidden)
  2. left-click tray icon again (main window is shown again)
  3. right-click tray icon (the context menu is shown shortly and insta-closes again)
  4. right-click tray icon again (the context menu is shown and stays) goto 1.

It "feels" like it could be related.

And you are right, if the "WS_EX_NOACTIVATE" part is disabled, the problem is gone. But then the main window is stealing the focus.

alfish2000 avatar Sep 19 '21 10:09 alfish2000