mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Fix setting Servo icon on macOS
Originally introduced in PR #11646,
this appears to have been accidentally broken by commit
82df8e9399
.
This commit is contained in:
parent
5ccb087769
commit
ff74faee10
1 changed files with 13 additions and 13 deletions
|
@ -325,19 +325,19 @@ class MachCommands(CommandBase):
|
||||||
shutil.copy(path.join(env['OPENSSL_LIB_DIR'], "../bin" + msvc_x64, ssl_lib),
|
shutil.copy(path.join(env['OPENSSL_LIB_DIR'], "../bin" + msvc_x64, ssl_lib),
|
||||||
servo_exe_dir)
|
servo_exe_dir)
|
||||||
|
|
||||||
elif sys.platform == "darwin":
|
elif sys.platform == "darwin":
|
||||||
# On the Mac, set a lovely icon. This makes it easier to pick out the Servo binary in tools
|
# On the Mac, set a lovely icon. This makes it easier to pick out the Servo binary in tools
|
||||||
# like Instruments.app.
|
# like Instruments.app.
|
||||||
try:
|
try:
|
||||||
import Cocoa
|
import Cocoa
|
||||||
icon_path = path.join(self.get_top_dir(), "resources", "servo.png")
|
icon_path = path.join(self.get_top_dir(), "resources", "servo.png")
|
||||||
icon = Cocoa.NSImage.alloc().initWithContentsOfFile_(icon_path)
|
icon = Cocoa.NSImage.alloc().initWithContentsOfFile_(icon_path)
|
||||||
if icon is not None:
|
if icon is not None:
|
||||||
Cocoa.NSWorkspace.sharedWorkspace().setIcon_forFile_options_(icon,
|
Cocoa.NSWorkspace.sharedWorkspace().setIcon_forFile_options_(icon,
|
||||||
servo_path,
|
servo_path,
|
||||||
0)
|
0)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Generate Desktop Notification if elapsed-time > some threshold value
|
# Generate Desktop Notification if elapsed-time > some threshold value
|
||||||
notify_build_done(self.config, elapsed, status == 0)
|
notify_build_done(self.config, elapsed, status == 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue