分離した窓の配置を覚える仕組みを追加
このコミットが含まれているのは:
4ファイル変更
+92
検索条件に一致するファイルはありません
@@ -96,6 +96,7 @@
|
||||
<ClCompile Include="src\DockModel.cpp" />
|
||||
<ClCompile Include="src\DockPlan.cpp" />
|
||||
<ClCompile Include="src\DragSession.cpp" />
|
||||
<ClCompile Include="src\FloatOrigin.cpp" />
|
||||
<ClCompile Include="src\FloatWindowHook.cpp" />
|
||||
<ClCompile Include="src\GuideWindow.cpp" />
|
||||
<ClCompile Include="src\HostContext.cpp" />
|
||||
@@ -113,6 +114,7 @@
|
||||
<ClInclude Include="src\DockModel.h" />
|
||||
<ClInclude Include="src\DockPlan.h" />
|
||||
<ClInclude Include="src\DragSession.h" />
|
||||
<ClInclude Include="src\FloatOrigin.h" />
|
||||
<ClInclude Include="src\FloatWindowHook.h" />
|
||||
<ClInclude Include="src\GuideWindow.h" />
|
||||
<ClInclude Include="src\HostContext.h" />
|
||||
|
||||
@@ -31,6 +31,9 @@
|
||||
<ClCompile Include="src\DragSession.cpp">
|
||||
<Filter>ソース ファイル</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\FloatOrigin.cpp">
|
||||
<Filter>ソース ファイル</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\FloatWindowHook.cpp">
|
||||
<Filter>ソース ファイル</Filter>
|
||||
</ClCompile>
|
||||
@@ -75,6 +78,9 @@
|
||||
<ClInclude Include="src\DragSession.h">
|
||||
<Filter>ヘッダー ファイル</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\FloatOrigin.h">
|
||||
<Filter>ヘッダー ファイル</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\FloatWindowHook.h">
|
||||
<Filter>ヘッダー ファイル</Filter>
|
||||
</ClInclude>
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
#include "FloatOrigin.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace dl {
|
||||
|
||||
struct Entry {
|
||||
HWND window;
|
||||
FloatOrigin origin;
|
||||
};
|
||||
|
||||
static std::vector<Entry> g_entries;
|
||||
|
||||
static bool g_pending = false;
|
||||
static FloatOrigin g_pendingOrigin;
|
||||
|
||||
void SetPendingFloat(const FloatOrigin& origin) {
|
||||
g_pending = true;
|
||||
g_pendingOrigin = origin;
|
||||
}
|
||||
|
||||
bool TakePendingFloat(FloatOrigin* out) {
|
||||
if (!g_pending) return false;
|
||||
g_pending = false;
|
||||
if (out) *out = g_pendingOrigin;
|
||||
return true;
|
||||
}
|
||||
|
||||
void RememberFloat(HWND window, const FloatOrigin& origin) {
|
||||
if (!window) return;
|
||||
for (Entry& entry : g_entries) {
|
||||
if (entry.window != window) continue;
|
||||
entry.origin = origin;
|
||||
return;
|
||||
}
|
||||
g_entries.push_back(Entry{ window, origin });
|
||||
}
|
||||
|
||||
void ForgetFloat(HWND window) {
|
||||
for (size_t i = 0; i < g_entries.size(); i++) {
|
||||
if (g_entries[i].window != window) continue;
|
||||
g_entries.erase(g_entries.begin() + i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bool FloatOriginOf(HWND window, FloatOrigin* out) {
|
||||
for (const Entry& entry : g_entries) {
|
||||
if (entry.window != window) continue;
|
||||
if (out) *out = entry.origin;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void ClearFloatOrigins() {
|
||||
g_entries.clear();
|
||||
g_pending = false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
namespace dl {
|
||||
|
||||
struct FloatOrigin {
|
||||
double left = 0;
|
||||
double top = 0;
|
||||
double right = 0;
|
||||
double bottom = 0;
|
||||
int area = -1;
|
||||
};
|
||||
|
||||
void SetPendingFloat(const FloatOrigin& origin);
|
||||
bool TakePendingFloat(FloatOrigin* out);
|
||||
|
||||
void RememberFloat(HWND window, const FloatOrigin& origin);
|
||||
void ForgetFloat(HWND window);
|
||||
bool FloatOriginOf(HWND window, FloatOrigin* out);
|
||||
void ClearFloatOrigins();
|
||||
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする