Repository navigation
fix(wayland): add client side decorations & fix error protocol 71 #979
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
Merged
Merged
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
2c344c9
feat(wayland): Add custom header bar with window controls
853f5ee
feat(window): Add maximized state check when setting window maximized
217f957
style(window): code format linting
8012e59
fix(window): remove non-functional logic
ffd9741
feat(window): Implement window maximize process
d440b97
style: code format linting
e2b1f46
fix: restore missing struct
1717ccf
chore: remove unused constants
cd5e509
fix: Revert resizable and add a flag to window_debug
968e491
rename: `display` to `header` in wayland
8325183
feat(event-loop): Improve window button handling
5d8d78d
feat(window): update window dragging on Wayland
0e84284
feat(wayland): update header button event
a3ce8dc
feat: update dragging functionality for Wayland windows
67330c4
chore: add changes to `.changes` file.
64fe001
fix: update code formatting
4fca9b1
Merge branch 'dev' into feat/wayland-display
Zamoca42 baa6877
fix: update Wayland maximize process condition
9703609
chore:code format linting
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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(); | ||
|
amrbashir marked this conversation as resolved.
Resolved
|
||
| 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.