hyperterm-overlay icon indicating copy to clipboard operation
hyperterm-overlay copied to clipboard

Win - focus is not switching back to previous application

Open peterdanis opened this issue 7 years ago • 7 comments

Hi, in Windows focus is not switching back to previous application after hiding hyper with hyperterm-overlay. No window is focused.

Tried with animation true/false, with vanilla hyper+hyperterm-overlay. Tested on Windows 7 and Windows 10. On Linux it works fine.

peterdanis avatar Sep 08 '17 11:09 peterdanis

Did you actually try to enable hide on blur in your config? Works for me on macOS:

overlay: {
  hideOnBlur: true,
}

simonhaenisch avatar Oct 23 '17 19:10 simonhaenisch

Yes, I have hideOnBlure enabled.

peterdanis avatar Oct 23 '17 21:10 peterdanis

I could manage to "fix" this issue by adding a win.blur() before win.hide(), as questioned at this Electron issue

The code was changed here before line 367

New version:

		//close without animation
		else {
			findFocus();
			this._win.blur();
			this._win.hide();
		}

Also, I should note that I'm not using animation (animate: false option)

I think that a "full" fix (including animation) would be like this (i.e., always calling blur before hide):

		//control the animation
		if(this._config.animate) {
			this._animating = true;

			//animation end bounds
			this._startBounds();

			setTimeout(() => {
				this._animating = false;
				findFocus();
                                this._win.blur();
				this._win.hide();
			}, 250);
		}
		//close without animation
		else {
			findFocus();
			this._win.blur();
			this._win.hide();
		}

gabriellima avatar Jun 08 '18 15:06 gabriellima

Looking into this for my fork hyper-overlay and I cannot replicate the issue on Windows 10 build 1803. When I open the overlay then X or - it out my Windows just focuses back to the previous window that was active.

Can you elaborate on steps to reproduce?

favna avatar Jun 27 '18 22:06 favna

@Favna try using the "quake style hide" shortcut.

gabriellima avatar Jul 02 '18 09:07 gabriellima

I honestly have no idea what the "quake style hide" is

favna avatar Jul 02 '18 10:07 favna

Sorry. You said that clicking X or - would "hide" the window, with Focus going back to previous window.

The bug, at least on my case, was happening when using the shortcut to open/hide the overlay, and not when pressing the buttons.

Regarding the "quake style", I'm sorry, it was my mistake to suppose it was a common knowledge. In my humble opinion, this term started at Quake game, and later on Guake linux "show/hide" terminal.

gabriellima avatar Jul 12 '18 12:07 gabriellima