Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#5280 closed Bug (fixed)

The /nofocus switch doesn't work

Reported by: Aenfa Owned by: Underground78
Priority: high Milestone: 1.7.9
Component: User Interface Version: 1.7.8
Severity: normal Keywords: focus
Cc: Underground78 Evaluation: reproduced

Description

It seems the /nofocus switch has no effect at all when trying to run MPC-HC in the background. It still steals focus from the active window when run. I tried mpc-hc64.exe <file> /minimized /nofocus but the minimized player still steals focus from the active window. I have also tried creating a shortcut with run set to minimized but still takes focus even with the /nofocus switch.

Change History (7)

comment:1 Changed 5 years ago by Underground78

Cc: Underground78 added
Evaluation: reproduced
Status: newevaluated

I can reproduce the issue. However I'm not sure it's what "/nofocus" is supposed to do. I think this command works when the app is already running but I'm not completely sure it's actually possible to start an app without giving it focus.

Do you know some apps which can do that?

comment:2 Changed 5 years ago by ioannis

Maybe try
ShowWindow(SW_SHOWNOACTIVATE);

when flag is set ?

comment:3 Changed 5 years ago by Underground78

Indeed, I completely forgot that we call ShowWindow and not the framework... It will require some work though because currently we always set the window in the foreground when opening a file I think.

Edit: Even when just opening MPC-HC without file it doesn't seem to be enough.

Last edited 5 years ago by Underground78 (previous) (diff)

comment:4 Changed 5 years ago by Underground78

Owner: set to Underground78
Status: evaluatedaccepted

I finally made some progress with this.

@Aenfa: Could you try this test build and report back?

comment:5 Changed 5 years ago by Underground78 <underground78@…

Resolution: fixed
Status: acceptedclosed

In 47867b:

Fix the /nofocus command line.

It did nothing when starting MPC-HC.

Fixes #5280.

comment:6 Changed 5 years ago by Underground78

Milestone: next release

Will be in the nightly builds as of version 1.7.8.103.

comment:7 Changed 5 years ago by thevbm

Milestone: next release1.7.9

Milestone renamed

Note: See TracTickets for help on using tickets.