mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-18 06:45:33 +00:00
Bug 680009 - Flash taskbar icon on Windows when 'mach build' finishes. r=gps
This commit is contained in:
parent
290a915cf0
commit
434d96be0b
@ -429,7 +429,24 @@ class Build(MachCommandBase):
|
||||
method = notify.get_dbus_method('Notify',
|
||||
'org.freedesktop.Notifications')
|
||||
method('Mozilla Build System', 0, '', 'Build complete', '', [], [], -1)
|
||||
|
||||
elif sys.platform.startswith('win'):
|
||||
from ctypes import Structure, windll, POINTER, sizeof
|
||||
from ctypes.wintypes import DWORD, HANDLE, WINFUNCTYPE, BOOL, UINT
|
||||
class FLASHWINDOW(Structure):
|
||||
_fields_ = [("cbSize", UINT),
|
||||
("hwnd", HANDLE),
|
||||
("dwFlags", DWORD),
|
||||
("uCount", UINT),
|
||||
("dwTimeout", DWORD)]
|
||||
FlashWindowExProto = WINFUNCTYPE(BOOL, POINTER(FLASHWINDOW))
|
||||
FlashWindowEx = FlashWindowExProto(("FlashWindowEx", windll.user32))
|
||||
FLASHW_CAPTION = 0x01
|
||||
FLASHW_TRAY = 0x02
|
||||
FLASHW_TIMERNOFG = 0x0C
|
||||
params = FLASHWINDOW(sizeof(FLASHWINDOW),
|
||||
windll.kernel32.GetConsoleWindow(),
|
||||
FLASHW_CAPTION | FLASHW_TRAY | FLASHW_TIMERNOFG, 3, 0)
|
||||
FlashWindowEx(params)
|
||||
except Exception as e:
|
||||
self.log(logging.WARNING, 'notifier-failed', {'error':
|
||||
e.message}, 'Notification center failed: {error}')
|
||||
|
Loading…
x
Reference in New Issue
Block a user