Smithay / wayland-window

A simple window-decorations library built on top of wayland-client.
MIT License
18 stars 11 forks source link

Add control buttons #4

Closed elinorbgr closed 6 years ago

elinorbgr commented 8 years ago

Add a "close" button on the upper-right corner, to close the window.

A "maximize/unmaximize" and "minimize" button can most likely be considered too.

elinorbgr commented 7 years ago

(I can mentor anyone who would be willing to attack this but is not familiar enough with wayland)

dns2utf8 commented 7 years ago

Sounds interesting. I have no clue how this works 😜

elinorbgr commented 7 years ago

(sorry for the late answer, I was away from computer)

The rough idea here is that wayland does not handle decorations, so we are forced to draw them oursleves. This means there are a few substeps to this:

The wayland-specific stuff is mostly in the last part, for merging events generated by our decorations with events coming from the server.

dns2utf8 commented 7 years ago

Okay, sounds like some work. I am setting up an Arch VM for the development, have not switched my main desktop to wayland.

dns2utf8 commented 7 years ago

My current problem is funny/strange: I can not run the example. It hangs in the ´event_queue.dispatch().unwrap()´. My setup is Arch Linux with KDE plasma.

elinorbgr commented 7 years ago

Oh well... This kind of issues occur way too often :(

Can you run the example with the env variable WAYLAND_DEBUG=1 set and provide the output here?

emersion commented 7 years ago

A better solution would be to use server-side decorations for DEs that implement it. That's a wayland extension: https://cgit.kde.org/kwayland.git/tree/src/client/protocols/server-decoration.xml

elinorbgr commented 7 years ago

For now KDE is the only compositor to implement server-side decoration AFAIK.

So yes, it'd be good to use them when available, but we still need to be able to draw our own. Client-side decoration is still the "official" way of doing it.

emersion commented 6 years ago

Is this bug fixed?

elinorbgr commented 6 years ago

Basic control buttons exist with the latest version of wayland-window (which is used by the latest version of winit). So this can be closed, yeah.