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

[BUG] window.set_screen_num() when not in fullscreen mode. #1315

Open
kernelPanic0x opened this issue Nov 15, 2022 · 2 comments
Open

[BUG] window.set_screen_num() when not in fullscreen mode. #1315

kernelPanic0x opened this issue Nov 15, 2022 · 2 comments

Comments

@kernelPanic0x
Copy link

Hello,

first of all really awesome project!

But I have a problem with window postitioning on startup. When I create a window in fullscreen mode and set the window.set_scree_num() integer, it will work as expected and the window gets spawned on another display. But this does not work when i leave fullscreen mode or dont go to fullscreen in the first place.

Is there a way to set the "postition" of the window to another screen?

@MoAlyousef
Copy link
Collaborator

Hi

Thank you.
I'll have to investigate this further. You could probably force the position of the window by getting the screen's xywh coordinates or work area:

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

fn main() {
    let a = app::App::default();
    let (x, y, _w, _h) = app::screen_xywh(2);
    let mut w = window::Window::new(100 + x, 100 + y, 400, 300, None);
    w.end();
    w.show();
    a.run().unwrap();
}

You can also move the window using w.resize(/*coords*/).

@kernelPanic0x
Copy link
Author

Wow thank you for that quick response ^^.

Yes a couple of minutes ago I came to the same workaround thanks to the docs. That works for now. I get the screen offset position with the xywh function of the desired screen and set the postion of the window with the offset i want from the screen. I dont know if the set_screen_num function is supposed to do the same... maybe the combination of window.set_screen_num() and then window.set_pos(x,y) would make sense if that would work but at least it works with the work around :D

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