sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
812 stars 40 forks source link

[Windows platform only] having a modal dialog open causes a few keybinding related problems in another ST window #1303

Open keith-hall opened 8 years ago

keith-hall commented 8 years ago

Summary

When a modal dialog is open in one window in ST3 in Windows, using keyboard shortcuts/keybindings in another ST3 window has odd behavior.

Expected behavior

Either:

a) it shouldn't be possible to use an ST3 window while a modal dialog is open in another ST3 window (ST3 behaves like this in Linux) b) keybindings should work as expected in the ST3 window that doesn't have a modal dialog open (in which case, the Linux version should also be updated to have identical behavior...)

Actual behavior

In Linux, it is not possible to use an ST3 window while a modal dialog is open in another ST3 window. In Windows, numerous problems occur when using keybindings.

Steps to reproduce

  1. open ST3 in Windows
  2. open a new tab
  3. start typing anything
  4. open a new ST window
  5. in the old window, try to close the tab, but leave up the prompt re "do you want to save?"
  6. switch to the new window
  7. type multiple words
  8. press ctrl+backspace - the title in the tab bar now shows a square, and pressing the left and right arrow keys shows the column position changing in the status bar without the caret actually moving. the more you press ctrl+backspace the more non-printable characters you get. ctrl+backspace should just delete a word at the cursor.

    view.substr(sublime.Region(0, view.size()))

    '\x7f'
  9. selecting some text in the view and copying it using ctrl+c, shows the correct information in the status bar (e.g. copied 3 characters), but pasting it gives

    ---------------------------
    Save Changes?
    ---------------------------
    New file has been modified, save changes?
    ---------------------------
    Yes   No   Cancel   
    ---------------------------

    as though ctrl+c was pressed on the message box. Right clicking and selecting Copy from the context menu works as expected, however.

Pressing Tab to indent code instead inserts two tabs and deletes the selection.

Having an open or save as file dialog open instead of a save prompt also causes the same problems.

Originally reported on the forums here: https://forum.sublimetext.com/t/prompts-causing-copy-paste-editing-problems/21977

Environment

Fironet commented 8 years ago

This occurs also when the ST unregistered window message is open in the background. If the ST window itself is only restored/minimized the user mightn't notice the modal window (eg: if ST is pinned and hotkeyed via the taskbar via Win+num).

Also worth noting while affected tab autocomplete behaves by autocompleting then inserting an additional tab space.

FHTheron commented 6 years ago

Moving #2402 here as a comment:

Summary and actual behaviour (Windows 10)

If a sublime.error_message popup is shown, it is not taking the complete focus for that window, which I would expect. Mouse input is blocked, but I often Alt+Tab away from a window then Alt+Tab back and if a popup dialog was shown while the window was not visible, the popup doesn't take the focus when I switch back. I then happily keep editing text until I reach a point where I need to use the mouse for something and realise there is a popup window at the very end of the Alt+Tab window list.

In particular, using RemoteSubl, an unstable remote machine might have lost connection and the rmate connection lost, but the popup from RemoteSubl isn't useful because I don't see it when I switch back to Sublime Text and only after a while realise that none of my changes are making it back to the remote machine.

Expected behaviour

Any sublime.error_message or sublime.message_dialog should take full modal focus of the Window it was shown from so that it is not possible to switch to the window without dismissing/acknowledging the dialog box.

Steps to reproduce

Open the console
Run import time
Run time.sleep(5) or sublime.error_message("Something broke")
Alt+Tab to some other fullscreen window like a terminal or browser.
Wait 5 seconds, then Alt+Tab back to SublimeText.
Press Escape to close the console and keep editing in the text view
Alt+Tab to see where the message dialog actually is.

Environment

Operating system and version:
    Windows 10
Monitor:
    1920x1080
Sublime Text:
    Build 3175
    64 bit
zimka commented 11 months ago

Hi, just in case - this issue is still relevant on Windows 10 and build 4152