mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-06-07 09:28:03 +08:00

* Move KBM engine into separate process (#10672) * [KBM] Migrate KBM UI out of the runner (#10709) * Clean up keyboard hook handles (#10817) * [C++ common] Unhandled exception handler (#10821) * [KBM] Use icon in the KeyboardManagerEditor (#10845) * [KBM] Move resources from the Common project to the Editor. (#10844) * KBM Editor tests (#10858) * Rename engine executable (#10868) * clean up (#10870) * [KBM] Changed Editor and libraries output folders (#10871) * [KBM] New logs structure (#10872) * Add unhandled exception handling to the editor (#10874) * [KBM] Trace for edit keyboard window * Logging for XamlBridge message loop * [KBM] Added Editor and Engine to the installer (#10876) * Fix spelling * Interprocess communication logs, remove unnecessary windows message logs * [KBM] Separated telemetry for the engine and editor. (#10889) * [KBM] Editor test project (#10891) * Versions for the engine and the editor (#10897) * Add the editor's and the engine's executables to signing process (#10900) * [KBM editor] Run only one instance, exit when parent process exits (#10890) * [KBM] Force kill editor process to avoid XAML crash (#10907) * [KBM] Force kill editor process to avoid XAML crash * Fix event releasing Co-authored-by: mykhailopylyp <17161067+mykhailopylyp@users.noreply.github.com> * Make the editor dpi aware (#10908) * [KBM] KeyboardManagerCommon refactoring (#10909) * Do not start the process if it is already started (#10910) * logs * Update src/modules/keyboardmanager/KeyboardManagerEditorLibrary/EditKeyboardWindow.cpp * Update src/modules/keyboardmanager/KeyboardManagerEditorLibrary/EditKeyboardWindow.cpp * [KBM] Rename InitUnhandledExceptionHandler to make it explicit that is for x64 only. We will fix it properly when adding support for ARM64 and add a header with the proper conditional building. * [KBM] rename file/class/variables using camel case * [KBM] Rename "event_locker" -> "EventLocker" * [KBM] rename process_waiter Add a TODO comment * [KBM] rename methods Add TODO comment * [KBM] use uppercase for function names * [KBM] use uppercase for methos, lowercase for properties * [KBM] rename method, make methods private, formatting * [KBM] rename private variables * [KBM] use uppercase for function names * [KBM] Added support to run the editor stand-alone when built in debug mode * Update src/modules/keyboardmanager/KeyboardManagerEditor/KeyboardManagerEditor.cpp * Check success of event creation, comment (#10947) * [KBM] code formatting (#10951) * [KBM] code formatting * Update src/modules/keyboardmanager/KeyboardManagerEditorLibrary/BufferValidationHelpers.cpp * [KBM] tracing * [KBM] Remappings not showing fix. (#10954) * removed mutex * retry loop for reading * retry on reading config once * log error Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com> Co-authored-by: Seraphima Zykova <zykovas91@gmail.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com> Co-authored-by: Enrico Giordani <enrico.giordani@gmail.com>
68 lines
2.4 KiB
C++
68 lines
2.4 KiB
C++
#pragma once
|
|
|
|
// This class is used for handling XAML Island operations
|
|
class XamlBridge
|
|
{
|
|
public:
|
|
// Function to run the message loop for the xaml island window
|
|
int MessageLoop();
|
|
|
|
// Constructor
|
|
XamlBridge(HWND parent) :
|
|
parentWindow(parent), lastFocusRequestId(winrt::guid()), winxamlmanager(nullptr)
|
|
{
|
|
}
|
|
|
|
// Function to initialise the xaml source object
|
|
HWND InitDesktopWindowsXamlSource(winrt::Windows::UI::Xaml::Hosting::DesktopWindowXamlSource);
|
|
|
|
// Function to close and delete all the xaml source objects
|
|
void ClearXamlIslands();
|
|
|
|
// Message Handler function for Xaml Island windows
|
|
LRESULT MessageHandler(UINT const message, WPARAM const wParam, LPARAM const lParam) noexcept;
|
|
|
|
private:
|
|
// Stores the last window handle in focus
|
|
HWND m_hwndLastFocus = nullptr;
|
|
|
|
// Stores the handle of the parent native window
|
|
HWND parentWindow = nullptr;
|
|
|
|
// Window xaml manager for UI thread.
|
|
WindowsXamlManager winxamlmanager;
|
|
|
|
// Stores the GUID of the last focus request
|
|
winrt::guid lastFocusRequestId;
|
|
|
|
// Function to return the xaml island currently in focus
|
|
winrt::Windows::UI::Xaml::Hosting::DesktopWindowXamlSource GetFocusedIsland();
|
|
|
|
// Function to pre process the message on the xaml source object
|
|
bool FilterMessage(const MSG* msg);
|
|
|
|
// Event triggered when focus is requested
|
|
void OnTakeFocusRequested(winrt::Windows::UI::Xaml::Hosting::DesktopWindowXamlSource const& sender, winrt::Windows::UI::Xaml::Hosting::DesktopWindowXamlSourceTakeFocusRequestedEventArgs const& args);
|
|
|
|
// Function to return the next xaml island in focus
|
|
winrt::Windows::UI::Xaml::Hosting::DesktopWindowXamlSource GetNextFocusedIsland(MSG* msg);
|
|
|
|
// Function to handle focus navigation
|
|
bool NavigateFocus(MSG* msg);
|
|
|
|
// Stores the focus event objects
|
|
std::vector<winrt::Windows::UI::Xaml::Hosting::DesktopWindowXamlSource::TakeFocusRequested_revoker> m_takeFocusEventRevokers;
|
|
|
|
// Stores the xaml source objects
|
|
std::vector<winrt::Windows::UI::Xaml::Hosting::DesktopWindowXamlSource> m_xamlSources;
|
|
|
|
// Function invoked when the window is destroyed
|
|
void OnDestroy(HWND);
|
|
|
|
// Function invoked when the window is activated
|
|
void OnActivate(HWND, UINT state, HWND hwndActDeact, BOOL fMinimized);
|
|
|
|
// Function invoked when the window is set to focus
|
|
void OnSetFocus(HWND, HWND hwndOldFocus);
|
|
};
|