# Custom Window Decorations on Linux

**URL:** <https://discourse.glfw.org/t/custom-window-decorations-on-linux/2812>\
**Category:** support\
**Created:** [January 3, 2025, 3:35pm UTC](https://discourse.glfw.org/t/custom-window-decorations-on-linux/2812 "2025-01-03T15:35:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![WerWolv](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/werwolv/32/992_2.png) [@WerWolv](https://discourse.glfw.org/u/WerWolv)\
**Post date:** [January 3, 2025, 3:35pm UTC](https://discourse.glfw.org/t/custom-window-decorations-on-linux/2812/1 "2025-01-03T15:35:19Z")

</div>

Hi!

What’s the correct way to handle custom window decorations on Linux with glfw? (Both under X11 and Wayland)

Currently, implementing these is very platform dependent. For example, on Windows I’m using a custom windowProc function to handle Aero and draw window shadows on a borderless window. On macOS, I’m using a regular window but use Apple’s cocoa API to make the title bar transparent and move it into the client area.  
On Linux however, I can’t seem to find a proper way to do it. From what I can tell, glfw uses libdecor to draw the decoration client sided but there’s no way to customize it I believe.

My goal is to achieve something similar to this, just on Linux. Resizing, moving and drawing of the window border/shadow being handled by libdecor but drawing the title bar ourselves.

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/7b9a1741d4aa5e15d582b92ac954566e9c8fc69b.jpeg)

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [January 9, 2025, 11:39am UTC](https://discourse.glfw.org/t/custom-window-decorations-on-linux/2812/2 "2025-01-09T11:39:35Z")

</div>

Hi!

I didn’t initially answer this as I’m not that familiar with Wayland decorations, however given no-one else has responded I think the initial place to look at might be the fallback decorations GLFW uses:

> <https://github.com/glfw/glfw/blob/master/src/wl_window.c#L221-L252>

Perhaps there might be some way to combine this with an undecorated GLFW window, drawing these decorations over the client area?
