Skip to content

Desktop notifications on Windows hangs colcon command #57

Description

@Ace314159

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions