Thanks to visit codestin.com
Credit goes to github.com

Skip to content

If app appears on non-active screen, window resizes #784

@wyhinton

Description

@wyhinton

Discussed in #777

Originally posted by wyhinton July 14, 2021
When creating a new Window, it seems like the size of the window can sometimes resize automatically. I assume that FLTK is trying to account for some kind of screen screen scaling? Or maybe this is a Win10 thing? But on the monitor that I captured the GIF, the screen scale is 1.0. The scale on my other 4k monitor is 1.25. Is there anyway to have the window appear as the correct size before it appears?

This can also sometimes cause widgets to resize strangely.

use fltk::{
    app, app::*, button::*, enums::*, frame::*, group::*, prelude::*, window::*, widget::*, draw::*,
};
//fltk = { version = "1.0.22"}
fn main(){
    let app = App::default();
    let mut win = Window::new(200, 200, 500, 300, "Pack vs Group Overdraw");
    let mut my_pack= Pack::new(50,50,100,200,"mypack");
    let _button= Button::new(0,0,200,20,"mybutton");
    let _button= Button::new(0,0,200,20,"mybutton");
    let _button= Button::new(0,0,200,20,"mybutton");
    let _button= Button::new(0,0,200,20,"mybutton");
    let mut my_group= Group::new(200,50,100,50,"my group");
    my_group.set_frame(FrameType::FlatBox);
    my_group.set_color(Color::Red);


    let mut frame = Frame::new(200,100,100,100, "Test");
    frame.set_frame(FrameType::FlatBox);
    frame.set_color(Color::Yellow);
    my_group.end();

    let mut frame = Frame::new(250,100,100,100, "Test");
    frame.set_frame(FrameType::FlatBox);
    frame.set_color(Color::Yellow);
    my_pack.end();
    win.end();
    win.show();
    app.run().unwrap();
}

Capture on the "non active" screen (the one the mouse is NOT over)

window_resize_issue

Demonstrating the odd resizing effect for my DnD ToDoList example

window_resize_issue2

What the window should look like:

image

I'm wondering if this might have something to do with the use of Pack.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions