diff --git a/qutebrowser/app.py b/qutebrowser/app.py index b44cd6a6d..bcf5bed9a 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -230,16 +230,19 @@ class Application(QApplication): self._open_startpage() self._open_quickstart() - def process_args(self, args): + def process_args(self, args, ipc=False): """Process commandline args. URLs to open have no prefix, commands to execute begin with a colon. Args: args: A list of arguments to process. + ipc: Whether the arguments were transmitted over IPC. """ - # FIXME handle win_id with IPC - win_id = 0 + if ipc: + win_id = mainwindow.MainWindow.spawn() + else: + win_id = 0 for cmd in args: if cmd.startswith(':'): log.init.debug("Startup cmd {}".format(cmd)) diff --git a/qutebrowser/utils/ipc.py b/qutebrowser/utils/ipc.py index bbf2fe91c..7598efb5d 100644 --- a/qutebrowser/utils/ipc.py +++ b/qutebrowser/utils/ipc.py @@ -145,7 +145,7 @@ class IPCServer(QObject): return log.ipc.debug("Processing: {}".format(decoded)) app = objreg.get('app') - app.process_args(args) + app.process_args(args, ipc=True) @pyqtSlot() def on_timeout(self):