mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
Handle desktop switch and open on active monitor functionality (#5065)
This commit is contained in:
@@ -334,7 +334,7 @@
|
|||||||
<value>Move newly created windows to their last known zone</value>
|
<value>Move newly created windows to their last known zone</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FancyZones_OpenWindowOnActiveMonitor.Content" xml:space="preserve">
|
<data name="FancyZones_OpenWindowOnActiveMonitor.Content" xml:space="preserve">
|
||||||
<value>Move newly created windows to the current active monitor</value>
|
<value>Move newly created windows to the current active monitor [EXPERIMENTAL]</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FancyZones_UseCursorPosEditorStartupScreen.Content" xml:space="preserve">
|
<data name="FancyZones_UseCursorPosEditorStartupScreen.Content" xml:space="preserve">
|
||||||
<value>Follow mouse cursor instead of focus when launching editor in a multi screen environment</value>
|
<value>Follow mouse cursor instead of focus when launching editor in a multi screen environment</value>
|
||||||
|
|||||||
@@ -499,6 +499,13 @@ IFACEMETHODIMP_(void)
|
|||||||
FancyZones::WindowCreated(HWND window) noexcept
|
FancyZones::WindowCreated(HWND window) noexcept
|
||||||
{
|
{
|
||||||
std::shared_lock readLock(m_lock);
|
std::shared_lock readLock(m_lock);
|
||||||
|
GUID desktopId{};
|
||||||
|
if (VirtualDesktopUtils::GetWindowDesktopId(window, &desktopId) && desktopId != m_currentDesktopId)
|
||||||
|
{
|
||||||
|
// Switch between virtual desktops results with posting same windows messages that also indicate
|
||||||
|
// creation of new window. We need to check if window being processed is on currently active desktop.
|
||||||
|
return;
|
||||||
|
}
|
||||||
const bool moveToAppLastZone = m_settings->GetSettings()->appLastZone_moveWindows;
|
const bool moveToAppLastZone = m_settings->GetSettings()->appLastZone_moveWindows;
|
||||||
const bool openOnActiveMonitor = m_settings->GetSettings()->openWindowOnActiveMonitor;
|
const bool openOnActiveMonitor = m_settings->GetSettings()->openWindowOnActiveMonitor;
|
||||||
if ((moveToAppLastZone || openOnActiveMonitor) && ShouldProcessNewWindow(window))
|
if ((moveToAppLastZone || openOnActiveMonitor) && ShouldProcessNewWindow(window))
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ BEGIN
|
|||||||
IDS_SETTING_DESCRIPTION_ZONEHIGHLIGHTCOLOR "Zone highlight color (Default #008CFF)"
|
IDS_SETTING_DESCRIPTION_ZONEHIGHLIGHTCOLOR "Zone highlight color (Default #008CFF)"
|
||||||
IDS_SETTING_DESCRIPTION_USE_CURSORPOS_EDITOR_STARTUPSCREEN "Follow mouse cursor instead of focus when launching editor in a multi screen environment"
|
IDS_SETTING_DESCRIPTION_USE_CURSORPOS_EDITOR_STARTUPSCREEN "Follow mouse cursor instead of focus when launching editor in a multi screen environment"
|
||||||
IDS_SETTING_DESCRIPTION_APPLASTZONE_MOVEWINDOWS "Move newly created windows to their last known zone"
|
IDS_SETTING_DESCRIPTION_APPLASTZONE_MOVEWINDOWS "Move newly created windows to their last known zone"
|
||||||
IDS_SETTING_DESCRIPTION_OPEN_WINDOW_ON_ACTIVE_MONITOR "Move newly created windows to the current active monitor"
|
IDS_SETTING_DESCRIPTION_OPEN_WINDOW_ON_ACTIVE_MONITOR "Move newly created windows to the current active monitor [EXPERIMENTAL]"
|
||||||
IDS_SETTING_DESCRIPTION_RESTORESIZE "Restore the original size of windows when unsnapping"
|
IDS_SETTING_DESCRIPTION_RESTORESIZE "Restore the original size of windows when unsnapping"
|
||||||
IDS_SETTING_LAUNCH_EDITOR_LABEL "Zone configuration"
|
IDS_SETTING_LAUNCH_EDITOR_LABEL "Zone configuration"
|
||||||
IDS_SETTING_LAUNCH_EDITOR_BUTTON "Edit zones"
|
IDS_SETTING_LAUNCH_EDITOR_BUTTON "Edit zones"
|
||||||
|
|||||||
Reference in New Issue
Block a user