Skip to content

Commit

Permalink
Fix setting Servo icon on macOS
Browse files Browse the repository at this point in the history
Originally introduced in PR #11646,
this appears to have been accidentally broken by commit
82df8e9.
  • Loading branch information
aneeshusa committed Apr 17, 2017
1 parent 5ccb087 commit ff74fae
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions python/servo/build_commands.py
Expand Up @@ -325,19 +325,19 @@ def build(self, target=None, release=False, dev=False, jobs=None,
shutil.copy(path.join(env['OPENSSL_LIB_DIR'], "../bin" + msvc_x64, ssl_lib),
servo_exe_dir)

elif sys.platform == "darwin":
# On the Mac, set a lovely icon. This makes it easier to pick out the Servo binary in tools
# like Instruments.app.
try:
import Cocoa
icon_path = path.join(self.get_top_dir(), "resources", "servo.png")
icon = Cocoa.NSImage.alloc().initWithContentsOfFile_(icon_path)
if icon is not None:
Cocoa.NSWorkspace.sharedWorkspace().setIcon_forFile_options_(icon,
servo_path,
0)
except ImportError:
pass
elif sys.platform == "darwin":
# On the Mac, set a lovely icon. This makes it easier to pick out the Servo binary in tools
# like Instruments.app.
try:
import Cocoa
icon_path = path.join(self.get_top_dir(), "resources", "servo.png")
icon = Cocoa.NSImage.alloc().initWithContentsOfFile_(icon_path)
if icon is not None:
Cocoa.NSWorkspace.sharedWorkspace().setIcon_forFile_options_(icon,
servo_path,
0)
except ImportError:
pass

# Generate Desktop Notification if elapsed-time > some threshold value
notify_build_done(self.config, elapsed, status == 0)
Expand Down

0 comments on commit ff74fae

Please sign in to comment.