Skip to content

Conversation

@jaimecbernardo
Copy link
Contributor

@jaimecbernardo jaimecbernardo commented Oct 25, 2021

Summary of the Pull Request

What is this about:

When game mode is activate on Windows, Find My Mouse might interfere with playing the game when it activates or might be inadvertently activated.

What is include in the PR:
Add a setting to prevent find my mouse activation when game mode is on.

How does someone test / validate:
With the setting turned on, try to activate Find My Mouse when running a game which activates Game Mode on Windows.

image

Quality Checklist

Contributor License Agreement (CLA)

A CLA must be signed. If not, go over here and sign the CLA.

@github-actions
Copy link

github-actions bot commented Oct 25, 2021

@check-spelling-bot Report

Unrecognized words, please review:

  • QUNS
Previously acknowledged words that are now absent Accessible available btn CIEXYZ coc CTriage dchristensen djsoref docsmsft dogancelik dupenv estdir Fody ftp ftps gmx htt ianjoneill inprivate installpowertoys itsme jakeoeding KERNELBASE listbox mfreadwrite mfuuid Nefario nitroin null nunit powertoyswiki Radiobuttons Reportx Rgn sidepanel spamming systray ulazy windevbuildagents winstore xia XSmall xunit
Some files were were automatically ignored

These sample patterns would exclude them:

^src/modules/previewpane/UnitTests-MarkdownPreviewHandler/HelperFiles/MarkdownWithHTMLImageTag\.txt$

You should consider adding them to:

.github/actions/spell-check/excludes.txt

File matching is via Perl regular expressions.

To check these files, more of their words need to be in the dictionary than not. You can use patterns.txt to exclude portions, add items to the dictionary (e.g. by adding them to allow.txt), or fix typos.

To accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands

... in a clone of the [email protected]:jaimecbernardo/PowerToys.git repository
on the add-game-mode-detection branch:

update_files() {
perl -e '
my @expect_files=qw('".github/actions/spell-check/expect.txt"');
@ARGV=@expect_files;
my @stale=qw('"$patch_remove"');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
next if /^(?:$re)(?:(?:\r|\n)*$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spell-check/expect.txt";
use File::Path qw(make_path);
use File::Basename qw(dirname);
make_path (dirname($new_expect_file));
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"$patch_add"');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a)."-".$a cmp lc($b)."-".$b} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;
system("git", "add", $new_expect_file);
'
(cat '.github/actions/spell-check/excludes.txt' - <<EOF
$should_exclude_patterns
EOF
) |grep .|
sort -f |
uniq > '.github/actions/spell-check/excludes.txt.temp' &&
mv '.github/actions/spell-check/excludes.txt.temp' '.github/actions/spell-check/excludes.txt'
}

comment_json=$(mktemp)
curl -L -s -S \
  --header "Content-Type: application/json" \
  "https://api.github.com/repos/microsoft/PowerToys/issues/comments/950840358" > "$comment_json"
comment_body=$(mktemp)
jq -r .body < "$comment_json" > $comment_body
rm $comment_json

patch_remove=$(perl -ne 'next unless s{^</summary>(.*)</details>$}{$1}; print' < "$comment_body")
  

patch_add=$(perl -e '$/=undef;
$_=<>;
s{<details>.*}{}s;
s{^#.*}{};
s{\n##.*}{};
s{(?:^|\n)\s*\*}{}g;
s{\s+}{ }g;
print' < "$comment_body")
  

should_exclude_patterns=$(perl -e '$/=undef;
$_=<>;
exit unless s{(?:You should consider excluding directory paths|You should consider adding them to).*}{}s;
s{.*These sample patterns would exclude them:}{}s;
s{.*\`\`\`([^`]*)\`\`\`.*}{$1}m;
print' < "$comment_body" | grep . || true)

update_files
rm $comment_body
git add -u
If you see a bunch of garbage

If it relates to a ...

well-formed pattern

See if there's a pattern that would match it.

If not, try writing one and adding it to the patterns.txt file.

Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

Note that patterns can't match multiline strings.

binary-ish string

Please add a file path to the excludes.txt file instead of just accepting the garbage.

File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

Copy link
Contributor

@yuyoyuppe yuyoyuppe left a comment

Choose a reason for hiding this comment

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

LGTM

@Jay-o-Way
Copy link
Collaborator

Since there is no issue linked (yet)...

Windows 10 has a "gaming mode" itself, can we hook up to that?

#13620 (comment)

@htcfreek
Copy link
Collaborator

htcfreek commented Oct 25, 2021

Since there is no issue linked (yet)...

Windows 10 has a "gaming mode" itself, can we hook up to that?

#13620 (comment)

We have an issue for adding additional option to the "find mous" utility. Let's use that.

#13924

@htcfreek
Copy link
Collaborator

@jaimecbernardo
How does this game mode works? Is automatically on regardless of the game I play? Does it work for old games from the XP time?

Otherwise we should allow blocking it optional on full screen windowd too. (Off by default.)

@jaimecbernardo
Copy link
Contributor Author

@jaimecbernardo How does this game mode works? Is automatically on regardless of the game I play? Does it work for old games from the XP time?

Otherwise we should allow blocking it optional on full screen windowd too. (Off by default.)

I think it's checking whether there's a fullscreen app with an exclusive CG context (native fullscreen).
The main reason for not doing full screen was that this feature can still be useful on other full screen uses like doing presentations.
We won't add fullscreen option right now since we're getting this wrapped for 0.49, but I think the suggestion with default off is a good one.
Do you mind adding a issue for tracking?

@Jay-o-Way
Copy link
Collaborator

You can use the SHQueryUserNotificationState function to determine whether the user is playing a full screen D3D game. It will report QUNS_RUNNING_D3D_FULL_SCREEN.

@htcfreek
Copy link
Collaborator

htcfreek commented Oct 25, 2021

@jaimecbernardo How does this game mode works? Is automatically on regardless of the game I play? Does it work for old games from the XP time?

Otherwise we should allow blocking it optional on full screen windowd too. (Off by default.)

I think it's checking whether there's a fullscreen app with an exclusive CG context (native fullscreen).
The main reason for not doing full screen was that this feature can still be useful on other full screen uses like doing presentations.
We won't add fullscreen option right now since we're getting this wrapped for 0.49, but I think the suggestion with default off is a good one.
Do you mind adding a issue for tracking?

Why not using the additional options issue i stead of creating a new one?

(cc: @niels9001)

@niels9001
Copy link
Collaborator

niels9001 commented Oct 25, 2021

@htcfreek Added it to #13924

@jaimecbernardo jaimecbernardo merged commit af8366f into microsoft:master Oct 25, 2021
@Jay-o-Way Jay-o-Way added the Product-Mouse Utilities Refers to the Mouse Utilities PowerToy label Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Product-Mouse Utilities Refers to the Mouse Utilities PowerToy

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants