@@ -753,7 +753,7 @@ func (w *Window) processEvent(d driver, e event.Event) {
753
753
wrapper := & w .decorations .Ops
754
754
wrapper .Reset ()
755
755
size := e2 .Size // save the initial window size as the decorations will change it.
756
- e2 .FrameEvent .Size = w .decorate (d , e2 .FrameEvent , wrapper )
756
+ e2 .FrameEvent .Size , e2 . FrameEvent . DecorationSize = w .decorate (d , e2 .FrameEvent , wrapper )
757
757
w .out <- e2 .FrameEvent
758
758
frame , gotFrame := w .waitFrame (d )
759
759
ops .AddCall (& wrapper .Internal , & frame .Internal , ops.PC {}, ops .PCFor (& frame .Internal ))
@@ -791,6 +791,7 @@ func (w *Window) processEvent(d driver, e event.Event) {
791
791
w .decorations .size = image.Point {}
792
792
}
793
793
e2 .Config .Size = e2 .Config .Size .Sub (w .decorations .size )
794
+ e2 .Config .DecorationSize = w .decorations .size
794
795
w .out <- e2
795
796
case event.Event :
796
797
if w .queue .q .Queue (e2 ) {
@@ -856,9 +857,9 @@ func (w *Window) fallbackDecorate() bool {
856
857
}
857
858
858
859
// decorate the window if enabled and returns the corresponding Insets.
859
- func (w * Window ) decorate (d driver , e system.FrameEvent , o * op.Ops ) image.Point {
860
+ func (w * Window ) decorate (d driver , e system.FrameEvent , o * op.Ops ) ( image.Point , image. Point ) {
860
861
if ! w .fallbackDecorate () {
861
- return e .Size
862
+ return e .Size , image. Point {}
862
863
}
863
864
theme := w .decorations .Theme
864
865
if theme == nil {
@@ -906,13 +907,15 @@ func (w *Window) decorate(d driver, e system.FrameEvent, o *op.Ops) image.Point
906
907
size := image.Point {Y : dims .Size .Y }
907
908
op .Offset (f32.Point {Y : float32 (size .Y )}).Add (o )
908
909
appSize := e .Size .Sub (size )
910
+ decSize := w .decorations .size
909
911
if w .decorations .size != size {
910
912
w .decorations .size = size
911
913
cnf := w .decorations .Config
912
914
cnf .Size = appSize
915
+ cnf .DecorationSize = decSize
913
916
w .out <- ConfigEvent {Config : cnf }
914
917
}
915
- return appSize
918
+ return appSize , decSize
916
919
}
917
920
918
921
// Perform the actions on the window.
0 commit comments