Add brand visual style to page profile and logo palette to image prompts
Adds PageProfile.visualStyle (with migration), feeds it into every AI prompt route, and samples a logo palette for image generation. Also hardens Chrome focus handling and image copy in the ChatGPT driver. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -11,11 +11,19 @@ public static class ChromeKeyboard
|
||||
[DllImport("user32.dll")] private static extern bool AttachThreadInput(uint source, uint target, bool attach);
|
||||
[DllImport("user32.dll")] private static extern bool SetForegroundWindow(IntPtr h);
|
||||
[DllImport("user32.dll")] private static extern bool BringWindowToTop(IntPtr h);
|
||||
[DllImport("user32.dll")] private static extern void keybd_event(byte key, byte scan, uint flags, UIntPtr extra);
|
||||
|
||||
public static void ActivateWindow(IntPtr window)
|
||||
{
|
||||
if (GetForegroundWindow() == window) return;
|
||||
if (SetForegroundWindow(window)) return;
|
||||
// A synthetic Alt press is the documented user-input signal Windows
|
||||
// uses to allow a background process to transfer foreground focus.
|
||||
keybd_event(0x12, 0, 0, UIntPtr.Zero);
|
||||
keybd_event(0x12, 0, 2, UIntPtr.Zero);
|
||||
// SetForegroundWindow can report success before Windows has actually
|
||||
// changed the foreground window. Only return after verifying the HWND.
|
||||
SetForegroundWindow(window);
|
||||
if (GetForegroundWindow() == window) return;
|
||||
uint ignored;
|
||||
uint current = GetCurrentThreadId();
|
||||
uint foreground = GetWindowThreadProcessId(GetForegroundWindow(), out ignored);
|
||||
|
||||
Reference in New Issue
Block a user