When I open Heidi or start the session manager and choose a server to connect to then after the connection is made Heidi's window steals focus in the OS. Would it be possible to disable this behaviour?
The reason is that sometimes connecting to a server takes a while, especially on SSH connections, so I choose a server to connect to and switch to another application to do some work and then after a while Heidi suddenly jumps out at me to the foreground interrupting my work, which is a bit annoying. It would be great if this didn't happen. If I leave the connection manager in focus (that is I wait for the connection) then it's fine that the new Heidi window gets focus. But when I switch to another application before the new Heidi window is created then it should open in the background without interfering with what I'm doing. Is this a reasonable request?
Heidi stealing focus when connecting
Can confirm that. Only I can't seem to be able to programatically prevent HeidiSQL from stealing OS focus when the main form shows up. I just tried
and disable code like
... all with no luck.
ShowWindow(Handle, SW_SHOWNOACTIVATE)
and disable code like
MakeFullyVisible(Screen.Monitors[MonitorIndex])
... all with no luck.
So perhaps a workaround could be to make Heidi open its new window immediately without waiting for the connection? Then we could avoid the issue.
It would have the added of being able to see messages in the log pane while connecting. Currently, the first connection is happening in an invisible way, be it from the connection manager or a jump list and we get the problem of focus stealing.
But notice how connecting works when Heidi is running and I disconnect from the server with the disconnect button - the connection manager opens but the main Heidi window is in the background and when I choose to connect I get to see the log messages of the connection process in the main window. If it could work like that even on first connection it would be even better than fixing the stealing focus problem. Just open the main window beforehand. What do you think?
It would have the added of being able to see messages in the log pane while connecting. Currently, the first connection is happening in an invisible way, be it from the connection manager or a jump list and we get the problem of focus stealing.
But notice how connecting works when Heidi is running and I disconnect from the server with the disconnect button - the connection manager opens but the main Heidi window is in the background and when I choose to connect I get to see the log messages of the connection process in the main window. If it could work like that even on first connection it would be even better than fixing the stealing focus problem. Just open the main window beforehand. What do you think?
Ugly is subjective and I think we use Heidi not for prettiness but mainly for its functionality. Having the log messages showing connection status is much more useful than not seeing anything. And yes, it solves the focus problem - see it for yourself: connect to a server and then disconnect - what happens is that the object tree in the main window disappears but the log page is still there and the connection window appears on top. Now when you connect to any server and it takes time Heidi doesn't steal focus any more.
So there's nothing really more to add, the solution is already there. I find connecting with the main window open behind more user friendly than without it at the current state of things. If only the same happened on the first connect it would be great.
So there's nothing really more to add, the solution is already there. I find connecting with the main window open behind more user friendly than without it at the current state of things. If only the same happened on the first connect it would be great.
Thanks - it's not some super important thing but any improvement would be nice.
As to ugliness - I should have said that functionality is more important than prettiness. I must admit Heidi's interface is actually very pretty - the fonts, colours, icons, element sizes - I appreciate all of that so I would be wrong to say that prettiness is not important :)
As to ugliness - I should have said that functionality is more important than prettiness. I must admit Heidi's interface is actually very pretty - the fonts, colours, icons, element sizes - I appreciate all of that so I would be wrong to say that prettiness is not important :)
Code modification/commit
bd35beb
from ansgar.becker,
11 years ago,
revision 8.1.0.4652
Show session manager with a visible main form in the background. Should prevent HeidiSQL from stealing focus in OnShow, or wherever that happens. See http://www.heidisql.com/forum.php?t=14133
Reverted in r4654. Causes an access violation at start up. See here: http://www.heidisql.com/forum.php?t=13962#p14160
Yes, something was broken in r4652, the session manager windows seemed to open one after another in an endless loop and nothing could be done apart from ending the process. It's a pity it didn't work out... Maybe opening the main window just after pressing Open in the session manager would work better?
Please login to leave a reply, or register at first.