Skip to content
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

Window decoration not being draw in wayland #10346

Closed
1 task done
XDeme1 opened this issue Apr 10, 2024 · 3 comments · Fixed by #11525
Closed
1 task done

Window decoration not being draw in wayland #10346

XDeme1 opened this issue Apr 10, 2024 · 3 comments · Fixed by #11525
Labels
defect [core label] linux workspace Feedback for workspace management, layout, interactions, etc

Comments

@XDeme1
Copy link
Contributor

XDeme1 commented Apr 10, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

After #10227 Wayland windows were not being drawn at all.
After #10343 Wayland window are being draw but decorations are not being draw.

Environment

Zed: v1.0.0 (Zed Dev bfd9bb8)
OS: Linux 1.0.0
Memory: 15.5 GiB
Architecture: x86_64

If applicable, add mockups / screenshots to help explain present your vision of the feature

Screenshot_20240409_225549

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

@XDeme1 XDeme1 added admin read Pending admin review defect [core label] triage Maintainer needs to classify the issue labels Apr 10, 2024
@XDeme1
Copy link
Contributor Author

XDeme1 commented Apr 10, 2024

This might not be related to window decorations but, some clicks, actions, and keyboard shortcuts don't work.
Sometimes after trying to Alt+F4 the window multiple times, this logs starts appearing:
Screenshot_20240410_105814

@JosephTLyons JosephTLyons added workspace Feedback for workspace management, layout, interactions, etc linux and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Apr 11, 2024
@mikayla-maki
Copy link
Contributor

This might not be related to window decorations but, some clicks, actions, and keyboard shortcuts don't work.
Sometimes after trying to Alt+F4 the window multiple times, this logs starts appearing:

This should be fixed now.

@LightTreasure
Copy link

LightTreasure commented Apr 13, 2024

I got the Window decorations working in Wayland, but it seems like I'm reverting an intentional change. Zed's code is specifically asking the Wayland compositor(aka server) to not draw window decorations, instead specifying that Zed will handle window decorations itself(client).

Here's the git diff:


--- a/crates/gpui/src/platform/linux/wayland/window.rs
+++ b/crates/gpui/src/platform/linux/wayland/window.rs
@@ -202,7 +202,7 @@ impl WaylandWindow {
                 decoration_manager.get_toplevel_decoration(&toplevel, &globals.qh, surface.id());

             // Request client side decorations if possible
-            decoration.set_mode(zxdg_toplevel_decoration_v1::Mode::ClientSide);
+            decoration.set_mode(zxdg_toplevel_decoration_v1::Mode::ServerSide);
         }

mikayla-maki pushed a commit that referenced this issue May 14, 2024
Based on #11046

- Partially fixes #10346 
- Fixes #9964

## Features
Window buttons

![image](https://github.com/zed-industries/zed/assets/71973804/1b7e0504-3925-45ba-90b5-5adb55e0d739)

Window drag

![image](https://github.com/zed-industries/zed/assets/71973804/9c509a37-e5a5-484c-9f80-c722aeee4380)

Native window context menu

![image](https://github.com/zed-industries/zed/assets/71973804/048ecf52-e277-49bb-a106-91cad226fd8a)

### Limitations

- No resizing
- Wayland only (though X11 always has window decorations)

### Technical

This PR adds three APIs to gpui.

1. `show_window_menu`: Triggers the native title bar context menu.
2. `start_system_move`: Tells the compositor to start dragging the
window.
3. `should_render_window_controls`: Whether the compositor doesn't
support server side decorations.

These APIs have only been implemented for Wayland, but they should be
portable to other platforms.

Release Notes:

- N/A

---------

Co-authored-by: Akilan Elango <akilan1997@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect [core label] linux workspace Feedback for workspace management, layout, interactions, etc
Projects
None yet
4 participants