Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imgui incorrectly centred on Linux multi-monitor setup #386

Closed
splondike opened this issue Sep 29, 2021 · 2 comments
Closed

imgui incorrectly centred on Linux multi-monitor setup #386

splondike opened this issue Sep 29, 2021 · 2 comments

Comments

@splondike
Copy link

splondike commented Sep 29, 2021

On i3 and GNOME3 for talon stable (0.2.2) and talon beta (v0.2.0-94-g4a40) the following code does not correctly centre the imgui window for a certain multi-monitor/primary configuration:

from talon import imgui, ui

@imgui.open()
def test(gui):
    gui.text("Test window")

test.show()
rect = test._canvas.rect
print("Screens: ", ui.screens())
print("Expected x/y: ", (1600 - rect.width) / 2, (900 - rect.height) / 2)
print("Actual: ", rect)

I have monitors A: 1600x900 and B: 1920x1080. In xrandr I have A at offset 0,0 and B at offset 1600,0. If I make A the xrandr primary then the above code prints out the expected answer (under v0.2.0-94-g4a40):

Screens:  [Screen(x=0, y=0, size=(1600, 900), mm=(344.000, 194.000)), Screen(x=1600, y=0, size=(1920, 1080), mm=(509.000, 286.000))]
Expected x/y:  755.0 437.0
Actual:  Rect(755.0, 437.0, 90.0, 26.0)

If I make B the primary and restart Talon then it prints out the wrong answer:

Screens:  [Screen(x=1600, y=0, size=(1920, 1080), mm=(509.000, 286.000)), Screen(x=0, y=0, size=(1600, 900), mm=(344.000, 194.000))]
Expected x/y:  755.0 437.0
Actual:  Rect(915.0, 527.0, 90.0, 26.0)
@lunixbochs
Copy link

lunixbochs commented Sep 29, 2021 via email

@lunixbochs
Copy link

Fixed in the v0.2.0-101 beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants