nurdism / neko

A self hosted virtual browser (rabb.it clone) that runs in docker.
Apache License 2.0
2.03k stars 185 forks source link

[BUG] Missing mouseup after blur #71

Closed m1k1o closed 4 years ago

m1k1o commented 4 years ago

Describe the bug When I am in browser and I try to switch window on my host PC, I press Alt+Tab. It works great. But when I come back to neko, I notice, that there is Alt pressed. It captures mousedown on Alt key, and then leaves session. So no mouseup for Alt will be distributed.

To Reproduce Steps to reproduce the behavior:

  1. Go to neko.
  2. Put your cursor in neko-shared-browser-window.
  3. Press Alt+Tab.
  4. Go back to neko (by pressing Alt+Tab again).
  5. Put your cursor in browser.
  6. Scroll mouse. Now it should switch screens.
  7. Press again Alt, and it will be normalized.

This will most likely visible only with Alt+Tab, but is issue with every key.

  1. Go to neko.
  2. Put your cursor in browsers searchbar.
  3. Press down some key (e.g. W).
  4. Move cursour out of neko-shared-browser-window (to chat for example).
  5. There should be still be typing that key, because no mouse-down event was sent.

Expected behavior If i press any key and leave neko-shared-browser-window with cursor (or with bluring my host window with Alt+Tab), it should "release" pressed key - send mouseup event.

Screenshots image

Desktop

Anyway, I would say, there should be only one Desktop, since only that is used now. Or are some use-cases for other desktops?

https://github.com/nurdism/neko/blob/14caa1fba8e04435588432d348684c5fa0b47164/.docker/files/openbox.xml#L147

m1k1o commented 4 years ago

Mentioned in https://github.com/nurdism/neko/issues/1#issuecomment-574366407 but still not fixed.

nurdism commented 4 years ago

On the desktop part, yeah we should have only one desktop, didn't know it was set to 4.

on the alt tab par, I'm not sure how to go about fixing this, when you alt-tab the window looses focus when you hit the tab button so the tab key down event never gets sent and the key up event does not get sent. AFAIK there is no lost focous event for the browser.

m1k1o commented 4 years ago

@nurdism window.onblur should do the thing.

window.addEventListener("blur", myScript);

The onblur event occurs when an object loses focus.

It fires exactly when Alt+Tab is pressed.