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

Desktop notifications on Windows hangs colcon command #57

Open
Ace314159 opened this issue Feb 14, 2022 · 0 comments
Open

Desktop notifications on Windows hangs colcon command #57

Ace314159 opened this issue Feb 14, 2022 · 0 comments

Comments

@Ace314159
Copy link

With the default parameters, after a colcon build finishes, the powershell window gets stuck on Summary: 1 package finished for a couple of seconds before giving control back to the user.

I noticed this was because of the time.sleep(5) on Line 90 here:

try:
win32gui.Shell_NotifyIcon(
win32gui.NIM_ADD, nid)
win32gui.Shell_NotifyIcon(
win32gui.NIM_MODIFY, (
hwnd, 0, win32gui.NIF_INFO, win32con.WM_USER + 20, hicon,
'Balloon tooltip', message, 200, title))
except Exception as e: # noqa: F841
logger.debug(
'Failed to show the notification: {e}'.format_map(locals()))
else:
# wait a while before destroying the window
time.sleep(5)
finally:
win32gui.DestroyWindow(hwnd)

Is there a reason to destroy the window? I commented out the line that destroys the window and the notification disappeared after a couple of seconds, and nothing seemed to go wrong.

If destroying the window is required, would it be possible to do this without having the sleep?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant