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

UI blank and renders only after resize/click #65

Closed
r-arias opened this issue Nov 25, 2018 · 14 comments · Fixed by #77
Closed

UI blank and renders only after resize/click #65

r-arias opened this issue Nov 25, 2018 · 14 comments · Fixed by #77
Labels
area:fonts Bug is related to font loading, font decoding or text layout bug Something isn't working

Comments

@r-arias
Copy link

r-arias commented Nov 25, 2018

Description

When trying out the examples on my machine, I noticed that reproducibly the UI only shows after I force a redraw by resizing the window or clicking somewhere inside it.

Version / OS

Steps to Reproduce

  • Create a new cargo project with azul as dependency.
  • paste one of the azul examples in main.rs
  • cargo run

Expected Behavior

The window opens and immediately shows the rendered example.

Actual Behavior

The window is empty and only redraws the example when resizing the window or clicking somewhere.

screenshot from 2018-11-25 12-25-03

After clicking:
screenshot from 2018-11-25 12-25-23

Additional Information

@nicohman
Copy link

Just to chip in, I have also been experiencing this on Arch Linux under both xfce and i3, using the most recent version of azul. Thanks for taking a look at this!

@jqcorreia
Copy link

jqcorreia commented Nov 29, 2018

I'm also having issues with this. The basic example from the tutorial renders both Label and Button but the text is missing and click 'animation' doesn't happen.
Using Arch Linux with AwesomeWM (i3 alternative)

@fschutt
Copy link
Owner

fschutt commented Nov 29, 2018

@jqcorreia Could you share a screenshot of what you mean? Does or doesn't it render the label? There is no animation yet (i.e. :hover) - did you mean that it doesn't increase the counter?

I know that this is a problem on windows, too, it appeared after the text layout de-duplication fix - the problem is more or less that the font gets loaded, but only gets rendered on the second frame, i.e. it gets uploaded, but not rendered in time for the first frame. For now, I considered it low-priority, since it only appears on startup and technically doesn't break the functionality of the app (and I don't have much time right now to investigate this).

@jqcorreia
Copy link

Sure thing. BTW this is by far the only sane GUI framework that I came across during my yet short working time with Rust. Nice one.

DataModel looks like this:

impl Layout for MyDataModel {
    fn layout(&self, _: WindowInfo<Self>) -> Dom<Self> {
        println!("Running layout");
  
        let label = Label::new(format!("{}", 1000)).dom();
  
        Dom::new(NodeType::Div)
            .with_child(label)
    }
}

The result is this
scrot

You can see there that I'm using a tiling WM, the 'Running Layout' is printed a couple of times and that the label contains no text. If I add a button as the Counter example the button outline shows but no text and on-click nothing happens besides another 'Running Layout' print.

@fschutt
Copy link
Owner

fschutt commented Nov 29, 2018

Okay, so it's probably only the font loading that is broken - it should technically update the fonts, but it probably only does so when the window is resized (which, on a tiling WM rarely happens).

@jqcorreia
Copy link

Okay, so it's probably only the font loading that is broken - it should technically update the fonts, but it probably only does so when the window is resized (which, on a tiling WM rarely happens).

What can I do on my side to help with this? Do you need any more information? Distro info, installed packages, etc?

@fschutt
Copy link
Owner

fschutt commented Nov 30, 2018

No, there is very little you can do. This is an issue with azul, not your system. If you really wanted to debug this, you could debug where / if the text gets pushed in the display list, but that's maybe a bit too advanced.

@fschutt
Copy link
Owner

fschutt commented Dec 13, 2018

Just tested it, it's not fixed yet, reopening.

@fschutt fschutt reopened this Dec 13, 2018
@antonok-edm
Copy link
Contributor

@fschutt Strange, that definitely fixed it for me. Maybe this is somehow platform-dependent?

@r-arias @nicohman @jqcorreia could any of you report your results on the latest version?

@antonok-edm
Copy link
Contributor

I did some more testing -- apparently, it works only on the calculator example, which is the only one I tried out!

The calculator example is the only one which loads an external font, and making it use the default font also causes the same issue. I will look into this some more. At least, for now, if you load in your own font it will work as expected.

@r-arias
Copy link
Author

r-arias commented Dec 14, 2018

yeah, no, I can confirm the issue persists with current azul v0.1.0 (https://github.com/maps4print/azul#70f469bb) on the counter example from the guide.

@TheJare
Copy link

TheJare commented Dec 14, 2018

The issue happens as described for me in Windows 10 with 64 bit msvc Rust. Window appears and the two rectangles for the label and the (gray background) button appear, but no visible text until I click on the button or resize the window.

Note that just clicking on the label does not make the text appear, only the actual button click.

@jordanbray
Copy link

I can confirm this issue. I can also confirm that manually loading a font (stole code from the calculator example per posts on this issue) resolves the issue.

@fschutt fschutt added bug Something isn't working area:fonts Bug is related to font loading, font decoding or text layout labels Feb 12, 2019
@fschutt
Copy link
Owner

fschutt commented Mar 20, 2019

This is fixed now with the new font loading system (see #78 (comment)) - however there is currently the issue that Linux for some reason doesn't render fonts at all (I'm working on that). This bug in particular is solved, though.

@fschutt fschutt closed this as completed Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:fonts Bug is related to font loading, font decoding or text layout bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants