<p dir="auto"><strong>Background</strong></p>
<p dir="auto">I am trying to make a popup window (child frameless BrowserWindow) appear at a specific position related to a DOM element of another window. I managed to get the child window located [almost] appropriately using getContentBounds() on the main window, adding the DOM element position given from element.getBoundingClientRect(), and setting the window position using setPosition().</p>
<p dir="auto"><strong>What goes wrong</strong></p>
<p dir="auto">When the DPI scaling factor is not 100%, on Windows (for example 125%, configured in the display settings), the child window position is off by a few pixels. Obviously, this is because the window position must be given in CSS pixels units (and not actual physical pixels), and the getContentBounds / setPosition / etc... methods all return and take integral numbers as parameters. The window position is therefore rounded arbitrarily and we loose accuracy.</p>
<p dir="auto"><strong>Solution ?</strong><br>
A possible solution could possibly be for the getContentBounds / setPosition /etc... methods to allow the use of floating point numbers, and only round them <em>after</em> translating them to physical pixel units.</p>
<p dir="auto">Note: this would also probably solve this problem: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="228796672" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/9477" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/9477/hovercard" href="https://github.com/electron/electron/issues/9477">#9477</a></p>
<p dir="auto">I have tried using a number of Electron apps on Ubuntu 18.10 (which is not released yet) , e.g. VS Code, Atom, Skype, and none of them work - they all segfault immediately after launch with the similar stack traces:</p>
<p dir="auto">Atom (1.30.0):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#0  0x0000000000b87650 in  ()
#1  0x00007ffff7d833e2 in node::http2::Http2Session::Callbacks::Callbacks(bool) () at /usr/share/atom/libnode.so
#2  0x00007ffff7d834a5 in  () at /usr/share/atom/libnode.so
#3  0x00007ffff7fe398a in call_init (l=&lt;optimized out&gt;, argc=argc@entry=1, argv=argv@entry=0x7fffffffe008, env=env@entry=0x7fffffffe018)
    at dl-init.c:72
#4  0x00007ffff7fe3a89 in call_init (env=0x7fffffffe018, argv=0x7fffffffe008, argc=1, l=&lt;optimized out&gt;) at dl-init.c:30
#5  0x00007ffff7fe3a89 in _dl_init (main_map=0x7ffff7ffe190, argc=1, argv=0x7fffffffe008, env=0x7fffffffe018) at dl-init.c:119
#6  0x00007ffff7fd40ca in _dl_start_user () at /lib64/ld-linux-x86-64.so.2
#7  0x0000000000000001 in  ()
#8  0x00007fffffffe41c in  ()
#9  0x0000000000000000 in  ()"><pre class="notranslate"><code class="notranslate">#0  0x0000000000b87650 in  ()
#1  0x00007ffff7d833e2 in node::http2::Http2Session::Callbacks::Callbacks(bool) () at /usr/share/atom/libnode.so
#2  0x00007ffff7d834a5 in  () at /usr/share/atom/libnode.so
#3  0x00007ffff7fe398a in call_init (l=&lt;optimized out&gt;, argc=argc@entry=1, argv=argv@entry=0x7fffffffe008, env=env@entry=0x7fffffffe018)
    at dl-init.c:72
#4  0x00007ffff7fe3a89 in call_init (env=0x7fffffffe018, argv=0x7fffffffe008, argc=1, l=&lt;optimized out&gt;) at dl-init.c:30
#5  0x00007ffff7fe3a89 in _dl_init (main_map=0x7ffff7ffe190, argc=1, argv=0x7fffffffe008, env=0x7fffffffe018) at dl-init.c:119
#6  0x00007ffff7fd40ca in _dl_start_user () at /lib64/ld-linux-x86-64.so.2
#7  0x0000000000000001 in  ()
#8  0x00007fffffffe41c in  ()
#9  0x0000000000000000 in  ()
</code></pre></div>
<p dir="auto">VS Code (package version: 1.27.1-1536226049):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#0  0x0000000000ab6fd0 in  ()
#1  0x00007ffff7d839a2 in node::http2::Http2Session::Callbacks::Callbacks(bool) () at /usr/share/code/libnode.so
#2  0x00007ffff7d83a65 in  () at /usr/share/code/libnode.so
#3  0x00007ffff7fe398a in call_init (l=&lt;optimized out&gt;, argc=argc@entry=1, argv=argv@entry=0x7fffffffe108, env=env@entry=0x7fffffffe118)
    at dl-init.c:72
#4  0x00007ffff7fe3a89 in call_init (env=0x7fffffffe118, argv=0x7fffffffe108, argc=1, l=&lt;optimized out&gt;) at dl-init.c:30
#5  0x00007ffff7fe3a89 in _dl_init (main_map=0x7ffff7ffe190, argc=1, argv=0x7fffffffe108, env=0x7fffffffe118) at dl-init.c:119
#6  0x00007ffff7fd40ca in _dl_start_user () at /lib64/ld-linux-x86-64.so.2
#7  0x0000000000000001 in  ()
#8  0x00007fffffffe4d9 in  ()
#9  0x0000000000000000 in  ()"><pre class="notranslate"><code class="notranslate">#0  0x0000000000ab6fd0 in  ()
#1  0x00007ffff7d839a2 in node::http2::Http2Session::Callbacks::Callbacks(bool) () at /usr/share/code/libnode.so
#2  0x00007ffff7d83a65 in  () at /usr/share/code/libnode.so
#3  0x00007ffff7fe398a in call_init (l=&lt;optimized out&gt;, argc=argc@entry=1, argv=argv@entry=0x7fffffffe108, env=env@entry=0x7fffffffe118)
    at dl-init.c:72
#4  0x00007ffff7fe3a89 in call_init (env=0x7fffffffe118, argv=0x7fffffffe108, argc=1, l=&lt;optimized out&gt;) at dl-init.c:30
#5  0x00007ffff7fe3a89 in _dl_init (main_map=0x7ffff7ffe190, argc=1, argv=0x7fffffffe108, env=0x7fffffffe118) at dl-init.c:119
#6  0x00007ffff7fd40ca in _dl_start_user () at /lib64/ld-linux-x86-64.so.2
#7  0x0000000000000001 in  ()
#8  0x00007fffffffe4d9 in  ()
#9  0x0000000000000000 in  ()
</code></pre></div>
<ul dir="auto">
<li>Output of <code class="notranslate">node_modules/.bin/electron --version</code>:</li>
<li>Operating System (Platform and Version): Ubuntu 18.10 amd64</li>
<li>Output of <code class="notranslate">node_modules/.bin/electron --version</code> on last known working Electron version (if applicable):</li>
</ul>