christolliday / limn

Experimental cross platform GUI library
Other
404 stars 19 forks source link

OSX Support #3

Open asmyers opened 6 years ago

asmyers commented 6 years ago

This looks like a great project! I did a quick test of the examples on OSX and they exhibit mostly blank screens.

OSX Sierra Limn examples print: "OpenGL version 4.1 ATI-1.51.8" on startup. Radeon Pro 455 2048 MB Intel HD Graphics 530 1536 MB

screen shot 2017-10-03 at 10 58 29 am screen shot 2017-10-03 at 10 58 45 am
komawoyo commented 6 years ago

I'm sure there will be macOS support. The readme said that's its still in it's early stages and is a cross platform toolkit. I mean, your results might be expected due to the current state of the project - furthermore, since its in it early stages bugs are expected which I'm sure the author is aware of

christolliday commented 6 years ago

Thanks for the issue, yes OSX should be supported, just hadn't got around to testing it. I suspect the issue has something to do with WebRender. I actually have an old macbook lying around somewhere.. I'll try and find it and look into this soon.

roblabla commented 6 years ago

So I also tried to get this to work on osx, but there have been met so far with fun bugs. The first one I encountered is that 95% of the time, the window will be completely white (not even the window decorations will be shown !). I wonder if this is a webrender problem, a glutin problem, or a limn problem ?

screen shot 2017-10-12 at 5 49 42 pm

Sometimes (but fairly rarely), it will "work", but when resizing we'll get a huge flicker. Here's a gif of it :

flicker_rlr

I'll try to take a look at what's causing this, but I'm not really a webrender, GL or limn expert, so any idea is appreciated :D.

christolliday commented 6 years ago

Hey @roblabla thanks for having a look, unfortunately the old macbook I have is too old, it can't be upgraded past Lion and I'm having some issues with rust on Lion. Anyway I did borrow a friends macbook and saw the same issues you are describing. I also ran the webrender examples, and saw some of the issues (white screen, flickering) but not the issue of things being in the wrong position or scale. So I assume it is a combination of webrender having some problems and some more problems arising in how limn uses webrender.

Unfortunately it might be a while until I have a usable OS X set up I can do debugging on, but I think the next steps would be find out specifically what the webrender issues are, create minimal examples and fix those in webrender, then if there are still issues in limn, strip code out from limn until it's closer to a webrender example and see where the issue appears.

Restioson commented 6 years ago

Maybe someone else could PR a fix if you don't have a working machine?

jaroslaw-weber commented 6 years ago

I checked webrender examples but those were running ok. Limn examples are just empty.

I think it is high priority bug.

Restioson commented 6 years ago

IMO it's quite an important target to support, but it's gotta be quite difficult to fix for @christolliday since they don't have a Mac :/

nicoburns commented 6 years ago

https://github.com/nc4rrillo/indigo/issues/44

Linking this issue with the macOS issue on the indigo project (another attempt at a webrender based cross-platform GUI), as I'm seeing the same rendering issues on both (mostly scaling issues - separately for rendering and hit-testing it seems - particularly on HiDPI screens).

Hopefully I'll have some time to investigate this myself at some point. Until then, I want to wish people working on this project good favour. There is so much potential here!

jaroslaw-weber commented 6 years ago

I tested examples again a few days ago, it appears to be empty but when I resized widow I could see the example but everything was in wrong place. Mouse detection is working but it's in a different place than the button position. As @nicoburns mentioned, it may be some issue with winit and hidpi (not implemented for osx?). https://github.com/tomaka/winit/issues/337

willu commented 6 years ago

I had a brief play with this. There seems to be a coordinate system issue. Looking at the button example, it comes up blank, sized to 72x44. If I resize the window, then clicking on the corner of the window makes its size immediately jump to 100x100. While I resize, ui.window_resized() is being called on mouse move, but window contents don't get a redraw until I release the mouse.

If I make the window larger vertically, then once it is larger than about 540px high I can see the button at the bottom of the window (the button moves - that size is large enough I can see the whole button). At 540px high, mousing over the button does not highlight it. Rather, if I mouse over about half-way up the window, then the button (drawn at the bottom of the screen) highlights.

Resizing the window to 770px high it, the button has moved up the window so it is about half-way down the window. The mouse target and the button seem to line up now. (i.e. it seems that the button target is always about half-way down the window, but the image moves in the window.)