Skip to content

Commit

Permalink
Only enable borderless browserhtml window on OSX.
Browse files Browse the repository at this point in the history
Pass browserhtml path as relative path to avoid a mingw->windows path conversion
  • Loading branch information
adamncasey authored and UK992 committed Jun 7, 2016
1 parent bc52617 commit 64c5c3e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
9 changes: 9 additions & 0 deletions python/servo/command_base.py
Expand Up @@ -105,6 +105,15 @@ def check_call(*args, **kwargs):
return subprocess.check_call(*args, shell=sys.platform == 'win32', **kwargs)


def is_windows():
""" Detect windows, mingw, cygwin """
return sys.platform == 'win32' or sys.platform == 'msys' or sys.platform == 'cygwin'


def is_macosx():
return sys.platform == 'darwin'


class BuildNotFound(Exception):
def __init__(self, message):
self.message = message
Expand Down
12 changes: 10 additions & 2 deletions python/servo/post_build_commands.py
Expand Up @@ -23,7 +23,7 @@
Command,
)

from servo.command_base import CommandBase, cd, call, check_call
from servo.command_base import CommandBase, cd, call, check_call, is_windows, is_macosx


def read_file(filename, if_exists=False):
Expand Down Expand Up @@ -131,7 +131,15 @@ def run(self, params, release=False, dev=False, android=None, debug=False, debug
if browserhtml_path is None:
print("Could not find browserhtml package; perhaps you haven't built Servo.")
return 1
args = args + ['-w', '-b',

if is_macosx():
# Enable borderless on OSX
args = args + ['-b']
elif is_windows():
# Convert to a relative path to avoid mingw -> Windows path conversions
browserhtml_path = path.relpath(browserhtml_path, os.getcwd())

args = args + ['-w',
'--pref', 'dom.mozbrowser.enabled',
'--pref', 'dom.forcetouch.enabled',
'--pref', 'shell.quit-on-escape.enabled=false',
Expand Down

0 comments on commit 64c5c3e

Please sign in to comment.