Competition: What’s your favorite Redgate tool? Enter now.

Keyboard focus not changing when moving back to SSMS

kyleburwellkyleburwell Posts: 6 New member
edited August 30, 2016 8:43AM in SQL Prompt
I often work with SSMS in a maximized window on one monitor, while working with other applications on another monitor. If I'm working in another application, then switch back to SSMS, keyboard focus does not follow in one specific scenario. If the first action I take in SSMS is highlighting text with my mouse, then any subsequent keyboard actions will be sent to the application I was just working in. If I click back into the previous application, SSMS will appear to have focus, but it does not.

Steps to reproduce:

1. Have SSMS open on one monitor with some text in a query window. Any text will do.
2. Click into another application, such as notepad, on another monitor. (Not sure if it has to be another monitor at this point.)
3. Click and drag some text in the query window in SSMS. It's very important that the first down-click in SSMS is followed by highlighting some text, then releasing the mouse button.
4. Type anything. If done correctly, the previous application will still have keyboard focus and the characters will be sent there instead of SSMS.

SQL Prompt Version: 7.2.4.291
SSMS Version: SQL Server 2016 Release Candidate 13.0.14000.36
Windows 7

Comments

  • Hi Kyle,

    We've just had a look into this here and I think you might have found a bug with SSMS2016 itself as it seems to happen even without SQL Prompt installed.

    Just to confirm could you try (temporarily) uninstalling SQL Prompt and see if you still have the issue?

    Thanks,
    Aaron.
  • kyleburwellkyleburwell Posts: 6 New member
    Hi Aaron,

    Thanks for the quick reply. I have tried to replicate this on another machine that is running SSMS2016, but has never had SQL Prompt installed on it. I'm unable to reproduce the bug on that machine.

    Back on my machine, the bug also happens when I use SSMS2012, Version: 11.0.6020.0. I just now tested multiple times to verify.

    If you feel it would still be beneficial for me to uninstall SQL Prompt on my machine and try again, I can certainly do that.

    Thanks,
    Kyle
  • Hi Kyle,

    We've just tested SSMS2012 on a new VM that's never had SQL Prompt installed and we're still seeing the same issue so we're reasonably sure that SQL Prompt isn't the cause: http://i.imgur.com/SNkfjlX.gifv . If you could try quickly uninstalling (all your SQL Prompt settings will be preserved between uninstalling/reinstalling) just to rule out SQL Prompt as a possible cause that'd be really helpful.

    Thanks,
    Aaron.
  • kyleburwellkyleburwell Posts: 6 New member
    Good morning Aaron,

    I will uninstall SQL Prompt and try it out. One note about your GIF is that those aren't quite the same steps I'm using when I run into the issue. Since this seems to be a bit of a sporadic issue, I've created 2 GIFs to hopefully clear it up a bit.

    In this first GIF, I do the following:
    Type some text in SSMS2016
    Switch to FireFox and type into a Google search
    Click and highlight the text in SSMS2016, then start typing to show that keyboard focus remains in FireFox
    http://recordit.co/XmrW6zYvDR

    In the second GIF, I do the same, but you'll notice that I have to click back and forth between SSMS2016 and FireFox two times to get the bug to occur:
    http://recordit.co/VPM252rhN2

    Hopefully that clears things up a little bit. I will continue to see if I can reproduce the bug without SQL Prompt installed. Thanks for all your help!

    -Kyle
  • Hi Kyle,

    Thanks for the gifs - they really help and I think we might have been looking at two very similar but different issues after all (both of them are pretty odd/annoying!)

    I'll investigate a bit more with your exact reproduction steps.

    Thanks,
    Aaron.
  • kyleburwellkyleburwell Posts: 6 New member
    Agreed, especially the annoying part!

    I was able to recreate your bug on a system without SQL Prompt, so that's definitely an SSMS issue.

    My initial bug, however, I can only get to occur on my machine with SQL Prompt installed.

    -Kyle
  • Hi Kyle,

    I had another go at recreating it and oddly enough I think I was able to reproduce after a dozen or so tries when I was using remote desktop (and not at all without SQL Prompt). However when I'm physically at my machine I can't seem to reproduce it at all.

    I'll continue to investigate.

    Thanks,
    Aaron.
  • Hi Kyle,

    Sorry for the slow turn around with this - it's definitely one of the more bizarre/awkward bugs that I've looked into :)

    I think I've finally been able to track it down and have a possible fix in this private build if you'd be able to give it a try? (Note: The build is based on our 7.3 beta which includes a new formatting system. If you'd like to turn off the new formatting system you can uncheck the "Use new formatting styles" checkbox under Options->Experimental features)

    Thanks,
    Aaron.
  • kyleburwellkyleburwell Posts: 6 New member
    I think you may have fixed it! Awesome, thanks! You're right, that was a very bizarre bug. I didn't realize how often I performed that specific set of actions until I ran into this. Thanks again for your help with this! I love SQL Prompt, I'm not sure how I got by so long without it.
  • Thanks for confirming the fix! I'll merge the change in so it'll be included in all the new 7.3 releases.

    Happy to hear you're finding SQL Prompt useful! :)
Sign In or Register to comment.