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

Windows 10, with display scale set 125%, resize of webview is strange #16

Open
viruscamp opened this issue Sep 2, 2022 · 1 comment

Comments

@viruscamp
Copy link

My OS is Windows10, and have a display scale set to 125%.

When I ran the code below, the initial webview window fit the main windows, then I resized the main window, the webview resized follow the main window, but cannot full fill it, looks like 4/5 of the main windows, yes, it's (1/(125%)).

After I set display scale to 100%, it resizes as I expect.

use fltk::{app, prelude::*, window};

fn main() {
    let app = app::App::default();

    let mut win = window::Window::default()
        .with_size(800, 600)
        .with_label("Webview");
    
    let mut wv_win = window::Window::default_fill();
    wv_win.end();
    wv_win.make_resizable(true);

    win.end();
    win.make_resizable(true);
    win.show();

    let mut wv = fltk_webview::Webview::create(false, &mut wv_win);
    wv.navigate("https://bing.com");
    
    app.run().unwrap();
}
@MoAlyousef
Copy link
Collaborator

I think it's a similar problem to #14

Basically it's better to keep the size of the webview window fixed since resizing/rescaling causes issues. To keep it fixed, it can be placed inside a group widget as in the previous issue. I've tried several solutions in the past to cope with this issue, and I don't think it's really because of a problem in FLTK or webview itself, rather an issue with the embedding itself when it comes to the different operating systems.

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