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

Bug: Files opens behind all other open apps on first start #14978

Open
jonesy-b-dev opened this issue Mar 17, 2024 · 11 comments
Open

Bug: Files opens behind all other open apps on first start #14978

jonesy-b-dev opened this issue Mar 17, 2024 · 11 comments
Labels
bug Something isn't working 👀

Comments

@jonesy-b-dev
Copy link

Description

WHen i open files for the first time it opens begind all other open apps. This is annoying and requires an extra click to open the app.

Steps To Reproduce

  1. Open files

Requirements

Files should be opened in front of the other open windows like any other app does.

Files Version

3.2.3.0

Windows Version

10.0.23585.1001

Log File

debug.log

@jonesy-b-dev jonesy-b-dev added the bug Something isn't working 👀 label Mar 17, 2024
@Josh65-2201
Copy link
Member

Thanks for the report, can you see if this is an issue in the preview version. https://files.community/download

@Josh65-2201 Josh65-2201 added the needs - additional info Needs more information from the reporter label Mar 17, 2024
@jonesy-b-dev
Copy link
Author

Yes it is!

@Josh65-2201
Copy link
Member

Thanks for checking, how are you opening Files and do you have Files settings > Advanced > Set as default enabled?

@jonesy-b-dev
Copy link
Author

Often im opening through the taskbar, but even when another app opens files it goes to the background.
And yes Set as default is on

@soredake
Copy link

Same problem with other software:
M2Team/NanaZip#86
microsoft/terminal#6611

@jonesy-b-dev
Copy link
Author

Personally don`t have the issue in terminal

@Josh65-2201 Josh65-2201 removed the needs - additional info Needs more information from the reporter label Mar 30, 2024
@Josh65-2201 Josh65-2201 changed the title Files opens behind all other open apps Bug: Files opens behind all other open apps on first start Mar 30, 2024
@sebibasti0815
Copy link

Same problem here, but not only on first start. The app (window) opens in the background (behind all other windows from different apps) if I let files stay running after closing the window. The window should be pushed to the front, when I open Files.

@0x5bfa
Copy link
Member

0x5bfa commented Jul 9, 2024

Thought I fixed this issue.
It's interesting that the app opens behind the all other apps.
Is there possibly a bug with WinAppSdk or Windows (as Windows Terminal seemed to have this issue)?

@sebibasti0815
Copy link

sebibasti0815 commented Jul 9, 2024

I "solved" the problem with adding

Win32Helper.BringToForegroundEx(new HWND(this.WindowHandle));

to MainWindow.xaml.cs - InitializeApplicationAsync at the end:

if (!this.AppWindow.IsVisible) {
// When resuming the cached instance
this.AppWindow.Show();
Activate();
}
Win32Helper.BringToForegroundEx(new HWND(this.WindowHandle)); // here
if (Windows.Win32.PInvoke.IsIconic(new HWND(this.WindowHandle)))
Instance.Restore(); // Restore window if minimized

Sure not perfect, but it works for now (until a developer has time to look into it).

@0x5bfa
Copy link
Member

0x5bfa commented Jul 9, 2024

Yeah I made that helper.
But iirc Yair and me decided not to add it globally in that method in order to avoid being brought to the foreground even though user focused another app right after the app launched (launching takes much time than activating).

@jonesy-b-dev
Copy link
Author

I also still struggle with this issue, it was fixed in the beta build I tried but now it's back again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 👀
Projects
Status: 🆕 New
Development

No branches or pull requests

5 participants