young-developer/nppNavigateTo

Alt-Tab not working consistently

Closed this issue · 2 comments

Extracting this from issues #7 & #8 as this appears to still be happening with release 1.12.4.

When the plugin's dialog is open, pressing Alt-Tab to leave the application and then pressing it again to come back to it, sometimes closes the dialog and sometimes not.

Dialog seems to remain if I enter some text into the dialog first, and it has not already remained open through a previous Alt-Tab operation.

I have never seen the dialog remain twice in a row.

After the dialog remains open:

  • you can see that the caret in the text entry input field, as well as any previous text selection there, is gone
  • if you press Ctrl-A to select the complete text in the input field, it will actually replace any existing text there with just a and select that

When the dialog goes away due to an Alt-Tab operation we do get some strange behaviour like the dialog has actually still remained open but only went hidden and is still intercepting some keyboard shortcuts.

Reproducible scenario with my current setup:

  • I have Ctrl-F4 mapped to closing the current document
  • I have some entries listed in the plugin dialog's input history
  • I have many files open, including many unsaved ones called New ##
  • open a new document using Ctrl-N
  • load a document from disk using Ctrl-O
  • open a new document using Ctrl-N
  • open the plugin dialog (mapped to Ctrl-Shift-O)
  • enter filter text new
  • Alt-Tab twice to exit and reenter the editor - the dialog will remain
  • Alt-Tab twice to exit and reenter the editor again - the dialog will disappear
  • Ctrl-F4 to close the current document (the second newly created one) - it closes and focus moves back to to the open one
  • Ctrl-F4 to attempt to close the current document (the one opened from disk) - but this does not close it and instead opens the hidden plugin dialog's input filed history dropdown, same as if I pressed F4 on that dialog
  • at this point this can be repeated indefinitely by pressing ESC and then Ctrl-F4 again
  • kinda funny how the dropdown appears out of nowhere :-) and especially funny if the input field's history is actually empty at the time :-)

You can then continue to get an additional bad scenario like this:

  • continue after the drop-down history list appeared
  • Alt-Tab twice to exit and reenter the editor - the drop-down history list will disappear
  • Ctrl-F4 to close the current document - it closes and focus moves back to the first newly created one
  • Ctrl-F4 to close the current document - it closes and focus moves to the previous document (whatever was already open at the start of the scenario)
  • Ctrl-O to attempt to open a new document - it will fail and just cause a beep, as if something intercepted that shortcut before Notepad++ got to handle it
  • this continues to occur with this and other shortcuts until you click your mouse somewhere on Notepad++, after which the shortcuts start working correctly

Notepad++ debug information:

Notepad++ v7.5.8   (64-bit)
Build time : Jul 23 2018 - 02:06:36
Path : C:\Program Files\Notepad++\notepad++.exe
Admin mode : OFF
Local Conf mode : OFF
OS : Windows 10 (64-bit)
Plugins : NavigateTo.dll PluginManager.dll DSpellCheck.dll mimeTools.dll NppConverter.dll 

New plugin v2 is available. Please retest and let me know if something else can be added/changed: https://github.com/young-developer/nppNavigateTo/releases/tag/v.2.0.0