Skip to content

Commit

Permalink
Update new Window event loop prioriy
Browse files Browse the repository at this point in the history
  • Loading branch information
Zamoca42 committed Nov 7, 2024
1 parent 0cac288 commit 77b40c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/platform_impl/linux/wayland/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ impl WlHeader {

let header_clone = header.clone();
let event_box_clone = event_box.clone();
glib::idle_add_local_once(move || {
glib::idle_add_local_full(glib::Priority::HIGH_IDLE, move || {
let allocated_height = header_clone.allocated_height();
event_box_clone.set_size_request(min_width, allocated_height);
header_clone.set_size_request(min_width, allocated_height);
glib::ControlFlow::Break
});

header.set_custom_title(Some(&title_label));
Expand Down
5 changes: 3 additions & 2 deletions src/platform_impl/linux/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,15 @@ impl Window {
.unwrap_or((800, 600));

let window_clone = window.clone();
glib::idle_add_local_once(move || {
glib::idle_add_local_full(glib::Priority::HIGH_IDLE, move || {
window_clone.set_default_size(min_width, min_height);
window_clone.resize(width, height);
glib::ControlFlow::Break
});

if attributes.maximized {
let maximize_process = util::WindowMaximizeProcess::new(window.clone(), attributes.resizable);
glib::idle_add_local_full(glib::Priority::DEFAULT_IDLE, move || {
glib::idle_add_local_full(glib::Priority::HIGH_IDLE, move || {
let mut maximize_process = maximize_process.borrow_mut();
maximize_process.next_step()
});
Expand Down

0 comments on commit 77b40c2

Please sign in to comment.