x-backend #2

Merged
sashakoshka merged 34 commits from x-backend into main 2022-11-14 21:40:25 -07:00
Showing only changes of commit 5a0e0cd49b - Show all commits

View File

@ -14,6 +14,7 @@ import "golang.org/x/image/font/basicfont"
import "github.com/jezek/xgbutil"
import "github.com/jezek/xgb/xproto"
import "github.com/jezek/xgbutil/ewmh"
import "github.com/jezek/xgbutil/icccm"
import "github.com/jezek/xgbutil/xevent"
import "github.com/jezek/xgbutil/xwindow"
import "github.com/jezek/xgbutil/xgraphics"
@ -404,6 +405,22 @@ func factory (application *stone.Application) (output stone.Backend, err error)
)
backend.SetTitle(application.Title())
backend.SetIcon(application.Icon())
if err != nil { return }
// set minimum dimensions
minWidth :=
backend.metrics.cellWidth + backend.metrics.padding * 2
minHeight :=
backend.metrics.cellHeight + backend.metrics.padding * 2
err = icccm.WmNormalHintsSet (
backend.connection,
backend.window.Id,
&icccm.NormalHints {
Flags: icccm.SizeHintPMinSize,
MinWidth: uint(minWidth),
MinHeight: uint(minHeight),
})
if err != nil { return }
// create a canvas
backend.reallocateCanvas()