Skip to content

Use Claude Code, Codex, VSCode, Pi, and OpenCode (and 6 other harnesses) for free (1.3B+ free tokens) from your terminal, app, IDE, or phone, and now from the browser with native browser sessions (multi-harness + multi-model) like OpenClaw (voice supported + ToS friendly)

Python

Fix blurry Windows folder picker and tray menu (#1714)

Ali Khokharaa4f6006fe53
diff --git a/e2e/test_code_sessions.py b/e2e/test_code_sessions.py
index 89351f03..8dcb18aa 100644
--- a/e2e/test_code_sessions.py
+++ b/e2e/test_code_sessions.py
@@ -170,6 +170,7 @@ def test_browse_fills_only_its_tab_and_waits_for_create(
expect(
form.get_by_role("button", name="Create session", exact=True)
).to_be_disabled()
+ expect(form.get_by_role("status")).to_be_hidden()
other.get_by_role("button", name="Browse…", exact=True).click()
expect(
other.get_by_text("A folder picker is already open", exact=True)
diff --git a/pyproject.toml b/pyproject.toml
index db4a95a0..7367550d 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "free-claude-code"
-version = "6.1.0"
+version = "6.1.1"
description = "Local proxy connecting coding agents to OpenAI-compatible AI providers"
readme = "README.md"
requires-python = ">=3.14.0"
diff --git a/src/free_claude_code/api/admin_static/code_sessions.js b/src/free_claude_code/api/admin_static/code_sessions.js
index 6b05c0a9..6c28cc51 100644
--- a/src/free_claude_code/api/admin_static/code_sessions.js
+++ b/src/free_claude_code/api/admin_static/code_sessions.js
@@ -625,7 +625,7 @@
if (!context.isOpen() || context.isBusy()) return;
const initial = readFolder();
context.setBusy(true);
- context.message("Choose a folder in the open folder picker.");
+ context.message("");
try {
const result = await api(`${base}/folder-picker`, {
method: "POST",
diff --git a/src/free_claude_code/cli/desktop_entrypoint.py b/src/free_claude_code/cli/desktop_entrypoint.py
index 16b9a1a7..fa527aa8 100644
--- a/src/free_claude_code/cli/desktop_entrypoint.py
+++ b/src/free_claude_code/cli/desktop_entrypoint.py
@@ -5,6 +5,7 @@ from collections.abc import Sequence
from pathlib import Path
from free_claude_code.cli.desktop_assets import export_app_icon
+from free_claude_code.core.windows_dpi import enable_dpi_awareness
def launch(argv: Sequence[str] | None = None) -> None:
@@ -21,6 +22,8 @@ def launch(argv: Sequence[str] | None = None) -> None:
print("FCC Desktop is supported on Windows and macOS.", file=sys.stderr)
raise SystemExit(1)
+ enable_dpi_awareness()
+
from free_claude_code.cli.desktop_tray import launch as launch_tray
launch_tray()
diff --git a/src/free_claude_code/core/windows_dpi.py b/src/free_claude_code/core/windows_dpi.py
new file mode 100644
index 00000000..67e1d2c6
--- /dev/null
+++ b/src/free_claude_code/core/windows_dpi.py
@@ -0,0 +1,27 @@
+"""Windows scaling setup shared by native UI entrypoints."""
+
+import ctypes
+import sys
+
+_PER_MONITOR_AWARE_V2 = -4
+_ERROR_ACCESS_DENIED = 5
+
+
+def enable_dpi_awareness() -> None:
+ """Use native monitor scaling before creating windows in this process."""
+ if sys.platform != "win32":
+ return
+
+ set_awareness = ctypes.WinDLL(
+ "user32", use_last_error=True
+ ).SetProcessDpiAwarenessContext
+ set_awareness.argtypes = (ctypes.c_void_p,)
+ set_awareness.restype = ctypes.c_int
+ if set_awareness(ctypes.c_void_p(_PER_MONITOR_AWARE_V2)):
+ return
+
+ error = ctypes.get_last_error()
+ # Windows rejects subsequent changes, including a mode set by the host's
+ # manifest. Respect that choice and allow repeated initialization.
+ if error != _ERROR_ACCESS_DENIED:
+ raise ctypes.WinError(error)
diff --git a/src/free_claude_code/runtime/native_folder_dialog.py b/src/free_claude_code/runtime/native_folder_dialog.py
index a6c8870e..39a1288a 100644
--- a/src/free_claude_code/runtime/native_folder_dialog.py
+++ b/src/free_claude_code/runtime/native_folder_dialog.py
@@ -7,6 +7,8 @@ import subprocess
import sys
from pathlib import Path
+from free_claude_code.core.windows_dpi import enable_dpi_awareness
+
_TITLE = "Choose a Code Session folder"
_MAC_SCRIPT = """
on run argv
@@ -43,6 +45,8 @@ def _initial_directory(value: str) -> str | None:
def _windows(initial: str | None) -> str | None:
+ enable_dpi_awareness()
+
import tkinter
from tkinter import filedialog
diff --git a/tests/cli/test_desktop_assets.py b/tests/cli/test_desktop_assets.py
index 8ef37e42..c0689661 100644
--- a/tests/cli/test_desktop_assets.py
+++ b/tests/cli/test_desktop_assets.py
@@ -1,7 +1,9 @@
"""Packaged desktop icon and export contracts."""
+import builtins
import struct
from pathlib import Path
+from types import SimpleNamespace
import pytest
@@ -55,3 +57,24 @@ def test_desktop_entrypoint_rejects_unknown_arguments(
assert exc_info.value.code == 2
assert "Usage: fcc-desktop" in capsys.readouterr().err
+
+
+def test_desktop_sets_scaling_before_importing_native_tray(monkeypatch):
+ calls = []
+ monkeypatch.setattr(desktop_entrypoint.sys, "platform", "win32")
+ monkeypatch.setattr(
+ desktop_entrypoint,
+ "enable_dpi_awareness",
+ lambda: calls.append("scaling"),
+ )
+ original_import = builtins.__import__
+
+ def import_module(name, *args, **kwargs):
+ if name == "free_claude_code.cli.desktop_tray":
+ assert calls == ["scaling"]
+ return SimpleNamespace(launch=lambda: calls.append("tray"))
+ return original_import(name, *args, **kwargs)
+
+ monkeypatch.setattr(builtins, "__import__", import_module)
+ desktop_entrypoint.launch([])
+ assert calls == ["scaling", "tray"]
diff --git a/tests/core/test_windows_dpi.py b/tests/core/test_windows_dpi.py
new file mode 100644
index 00000000..6b9abc53
--- /dev/null
+++ b/tests/core/test_windows_dpi.py
@@ -0,0 +1,64 @@
+import subprocess
+import sys
+
+import pytest
+
+
[email protected]("platform", ["linux", "darwin"])
+def test_other_platforms_do_not_load_windows_ui(monkeypatch, platform):
+ from free_claude_code.core import windows_dpi
+
+ def load_windows(*_args, **_kwargs):
+ pytest.fail("Windows UI library loaded on another platform")
+
+ monkeypatch.setattr(windows_dpi.sys, "platform", platform)
+ monkeypatch.setattr(windows_dpi.ctypes, "WinDLL", load_windows, raising=False)
+ windows_dpi.enable_dpi_awareness()
+
+
[email protected](sys.platform != "win32", reason="Windows DPI APIs")
[email protected]("preset", ["none", "system", "per-monitor"])
+def test_native_windows_use_scaling_and_respect_existing_awareness(preset):
+ # DPI awareness is process-wide and can only be set once. Each case needs
+ # its own process so other tests and the test runner keep their own mode.
+ result = subprocess.run(
+ [
+ sys.executable,
+ "-c",
+ """
+import ctypes
+import sys
+from ctypes import wintypes
+
+user32 = ctypes.WinDLL('user32', use_last_error=True)
+user32.SetProcessDpiAwarenessContext.argtypes = [ctypes.c_void_p]
+user32.SetProcessDpiAwarenessContext.restype = wintypes.BOOL
+user32.GetWindowDpiAwarenessContext.argtypes = [wintypes.HWND]
+user32.GetWindowDpiAwarenessContext.restype = ctypes.c_void_p
+user32.AreDpiAwarenessContextsEqual.argtypes = [ctypes.c_void_p, ctypes.c_void_p]
+user32.AreDpiAwarenessContextsEqual.restype = wintypes.BOOL
+expected = -2 if sys.argv[1] == 'system' else -4
+if sys.argv[1] != 'none':
+ assert user32.SetProcessDpiAwarenessContext(ctypes.c_void_p(expected))
+
+from free_claude_code.core.windows_dpi import enable_dpi_awareness
+enable_dpi_awareness()
+enable_dpi_awareness()
+
+import tkinter
+root = tkinter.Tk()
+root.withdraw()
+try:
+ context = user32.GetWindowDpiAwarenessContext(root.winfo_id())
+ assert user32.AreDpiAwarenessContextsEqual(context, ctypes.c_void_p(expected))
+finally:
+ root.destroy()
+""",
+ preset,
+ ],
+ capture_output=True,
+ text=True,
+ timeout=15,
+ check=False,
+ )
+ assert result.returncode == 0, result.stdout + result.stderr
diff --git a/tests/runtime/test_native_folder_dialog.py b/tests/runtime/test_native_folder_dialog.py
index 8301e46d..e1768a93 100644
--- a/tests/runtime/test_native_folder_dialog.py
+++ b/tests/runtime/test_native_folder_dialog.py
@@ -89,18 +89,24 @@ def test_macos_passes_the_hint_as_data_and_preserves_path_characters(monkeypatch
@pytest.mark.parametrize("selection", ["", "C:/Projects/café"])
def test_windows_destroys_hidden_parent_after_selection(monkeypatch, selection):
calls = []
+ monkeypatch.setattr(native, "enable_dpi_awareness", lambda: calls.append("scaling"))
root = SimpleNamespace(
withdraw=lambda: calls.append("hidden"),
attributes=lambda *_args: None,
destroy=lambda: calls.append("destroyed"),
)
+
+ def create_parent():
+ calls.append("created")
+ return root
+
module = SimpleNamespace(
- Tk=lambda: root,
+ Tk=create_parent,
filedialog=SimpleNamespace(askdirectory=lambda **_kwargs: selection),
)
monkeypatch.setitem(native.sys.modules, "tkinter", module)
assert native._windows(None) == (selection or None)
- assert calls == ["hidden", "destroyed"]
+ assert calls == ["scaling", "created", "hidden", "destroyed"]
def test_folder_hint_is_optional_and_checked_in_helper(tmp_path):
diff --git a/uv.lock b/uv.lock
index 0514aba7..42d7a95e 100644
--- a/uv.lock
+++ b/uv.lock
@@ -598,7 +598,7 @@ wheels = [
[[package]]
name = "free-claude-code"
-version = "6.1.0"
+version = "6.1.1"
source = { editable = "." }
dependencies = [
{ name = "aiohttp" },