gree / gree/unity-webview

WebGL different behavior on Mac Monitor

Open
#1,174 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Objective-C++
Stars
2.7k
Forks
734
Avg merge
11h 39m
Merged PRs (30d)
1

Description

Hi,

we have this method:
setMargins: function (name, left, top, right, bottom) {
var container = $('#unity-container');
var width = container.width();
var height = container.height();

    var lp = left / width * 100;
    var tp = top / height * 100;
    var wp = (width - left - right) / width * 100;
    var hp = (height - top - bottom) / height * 100;

    this.iframe(name)
        .css('left', lp + '%')
        .css('top', tp + '%')
        .css('width', wp + '%')
        .css('height', hp + '%');
}

Not sure if it's our own implementation or this is something you provided.
Anyway - I am trying to open the webview on part of the screen. This is basically the first time we do this, most of the time we open it full screen.
I have an issue where everything works correctly in the connected monitor, but on the Mac's built in screen, it seems that the height is set to 0% (and top is set to 80% for example). This also reproduces for another developer, so it's not just my machine.

Can you try and help me? Do you have an idea why would it behave differently on different monitors (I'm assuming resolution)?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the shown setMargins method and inspect how #unity-container dimensions and iframe sizing are obtained in the WebGL path. Reproduce the zero-height result on the built-in and external Mac displays, then document or fix the monitor-dependent sizing behavior and verify the iframe receives nonzero dimensions.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, unity
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.