sigoden / window-switcher

Easily switch between windows of the same app with Alt+` (Backtick), also switch between apps with Alt+Tab.
MIT License
556 stars 22 forks source link

Not working #46

Closed Shuraken007 closed 1 year ago

Shuraken007 commented 1 year ago

Hello there. Trying this app, but nothing works. It runned without errors, I see it at system tray, but alt+tab get default system behavior. alt+` not works

Windows specifications:

Edition Windows 11 Pro
Version 22H2
Installed on    ‎1/‎3/‎2023
OS build    22621.1555
Experience  Windows Feature Experience Pack 1000.22640.1000.0
$ ls
        Directory: C:\tools\window-switcher

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a---         5/12/2023   6:20 AM         297472 ﬓ  window-switcher_32.exe
-a---         5/12/2023   6:04 AM         342016 ﬓ  window-switcher_64.exe
-a---         5/12/2023   6:20 AM            288   window-switcher.ini

cat .\window-switcher.ini  
# Whether to show trayicon, yes/no
trayicon = yes

[switch-windows]

# Hotkey to switch windows
hotkey = alt+`

# List of hotkey conflict apps
# e.g. game1.exe,game.exe
blacklist =

[switch-apps]

# Whether to enable switching apps
enable = yes

# Hotkey to switch apps
hotkey = alt+tab
sigoden commented 1 year ago

Append follow settings to window-switcher.ini to enable log

[log]
level = debug
path = window-switcher.log

The restart window-swither.exe, try again, submit window-switcher.log to this issue. please.

Shuraken007 commented 1 year ago

Hi there again. Probably it's important - I have 2 monitors. Tested it one more time. alt+` - works only with visible windows. Case I fold with minimize one of them (alt+space+n) - your app don't see it. Screenshot_1 Screenshot_2

Here is log for switching between same app - explorer. window-switcher_same_app_switch.log

alt+tab not works , have default windows 11 switcher IMG-0659

Here is fresh log for alt+tab attempt window-switcher_diverse_app.log

Shuraken007 commented 1 year ago

If you help me to setup environment to build app, e.g. fast way to install cargo / required libs e.t.c. What to run for building app. I'll try to debug code.

sigoden commented 1 year ago
  1. setup rust https://www.alpharithms.com/installing-rust-on-windows-403718/
  2. run windows-switcher
    git clone https://github.com/sigoden/window-switcher
    cd window-switcher
    cargo run
Shuraken007 commented 1 year ago

Well it was a nice journey. I debugged and founded some things.

  1. I used right_alt with code 165, and you accept left_alt. Just have ergo-keyboard, and alt+tab looks other way.

IMG_20230514_232538

  1. Case I minimize any app, use start+d as example - I can't switch to anything, you filtered all apps and blocked them from windows list. Iconic option turns from true to false and you blocked it. Btw, I prefered to see minimum visible apps.

I added this code to debug required processes and got all your options

    let is_visible = is_visible_window(hwnd);
    let is_special = is_special_window(hwnd);
    let is_small = is_small_window(hwnd);
    let is_cloaked = is_cloaked_window(hwnd);
    let is_popup = is_popup_window(hwnd);
    let is_iconic = is_iconic_window(hwnd);
    let is_topmost = is_topmost_window(hwnd);
    let pid = get_window_pid(hwnd);
    let module_path = get_module_path(pid);

        debug!("visible: {:?}, special: {:?}, small: {:?}, cloaked: {:?}, popup: {:?}, iconic: {:?}, topmost: {:?}, pid: {:?}, hwnd: {:?}, p: {:?}", 
            if is_visible_window(hwnd) {'+'} else {'-'},
            if is_special {'+'} else {'-'},
            if is_small {'+'} else {'-'},
            if is_cloaked {'+'} else {'-'},
            if is_popup {'+'} else {'-'},
            if is_iconic {'+'} else {'-'},
            if is_topmost {'+'} else {'-'},
            pid,
            hwnd,
            Path::new(& module_path).file_name().unwrap().to_str().unwrap(),
        ); 

Here is side by side difference at state, when it's possible to switch and when not. report_iconic.log

  1. I have music application, and it uses ApplicationFrameHost.exe.

This process is related to Universal Windows Platform Applications (also known as Store Applications - a new type of application that comes with Windows 10). Although most of the apps that come with Windows 10 (such as Mail, Calculator, OneNote, Movies & TV, Photos and Groove Music) are UWP apps, these are available from the Windows Store. If this process is forcibly ended, all open UWP apps will be closed.

So, all apps, based on this FrameHost - are same for you. As example basic app calculator and mine app for music. You can try it with 2 apps - calculator and 'Movies & TV'

App looks like this Screenshot_2 and got default exe icon ApplicationFrameHost_Icon

I made same debug output for ApplicationFrameHost, containing music app, and processes, containing app name. report_music.log

Looks, like child processes must be checked.

sigoden commented 1 year ago

Thanks for your contribution.

I apologize for replying so late.

47 solved point 1.

48 solved point 3.

The point 2 is tricky. I can't find a way to restore the minimized uwp window.

Shuraken007 commented 1 year ago

Good update. Btw, what is sense of iconic condition? I removed it from that filter, and all works.

sigoden commented 1 year ago

Iconic is no longer needed.

sigoden commented 1 year ago

50 solved restore the minimized uwp window.

All done.