mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-05-13 08:26:56 +00:00
Cleanup previous PR
We cant rely on is_wayland() during parsing as that can occur in offline contexts.
This commit is contained in:
parent
5c99f0735d
commit
744fc12ca8
3 changed files with 7 additions and 7 deletions
|
|
@ -956,9 +956,8 @@ class Boss:
|
|||
args.session = ''
|
||||
if not os.path.isabs(args.directory):
|
||||
args.directory = os.path.join(data['cwd'], args.directory)
|
||||
pos_x, pos_y = None, None
|
||||
if args.position and not is_wayland():
|
||||
pos_x, pos_y = map(int, args.position.lower().partition('x')[::2])
|
||||
from .launch import parse_os_window_position
|
||||
pos_x, pos_y = (None, None) if is_wayland() else parse_os_window_position(args.position)
|
||||
from .child import process_env
|
||||
clean_env = process_env(data['environ'])
|
||||
focused_os_window = os_window_id = 0
|
||||
|
|
|
|||
|
|
@ -462,8 +462,8 @@ def layer_shell_config_from_panel_opts(panel_opts: Iterable[str]) -> LayerShellC
|
|||
return layer_shell_config(opts)
|
||||
|
||||
|
||||
def parse_os_window_position(position: str) -> tuple[int | None, int | None]:
|
||||
if not position or is_wayland():
|
||||
def parse_os_window_position(position: str | None) -> tuple[int | None, int | None]:
|
||||
if not position:
|
||||
return None, None
|
||||
x, _, y = position.lower().partition('x')
|
||||
return int(x), int(y)
|
||||
|
|
@ -476,7 +476,7 @@ def tab_for_window(boss: Boss, opts: LaunchCLIOptions, target_tab: Tab | None, n
|
|||
if opts.type == 'os-panel':
|
||||
oswid = boss.add_os_panel(layer_shell_config_from_panel_opts(opts.os_panel), opts.os_window_class, opts.os_window_name)
|
||||
else:
|
||||
x, y = parse_os_window_position(opts.os_window_position)
|
||||
x, y = (None, None) if is_wayland() else parse_os_window_position(opts.os_window_position)
|
||||
oswid = boss.add_os_window(
|
||||
wclass=opts.os_window_class,
|
||||
wname=opts.os_window_name,
|
||||
|
|
|
|||
|
|
@ -289,7 +289,8 @@ def _run_app(opts: Options, args: CLIOptions, bad_lines: Sequence[BadLine] = (),
|
|||
if cached_workarea and glfw_get_monitor_workarea() == tuple(cached_workarea):
|
||||
pos_x, pos_y = cached_values.get('window-pos', (None, None))
|
||||
if args.position:
|
||||
pos_x, pos_y = map(int, args.position.lower().partition('x')[::2])
|
||||
from .launch import parse_os_window_position
|
||||
pos_x, pos_y = parse_os_window_position(args.position)
|
||||
startup_session_error: tuple[Exception, str] | None = None
|
||||
try:
|
||||
startup_sessions = tuple(create_sessions(opts, args, default_session=opts.startup_session))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue