wmww / gtk-layer-shell

A library to create panels and other desktop components for Wayland using the Layer Shell protocol
GNU General Public License v3.0
318 stars 16 forks source link

Titlebar not rendered #116

Closed Jaakkonen closed 2 years ago

Jaakkonen commented 2 years ago

When running a following program:

#!/bin/python3
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('GtkLayerShell', '0.1')

from gi.repository import Gtk, GtkLayerShell

h = Gtk.HeaderBar()
h.set_title("Log in")

w = Gtk.Window()
w.add(Gtk.Label(label='Hello'))
w.set_titlebar(h)

GtkLayerShell.init_for_window(w)
w.show_all()

w.connect('destroy', Gtk.main_quit)
Gtk.main()

The header bar is not rendered. I can make it show by making the in-most element in Gtk.Window be a vertical box with the header bar and content but then the proportions aren't handled by GTK automatically.

Tested on Sway 1.6.1, GtkLayerShell v0.6.0 and GTK v3.24.{26,31}

wmww commented 2 years ago

This is intended behavior. The titlebar is largely for window control. Layer Shell windows can not be controlled by the user this way, so the titlebar gets hidden.

You can probably make it show by calling w.set_decorated(True) after GtkLayerShell.init_for_window(w), or use the workaround you found.