Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create alt-tab-delayer.wh.cpp #993

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

L3r0yThingz
Copy link
Contributor

No description provided.


// ==WindhawkModSettings==
/*
- delay: 400
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a lot, let's change it to 150, that's what Ubuntu/Gnome does.
https://discourse.gnome.org/t/how-to-modify-alt-tab-window-switch-delay-and-also-popup-delay/2569/2

Comment on lines 14 to 15
When you press the Alt+Tab combination, the Alt+Tab window will be delayed by
the specified number of milliseconds.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add motivation, something like:

This helps reduce visual distractions by preventing brief flickers when quickly switching between apps, similar to how macOS and Ubuntu handle fast app switching.

Full summary by AI if you want to adapt it:

Suggested change
When you press the Alt+Tab combination, the Alt+Tab window will be delayed by
the specified number of milliseconds.
# Alt tab window delayer
This mod improves the Alt+Tab behavior by introducing a short delay before
displaying the tasks window. It helps reduce visual distractions by preventing
brief flickers when quickly switching between apps, similar to how macOS and
Ubuntu handle fast app switching.

// ==WindhawkMod==
// @id alt-tab-delay
// @name Alt tab window delayer
// @description Delays the appearance of the Alt+Tab window
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT?

Suggested change
// @description Delays the appearance of the Alt+Tab window
// @description Delays the appearance of the Alt+Tab window, preventing flickering and reducing distractions during fast app switching

@@ -0,0 +1,121 @@
// ==WindhawkMod==
// @id alt-tab-delay
// @name Alt tab window delayer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// @name Alt tab window delayer
// @name Alt+Tab window delayer

@@ -0,0 +1,121 @@
// ==WindhawkMod==
// @id alt-tab-delay
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// @id alt-tab-delay
// @id alt-tab-delayer

Comment on lines 53 to 62
using ShowWindow_t = decltype(&ShowWindow);
ShowWindow_t ShowWindow_Original;
void CALLBACK TimerProc(HWND hWnd, UINT uMsg, UINT_PTR idTimer, DWORD dwTime) {
KillTimer(nullptr, g_timerId);
g_timerId = 0;
Wh_Log(L"Timer proc %d", g_nCmdShow);
ShowWindow_Original(g_taskSwitcherHwnd, SW_SHOW);
}

BOOL ShowWindow_Hook(HWND hWnd, int nCmdShow) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
using ShowWindow_t = decltype(&ShowWindow);
ShowWindow_t ShowWindow_Original;
void CALLBACK TimerProc(HWND hWnd, UINT uMsg, UINT_PTR idTimer, DWORD dwTime) {
KillTimer(nullptr, g_timerId);
g_timerId = 0;
Wh_Log(L"Timer proc %d", g_nCmdShow);
ShowWindow_Original(g_taskSwitcherHwnd, SW_SHOW);
}
BOOL ShowWindow_Hook(HWND hWnd, int nCmdShow) {
void CALLBACK TimerProc(HWND hWnd, UINT uMsg, UINT_PTR idTimer, DWORD dwTime) {
KillTimer(nullptr, g_timerId);
g_timerId = 0;
Wh_Log(L"Timer proc %d", g_nCmdShow);
ShowWindow_Original(g_taskSwitcherHwnd, SW_SHOW);
}
using ShowWindow_t = decltype(&ShowWindow);
ShowWindow_t ShowWindow_Original;
BOOL ShowWindow_Hook(HWND hWnd, int nCmdShow) {

KillTimer(nullptr, g_timerId);
g_timerId = 0;
Wh_Log(L"Timer proc %d", g_nCmdShow);
ShowWindow_Original(g_taskSwitcherHwnd, SW_SHOW);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

g_nCmdShow is now unused. For me, using g_nCmdShow here works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants