-
Notifications
You must be signed in to change notification settings - Fork 49
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
Office 365 setup pops up unexpectedly #40
Comments
OK, I meant to post the issue to https://github.com/phazei/Win11AutoHotKeyFixes. But does this ring a bell? |
this is the minimum to reproduce it: #SingleInstance force
ListLines 0
SendMode "Input"
SetWorkingDir A_ScriptDir
KeyHistory 0
#WinActivateForce
ProcessSetPriority "H"
SetWinDelay -1
SetControlDelay -1
keybd_eventDown("LWin")
keybd_eventDown("LCtrl")
keybd_eventDown("LShift")
WinActivate "ahk_class Progman ahk_exe explorer.exe" ;office 365 bug
;WinActivate "ahk_class WorkerW ahk_exe explorer.exe" ;no bug
;WinActivate "ahk_exe notepad.exe" ;no bug
keybd_eventDown(key)
{
DllCall("keybd_event","UChar",GetKeyVK(key),"UChar",GetKeySC(key),"Uint",0,"Ptr",0)
}
keybd_eventUp(key)
{
DllCall("keybd_event","UChar",GetKeyVK(key),"UChar",GetKeySC(key),"Uint",2,"Ptr",0)
}
f3::Exitapp the above is v2 code @christodoulos does this bug only happen when the destination virtual desktop is empty ? |
After a reboot, when I manually start, say, a Windows explorer in both Virtual Desktop 1 and Virtual Desktop 2, and then start a terminal in Virtual Desktop 1, when I move it using WinCtrlShift-> then the terminal window moves just fine, and nothing else is happening (i.e., the bug does not happen). Keeping both explorer windows open at Virtual Desktop 1 and Virtual Desktop 2, I can use WinCtrlShift-> and WinCtrlShift<-, and the terminal window keeps moving between the virtual desktops without any Office 365 window popping up. But if I close the Explorer Window before moving the terminal window from Virtual Desktop 2 to Virtual Desktop 1 using WinCtrlShift<-, the Office 365 setup window starts popping up again! The Windows OS never stops to amaze me with awkward behaviors! |
this even happens on Windows 10
this makes me suspect that
VK_MENU | 0x12 | ALT key That's only ALT, but not ALT+TAB, I'm not even sure if the code execution reaches that line |
@christodoulos does this fix it ? |
Hello, thanks for your suggestions. I pulled your last repository update:
and uninstalled the Office 365 application. Using your latest commit, the problem remains with a different nature:
Of course, the new behavior is much more tolerable as I can live with using Virtual Desktops 2 and 3 and letting the browser windows pop up at Virtual Desktop 1. |
before I bring in a proper fix, does this work ? ; move window to left and follow it
^#+left::
keybd_eventUp("LShift")
VD.goToDesktopNum(VD.MoveWindowToRelativeDesktopNum("A", -1))
Send % "{LShift down}"
return
; move window to right and follow it
^#+right::
keybd_eventUp("LShift")
VD.goToDesktopNum(VD.MoveWindowToRelativeDesktopNum("A", 1))
Send % "{LShift down}"
return
;functions
keybd_eventUp(key)
{
DllCall("keybd_event","UChar",GetKeyVK(key),"UChar",GetKeySC(key),"Uint",2,"Ptr",0)
} so in "VD-move-window-with-desktop.ahk", you replace the 2 hotkeys with the above ^#+Left::
n := VD.getCurrentDesktopNum()
if n = 1 ;at begining, can't go left
Return
n -= 1
active := "ahk_id" WinExist("A")
VD.MoveWindowToDesktopNum(active,n), VD.goToDesktopNum(n)
WinActivate active ;once in a while it's not active
Return
^#+Right::
n := VD.getCurrentDesktopNum()
if n = % VD.getCount() ;at end, can't go right
Return
n += 1
active := "ahk_id" WinExist("A")
VD.MoveWindowToDesktopNum(active,n), VD.goToDesktopNum(n)
WinActivate active
Return |
which version of AHK are you using ? MsgBox % Clipboard:=A_AhkVersion maybe the implementation for WinActivate has changed |
I don't know if it is relevant but I installed AutoHotkey using scoop:
|
try this script, I added ;#SETUP START
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance force
ListLines Off
SetBatchLines -1
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#KeyHistory 0
#WinActivateForce
Process, Priority,, H
SetWinDelay -1
SetControlDelay -1
;include the library
#Include ../VD.ahk/VD.ahk
; VD.init() ;COMMENT OUT `static dummyStatic1 := VD.init()` if you don't want to init at start of script
VD.createUntil(3) ;create until we have at least 3 VD
return
^#+Left::
n := VD.getCurrentDesktopNum()
if n = 1 ;at begining, can't go left
Return
n -= 1
active := "ahk_id" WinExist("A")
keybd_eventUp("LShift")
VD.MoveWindowToDesktopNum(active,n)
VD.goToDesktopNum(n)
WinActivate active ;once in a while it's not active
keybd_eventDown("LShift")
Return
^#+Right::
n := VD.getCurrentDesktopNum()
if n = % VD.getCount() ;at end, can't go right
Return
n += 1
active := "ahk_id" WinExist("A")
keybd_eventUp("LShift")
VD.MoveWindowToDesktopNum(active,n)
VD.goToDesktopNum(n)
WinActivate active
keybd_eventDown("LShift")
Return
;functions
keybd_eventDown(key)
{
DllCall("keybd_event","UChar",GetKeyVK(key),"UChar",GetKeySC(key),"Uint",0,"Ptr",0)
}
keybd_eventUp(key)
{
DllCall("keybd_event","UChar",GetKeyVK(key),"UChar",GetKeySC(key),"Uint",2,"Ptr",0)
} I'm pretty sure it will work, but it's not the correct way to fix it |
in order to debug, checkout the branch https://github.com/FuPeiJiang/VD.ahk/tree/tooltip-debug, use your unedited what ToolTips do you see when pressing the hotkeys ? you may want desktop switching animations to be enabled for the ToolTip to last longer, but I think animations are enabled by default so it's not a problem |
nvm, there Are no VD animations in Win11 great news, I've been able to reproduce the issue again |
After receiving the GitHub notification, I rebooted my laptop to start from a clear state. Then I started a Terminal and could happily move it across all my virtual desktops without any other, at least noticeable, unintended behavior! Well, just like that, the bug is not present anymore! I did nothing regarding AutoHotKey or your repository! To follow your instructions above, I checked out the branch you proposed:
Using the unedited script, I see no ToolTips of any kind when I press the hotkeys. Do I get it right? I checkout your branch and then move a window around the virtual desktops, and some tooltips should appear? Unfortunately, they don't. Nevertheless, the bug does not happen using the class_VD branch or the tooltip-debug branch. I realize that bugs don't heal themselves. If you'd like to help you more, please don't hesitate to ask. |
some tooltips should appear ___ I'm not able to change the VD of: this is a huge bug, it's also linked to the office 365 problem because if the window below active window is Teams.exe, then even if I removed all WinActivate in _VD.ahk and your script, office 365 still pops up |
I deleted everything to make sure that I have only one VD.ahk folder. Then I double-clicked on the Just so you know, when I delete the files you propose (without exiting from the icon in the taskbar), the script continues to run, and I can move windows to other virtual desktops. After exiting from the icon in the taskbar, I cannot start the I don't know if it is relevant, but I also run two other AutoHotKey scripts: For changing input language using Caps Lock: sel := 0
#if (sel=0)
capslock::
send {lwin down}{Space}
sel := 1
return
#if
capslock up::
send {lwin up}
sel := 0
return And for hiding the cursor while typing: ; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
; Author: Stefan Z Camilleri - [email protected]
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; Initialize the mouse cursor
SystemCursor("Init")
; Get the current mouse position, and store its coordinates
MouseGetPos mX0, mY0
; Set a timer to check if the mouse is still idle every 250ms
SetTimer, CheckIdle, 250
; Register the keys you want to listen on
keys = ``1234567890-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./
; For every defined key, register a call to hide the mouse cursor
Loop Parse, keys
HotKey ~*%A_LoopField%, Hoty
return
; Checks if the mouse has moved, and if so, shows it and records the new position
CheckIdle:
MouseGetPos mX, mY
if (mX0 != mX && mY0 != mY)
{
SystemCursor("On")
mX0 := mX, mY0 := mY
}
return
; Hides the mouse cursor
Hoty:
SystemCursor("Off")
return
; Ensure the cursor is made visible when the script exits.
#Persistent
OnExit, ShowCursor
return
; Shows the mouse cursor
ShowCursor:
SystemCursor("On")
ExitApp
; Function to hide or show the mouse cursor
SystemCursor(OnOff=1) ; INIT = "I","Init"; OFF = 0,"Off"; TOGGLE = -1,"T","Toggle"; ON = others
{
static AndMask, XorMask, $, h_cursor
,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13 ; system cursors
, b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13 ; blank cursors
, h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11,h12,h13 ; handles of default cursors
if (OnOff = "Init" or OnOff = "I" or $ = "") ; init when requested or at first call
{
$ = h ; active default cursors
VarSetCapacity( h_cursor,4444, 1 )
VarSetCapacity( AndMask, 32*4, 0xFF )
VarSetCapacity( XorMask, 32*4, 0 )
system_cursors = 32512,32513,32514,32515,32516,32642,32643,32644,32645,32646,32648,32649,32650
StringSplit c, system_cursors, `,
Loop %c0%
{
h_cursor := DllCall( "LoadCursor", "uint",0, "uint",c%A_Index% )
h%A_Index% := DllCall( "CopyImage", "uint",h_cursor, "uint",2, "int",0, "int",0, "uint",0 )
b%A_Index% := DllCall("CreateCursor","uint",0, "int",0, "int",0
, "int",32, "int",32, "uint",&AndMask, "uint",&XorMask )
}
}
if (OnOff = 0 or OnOff = "Off" or $ = "h" and (OnOff < 0 or OnOff = "Toggle" or OnOff = "T"))
$ = b ; use blank cursors
else
$ = h ; use the saved cursors
Loop %c0%
{
h_cursor := DllCall( "CopyImage", "uint",%$%%A_Index%, "uint",2, "int",0, "int",0, "uint",0 )
DllCall( "SetSystemCursor", "uint",h_cursor, "uint",c%A_Index% )
}
} Unfortunately, I don't have the time to understand the scripts, and I blindly copy them. |
more a note to myself: Loading Microsoft Teams moving pView from hwnd of "Loading Microsoft Teams" works, pView from hwnd of "Microsoft Teams" doesn't |
Hello, thanks a lot for your repository! I use Windows 11 Pro 22H2, and I am experiencing super strange behavior when I move a window for a second time using WinCtrlShift and the arrow keys: The window carries just fine between the virtual desktops, but after the second movement, the Office 365 setup pops up! Of course, I can quickly close the popup, and even with this glitch moving windows between desktops is super easy instead of clicking on the taskbar with dragging and dropping.
Office 365 is already installed, and I am using it through my university subscription. I wonder if I am the only one experiencing this strange behavior. Am I missing something here? I am not a Windows power user, and I miss the shortcuts of the Linux desktop.
Thanks again.
The text was updated successfully, but these errors were encountered: