-
-
Notifications
You must be signed in to change notification settings - Fork 202
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
fix: maximizing window on linux, closes #442 #456
Conversation
Just tried this PR and the bug still exists Here is my repro: // Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
use tao::{
event::{Event, WindowEvent},
event_loop::{ControlFlow, EventLoop},
window::WindowBuilder,
};
#[allow(clippy::single_match)]
fn main() {
let event_loop = EventLoop::new();
let mut window = Some(
WindowBuilder::new()
.with_title("A fantastic window!")
.with_inner_size(tao::dpi::LogicalSize::new(1080, 1980))
.with_maximized(true)
.with_resizable(false)
.build(&event_loop)
.unwrap(),
);
event_loop.run(move |event, _, control_flow| {
*control_flow = ControlFlow::Wait;
println!("{:?}", event);
match event {
Event::WindowEvent {
event: WindowEvent::CloseRequested,
window_id: _,
..
} => {
// drop the window to fire the `Destroyed` event
window = None;
}
Event::WindowEvent {
event: WindowEvent::Destroyed,
window_id: _,
..
} => {
*control_flow = ControlFlow::Exit;
}
Event::MainEventsCleared => {
if let Some(w) = &window {
w.request_redraw();
}
}
_ => (),
}
});
}
``` |
f4a4b7d
to
c326771
Compare
@amrbashir |
the last commit brought more issues than it solved. If you you set the size to Here is some scenarios with the expected outcome to help you debug this further:
|
@amrbashir
Please tell me about the above sentence. |
And I forgot to fix maximization in runtime, so I will fix it... |
My bad I mixed them up. While I was testing, I had resizable true and maximized false and it maximized the window which it shouldn't. just try to match the 4 scenarios I posted above with the expected outcome while creating the window and in runtime. |
In my environment, when I had resizable true and maximized false, the window is not maximized. |
No, it was when creating the window. I'll do more testing tomorrow. |
I did some more testing and noted down the issues I found below but I am not sure if these are bugs or the desired behavior.
|
Thank you for your investigation. Yeah I'm fixing runtime behavior. |
I tested these cases on macOS and windows. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR is good enough but will let @wusyong decide whether he want to merge or not
Do we need to support maximizing window on windows at initialization? |
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
Checklist
fix: remove a typo, closes #___, #___
)Other information