Closed mhartington closed 3 years ago
This sounds DPI/scaling related. It's possible the panels somehow aren't respecting DPI scaling. Could you include an OBS session log?
Sure, updated the issue to include it in the details
Does this also happen when the panel is docked?
It does
I wonder if removing this code on macOS would fix this issue:
That was added for Linux panel support iirc and I did my final tests before that was merged, so it is possible that this introduced the change.
UPDATE: I just disabled both instances of the change for macOS and it works fine now. Rule of thumb: macOS does HiDPi correct by itself.
Just tested your pr @PatTheMav and it works when adding new panels, but when opening with existing browser docs, there is still some sizing issues. Looks like there's some extra margin/padding between the browser source and what OBS saying the size is.
For example, the tab bar for this browser doc is sized correctly, but the UI from the site is off by like 50pxs.
A more extreme example is below where the difference is a lot more
Are the docks correctly sized when you close and re-open them? At least with the Twitch panels I can't get them to behave badly. Also I wouldn't be surprised if some bad "window state" might persist.
@PatTheMav Not fully. It's kind of hit or miss. When I close the lower panels will be sized correct some of the times, but the chat (which is on the upper half next to the video preview) is almost never right.
The pixel ratio calculations are disabled for macOS entirely and as far as I can see not used anywhere else in ons-browser code. I also cannot reproduce the issue anymore (I could very easily reproduce the original issue), sizes are all as expected.
Can you try and create a new profile, add the panels and check if you can reproduce the issue? If so, please share the reproduction steps. Otherwise we cannot rule out that it's an unfortunate quirk of your current settings.
Yeah, I dont know what else to help debug this. I've cleaned out all my profiles/scenes/browser docks. Basically as close as I could get to a fresh install.
For reproductions..
Could this be in OBS it self? Are there any tips for debugging this further?
Quitting OBS between runs does the trick, so I was finally able to reproduce it.
Usually the only way to debug this is to follow the guide in our wiki regarding a "proxy" project in Xcode as you need to run the bundled app (CEF won't work with an unbundled macOS app). The tricky part is to get a breakpoint in the code (because it won't be able to use breakpoints set in the actual Xcode project). But once you got in there you can set log outputs at specific parts of a panel's lifetime and e.g. output current sizes.
EDIT: So I ran a quick test and the size reported by Qt at the time the panel is created is exactly what CEF gets and the website represents that size. I have a hunch that the whole thing probably works fine as long as panels are detached and when they are in an attached stage some resizing isn't properly reported the CEF.
@mhartington I just force-pushed a new commit on the PR that - at least on my machine - fixed the reported behaviour.
I had to "undo" the changes introduced to panels by the PR for Linux support - I admit I don't fully understand why, but panels don't require a whole lot effort to make sizing/resizing work properly on macOS.
That works perfectly!
Platform
Operating system and version: macOS 11.2.1 OBS Studio version: 26.1.2-141-g31a9dc384 (built from source)
Expected Behavior
A browser panel and the loaded webpage should be the same size once loaded or if the panel is resized
Current Behavior
Building from source to test the new browser panel. If a web page is loaded the size of the embedded web page will be greater than the actual panel size from OBS.
Here in this gif, I'm loading a Twitch dashboard, but the rendered window is much larger than the actual window UI https://user-images.githubusercontent.com/2835826/107712632-be176d80-6c97-11eb-8fb8-f2ca99031661.mov
Steps to Reproduce
Additional information
Here are two additional screenshots from the url above, one is fullscreen on a 16" macbook pro and the other is from obs, the size difference is very different.
Sorry in advanced if this is not the right place to post the issue. Let me know if I should report this to the main OBS repo instead.
Session Logfile