Skip to content

Add actions to minimize the active window/change the active window - #130

Merged
luttje merged 3 commits into
mainfrom
121-action-minimize-focus-window
Mar 25, 2026
Merged

luttje merged 3 commits into
mainfrom
121-action-minimize-focus-window

Conversation

@luttje

@luttje luttje commented Mar 22, 2026

Copy link
Copy Markdown
Collaborator

Fixes #121

@luttje luttje self-assigned this Mar 22, 2026
@luttje
luttje requested a review from abart27 March 22, 2026 16:06
@luttje
luttje requested a review from abart27 March 23, 2026 16:14
var text = this.txtWindowTitle.Text;
var separatorIndex = text.IndexOf(WindowUtilities.TITLE_SEPARATOR, StringComparison.Ordinal);

if (separatorIndex > 0)

@luttje luttje Mar 24, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Actually, this will still fail if the user enters NO executable, but does enter a window title that contains a " | ". Everything before that separator will be considered the executable to look for, which will fail later when finding the window. That can be fixed to compare against the executable + sep + windowtitle if all current comparisons fail.
I should really write some tests for this.

@luttje luttje Mar 24, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'm simplifying it more atm, ready in a moment.

Done

@abart27

abart27 commented Mar 24, 2026

Copy link
Copy Markdown
Collaborator

I don't quite understand why we don't store the HWND of the selected window. Wouldn't that be more reliable than this arbitrarily built identifier?

@luttje

luttje commented Mar 24, 2026 •

Copy link
Copy Markdown
Collaborator Author

Fair point I guess. I tried to get the scripting API and front-end to work the same, but maybe it's not worth the hassle.

Actually, how would that work when serializing the profile? @Aurumaker72

@abart27

abart27 commented Mar 24, 2026

Copy link
Copy Markdown
Collaborator

Fair point I guess. I tried to get the scripting API and front-end to work the same, but maybe it's not worth the hassle.

Actually, how would that work when serializing the profile? @Aurumaker72

Ahhh... You're right! It wouldn't. :P

With that requirement, this implementation is sufficient yeah. It's similar to what OBS does fwiw.

@luttje
luttje merged commit c929d23 into main Mar 25, 2026
2 checks passed
@luttje
luttje deleted the 121-action-minimize-focus-window branch March 25, 2026 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add command to minimize the active window/change the active window

2 participants