# wayland: Window controls and drag \(\#11525\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/d1ee2d0749ec68beede4f42e47b738ae77ebea51)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: d1ee2d0749ec68beede4f42e47b738ae77ebea51

Requested commit: d1ee2d0749ec68beede4f42e47b738ae77ebea51

Commit: d1ee2d0749ec68beede4f42e47b738ae77ebea51

Tree: 678e8e4988fb8cfa596e11567f490632c4652dab

Author: apricotbucket28

Committer: GitHub

## Message

```
wayland: Window controls and drag (#11525)

Based on https://github.com/zed-industries/zed/pull/11046

- Partially fixes #10346 
- Fixes https://github.com/zed-industries/zed/issues/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>
```

## Parents

- [db89353193ba5740761d6ca6ca14138ed5d0edf0](https://git.cafe/gitcafe/zed/commit/db89353193ba5740761d6ca6ca14138ed5d0edf0?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/d1ee2d0749ec68beede4f42e47b738ae77ebea51?format=markdown)
