-
-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(wayland): add client side decorations & fix error protocol 71 (#979)
- Loading branch information
Showing
11 changed files
with
167 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"tao": patch | ||
--- | ||
|
||
On Linux Wayland, changed the event handling for maximizing to process events sequentially to avoid "Error 71(Protocol error): dispatching to Wayland display". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use gtk::{prelude::*, ApplicationWindow, EventBox, HeaderBar}; | ||
|
||
pub struct WlHeader; | ||
|
||
impl WlHeader { | ||
pub fn setup(window: &ApplicationWindow, title: &str) { | ||
let header = HeaderBar::builder() | ||
.show_close_button(true) | ||
.decoration_layout("menu:minimize,maximize,close") | ||
.title(title) | ||
.build(); | ||
|
||
let event_box = EventBox::new(); | ||
event_box.set_above_child(true); | ||
event_box.set_visible(true); | ||
event_box.set_can_focus(false); | ||
event_box.add(&header); | ||
|
||
window.set_titlebar(Some(&event_box)); | ||
Self::connect_resize_window(&header, window); | ||
} | ||
|
||
fn connect_resize_window(header: &HeaderBar, window: &ApplicationWindow) { | ||
let header_weak = header.downgrade(); | ||
window.connect_resizable_notify(move |window| { | ||
if let Some(header) = header_weak.upgrade() { | ||
let is_resizable = window.is_resizable(); | ||
header.set_decoration_layout(if !is_resizable { | ||
Some("menu:minimize,close") | ||
} else { | ||
Some("menu:minimize,maximize,close") | ||
}); | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Copyright 2014-2021 The winit contributors | ||
// Copyright 2021-2023 Tauri Programme within The Commons Conservancy | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
pub mod header; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters