Focus - Click on select/option html menu not scroll in Web browser dock. #388

Open
opened 2022-05-09 16:04:20 -05:00 by stebulba · 5 comments
stebulba commented 2022-05-09 16:04:20 -05:00 (Migrated from github.com)

Operating System Info

Other

Other OS

Ubuntu 16.04 flatpack

OBS Studio Version

27.2.4

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/WfTUsdJaHUJGR-h3

OBS Studio Crash Log URL

No response

Expected Behavior

Every thing look working on web browser dock. Javascript look good. The focus is missing to open a select menu.

Current Behavior

If the mouse focus is not the web browser dock, when you click on a menu, the menu popup and loose the focus and close the select.

Steps to Reproduce

  1. Add a webpage in dock who include a option menu : https://www.w3schools.com/howto/howto_custom_select.asp
  2. Get the mouse focus anywhere outside the dock.
  3. Try to click on the select menu from the web browser deck.
  4. If work, try it just after restarting obs.

Anything else we should know?

No response

### Operating System Info Other ### Other OS Ubuntu 16.04 flatpack ### OBS Studio Version 27.2.4 ### OBS Studio Version (Other) _No response_ ### OBS Studio Log URL https://obsproject.com/logs/WfTUsdJaHUJGR-h3 ### OBS Studio Crash Log URL _No response_ ### Expected Behavior Every thing look working on web browser dock. Javascript look good. The focus is missing to open a select menu. ### Current Behavior If the mouse focus is not the web browser dock, when you click on a menu, the menu popup and loose the focus and close the select. ### Steps to Reproduce 1. Add a webpage in dock who include a option menu : https://www.w3schools.com/howto/howto_custom_select.asp 2. Get the mouse focus anywhere outside the dock. 3. Try to click on the select menu from the web browser deck. 4. If work, try it just after restarting obs. ### Anything else we should know? _No response_
sebastian-s-beckmann commented 2022-05-09 16:11:49 -05:00 (Migrated from github.com)

Is this a duplicate of https://github.com/obsproject/obs-browser/issues/148? It's not.

~~Is this a duplicate of https://github.com/obsproject/obs-browser/issues/148?~~ It's not.
RytoEX commented 2023-01-11 15:20:33 -06:00 (Migrated from github.com)

I can confirm this on Windows 10 with OBS Studio 29.

image
image

I can confirm this on Windows 10 with OBS Studio 29. ![image](https://user-images.githubusercontent.com/624931/211920099-cf984144-c247-45fe-b21f-844ff62fce0c.png) ![image](https://user-images.githubusercontent.com/624931/211920129-c0324409-7d5b-44f0-8f2d-f3484f729e6a.png)
WizardCM commented 2023-01-11 17:48:30 -06:00 (Migrated from github.com)

I personally expect this is not something we can fix, as the menus in docks are controlled almost exclusively by CEF.

However, it's entirely possible that Qt is passing the wrong data to CEF, or our CEF implementation is reading outdated positional data, resulting in this bug. Additionally (likely related?) normal browsers will close any open select menus when the window is being repositioned; this does not happen with our implementation as CEF doesn't have a proper "unfocus" function we can call.

Long story short, the first time you open a Select menu after a dock or its parent window's position has changed, the menu will be in the wrong spot. Every subsequent open works fine.

I will do some digging later to determine if it's our code or not.

I personally expect this is not something we can fix, as the menus in docks are controlled almost exclusively by CEF. However, it's entirely possible that Qt is passing the wrong data to CEF, or our CEF implementation is reading outdated positional data, resulting in this bug. Additionally (likely related?) normal browsers will close any open select menus when the window is being repositioned; this does not happen with our implementation as CEF doesn't have a proper "unfocus" function we can call. Long story short, the first time you open a Select menu after a dock or its parent window's position has changed, the menu will be in the wrong spot. Every subsequent open works fine. I will do some digging later to determine if it's our code or not.
WizardCM commented 2023-01-16 05:07:23 -06:00 (Migrated from github.com)

I decided to test on Linux today, and at least on GNOME, this issue does not occur. I expect it's Windows only, but have not yet verified it does not occur on macOS.

Edit: Verified it's fine on macOS too. Windows only confirmed.

I decided to test on Linux today, and at least on GNOME, this issue **does not occur**. I expect it's Windows only, but have not yet verified it does not occur on macOS. Edit: Verified it's fine on macOS too. **Windows only** confirmed.
WizardCM commented 2023-01-27 23:27:25 -06:00 (Migrated from github.com)

I did some additional debugging today, and have learned nothing useful. Both the coordinates of the CefHost window and the widget in QCefBrowserClient correctly update their coordinates immediately, as expected. I have no idea why those coordinates aren't being passed to the Select menu.

void QCefBrowserClient::OnGotFocus(CefRefPtr<CefBrowser> browser)
{
	QPoint myPos = widget->mapToGlobal(widget->pos());

	RECT rect;
	GetWindowRect(browser->GetHost()->GetWindowHandle(), &rect);
	
	blog(LOG_WARNING, "Refocused, %ix%i // %ix%i", myPos.x(), myPos.y(),
	     rect.left, rect.top);

}
I did some additional debugging today, and have learned nothing useful. Both the coordinates of the CefHost window and the `widget` in `QCefBrowserClient` correctly update their coordinates immediately, as expected. I have no idea why those coordinates aren't being passed to the Select menu. ```cpp void QCefBrowserClient::OnGotFocus(CefRefPtr<CefBrowser> browser) { QPoint myPos = widget->mapToGlobal(widget->pos()); RECT rect; GetWindowRect(browser->GetHost()->GetWindowHandle(), &rect); blog(LOG_WARNING, "Refocused, %ix%i // %ix%i", myPos.x(), myPos.y(), rect.left, rect.top); } ```
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-obsproject/obs-browser#388
No description provided.