Skip to content

Commit

Permalink
Add debug info for mouse got captured problem
Browse files Browse the repository at this point in the history
  • Loading branch information
mgth committed May 19, 2024
1 parent 57c0f52 commit 4fa3e84
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Platforms>x64;x86;AnyCpu</Platforms>
<OutputType>Library</OutputType>
<Configurations>Debug;Release;ReleaseDebug</Configurations>
<Version>5.2.1.0</Version>
<Version>5.2.2.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion LittleBigMouse.Hook/Engine/MouseEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void MouseEngine::SaveClip()
#if _DEBUG_
if (!_oldClipRect.IsEmpty())
{
LOG_TRACE("/!\\ Saved clip override");
LOG_DEBUG("/!\\ Saved clip override");
}
#endif
_oldClipRect = GetClip();
Expand Down
5 changes: 5 additions & 0 deletions LittleBigMouse.Hook/Engine/MouseHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ geo::Point<long> GetMouseLocation()

void SetClip(const geo::Rect<long>& r)
{
#if _DEBUG
if (r.IsEmpty()) {LOG_DEBUG("r is EMPTY");}
else if (r.Width() < 0 || r.Height() < 0) {LOG_DEBUG("r is negative");}
else if (r.Width() < 100 || r.Height() < 100) {LOG_DEBUG("r is small");}
#endif
const auto rect = RECT{r.Left(),r.Top(),r.Right(),r.Bottom()};
ClipCursor(&rect);
}
Expand Down
2 changes: 1 addition & 1 deletion LittleBigMouse.Hook/Geometry/Rect.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ namespace geo

static Rect<T> Empty() { return Rect(0, 0, 0, 0); }

bool IsEmpty() {return _width == 0 || _height == 0;}
bool IsEmpty() const {return _width == 0 || _height == 0;}

#define max(a, b) (((a) > (b)) ? (a) : (b))
#define min(a, b) (((a) < (b)) ? (a) : (b))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Platforms>x64;x86;AnyCpu</Platforms>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<LangVersion>preview</LangVersion>
<Version>5.2.1.0</Version>
<Version>5.2.2.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<LangVersion>preview</LangVersion>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<Version>5.2.1.0</Version>
<Version>5.2.2.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<Platforms>x64;x86;AnyCpu</Platforms>
<Version>5.2.1.0</Version>
<Version>5.2.2.0</Version>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>x64;x86;AnyCpu</Platforms>
<Version>5.2.1.0</Version>
<Version>5.2.2.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PackageIcon>lbm.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/mgth/LittleBigMouse</RepositoryUrl>
<Version>5.2.1.0</Version>
<Version>5.2.2.0</Version>
<ApplicationManifest>app.manifest</ApplicationManifest>
<StartupObject>LittleBigMouse.Ui.Avalonia.Program</StartupObject>
<Title>Little Big Mouse</Title>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
<Platforms>x64;x86;AnyCpu</Platforms>
<LangVersion>preview</LangVersion>
<Version>5.2.1.0</Version>
<Version>5.2.2.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 4fa3e84

Please sign in to comment.