Skip to content

Commit

Permalink
Prevent mouse move in fullscreen mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Aemony committed Jun 24, 2024
1 parent 742c1eb commit 8201862
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/SKIV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ wWinMain ( _In_ HINSTANCE hInstance,
while (! SKIF_Shutdown.load() ) // && IsWindow (hWnd) )
{
// Reset on each frame
SKIF_MouseDragMoveAllowed = (! _registry._SnippingMode);
SKIF_MouseDragMoveAllowed = (! _registry._SnippingMode && ! SKIF_ImGui_IsFullscreen (SKIF_ImGui_hWnd));
imageFadeActive = false; // Assume there's no cover fade effect active
msg = { };
static UINT uiLastMsg = 0x0;
Expand Down Expand Up @@ -1655,7 +1655,7 @@ wWinMain ( _In_ HINSTANCE hInstance,
ImGui::SetNextWindowSizeConstraints (wnd_minimum_size, ImVec2 (FLT_MAX, FLT_MAX));

const bool bNoMove =
(io.KeyCtrl || _registry._SnippingMode);
(io.KeyCtrl || ! SKIF_MouseDragMoveAllowed);

ImGui::PushStyleVar (ImGuiStyleVar_WindowPadding, ImVec2());
ImGui::PushStyleVar (ImGuiStyleVar_WindowBorderSize, 0.0f); // Disable ImGui's 1 px window border
Expand Down Expand Up @@ -3675,6 +3675,8 @@ SKIF_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)

auto _EnterSnippingMode = [&](void) -> void
{
PLOG_VERBOSE << "Received request to enter snipping mode...";

if (! std::exchange (_registry._SnippingMode, true))
{
extern HRESULT
Expand All @@ -3686,6 +3688,8 @@ SKIF_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)

if (SUCCEEDED (hr))
{
PLOG_VERBOSE << "Desktop capture was successful!";

extern HWND hwndBeforeSnip;
extern HWND hwndTopBeforeSnip;
extern bool iconicBeforeSnip;
Expand Down

0 comments on commit 8201862

Please sign in to comment.