Skip to content

Commit

Permalink
fix: update code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Zamoca42 authored and gitbutler-client committed Sep 26, 2024
1 parent d74b870 commit 309f50f
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 14 deletions.
8 changes: 1 addition & 7 deletions .changes/improve-wayland-display.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,4 @@
"tao": patch
---

Changed the event handling for maximizing to process events sequentially to avoid "Error 71(Protocol error): dispatching to Wayland display".

Added buttons for maximize and minimize in the Wayland title bar.

Fixed an issue where the window was not resizing when dragging the window borders.

Fixed an issue where the window was not moving when dragging the header bar area.
On Linux Wayland, changed the event handling for maximizing to process events sequentially to avoid "Error 71(Protocol error): dispatching to Wayland display".
5 changes: 5 additions & 0 deletions .changes/wayland-dragging-header.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tao": patch
---

On Linux Wayland, fixed an issue where the window was not moving when dragging the header bar area.
5 changes: 5 additions & 0 deletions .changes/wayland-resize-window.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tao": patch
---

On Linux Wayland, fixed an issue where the window was not resizing when dragging the window borders.
5 changes: 5 additions & 0 deletions .changes/wayland-titlebar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tao": patch
---

On Linux Wayland, added buttons for maximize and minimize in the title bar.
2 changes: 1 addition & 1 deletion src/platform_impl/linux/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ impl<T: 'static> EventLoop<T> {
});
window.connect_button_press_event(move |window, event| {
const LMB: u32 = 1;
if (is_wayland && window.is_decorated())
if (is_wayland || !window.is_decorated())
&& window.is_resizable()
&& !window.is_maximized()
&& event.button() == LMB
Expand Down
1 change: 1 addition & 0 deletions src/platform_impl/linux/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ impl<W: GtkWindowExt + WidgetExt> WindowMaximizeProcess<W> {
self.step += 1;
glib::ControlFlow::Continue
} else {
//It should still revert to the previous resizable state.
self.step = 2;
glib::ControlFlow::Continue
}
Expand Down
19 changes: 13 additions & 6 deletions src/platform_impl/linux/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,19 @@ impl Window {
window.set_default_size(1, 1);
window.resize(width, height);

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

window.set_deletable(attributes.closable);

Expand Down

0 comments on commit 309f50f

Please sign in to comment.