@@ -157,7 +157,7 @@ pub const Window = struct {
157157 config : DerivedConfig ,
158158 window : c.Window ,
159159 gtk_window : * c.GtkWindow ,
160- blur_region : Region ,
160+ blur_region : Region = .{} ,
161161
162162 const DerivedConfig = struct {
163163 blur : bool ,
@@ -190,34 +190,11 @@ pub const Window = struct {
190190 c .gdk_x11_surface_get_type (),
191191 ) == 0 ) return error .NotX11Surface ;
192192
193- const blur_region : Region = blur : {
194- if ((comptime ! adwaita .versionAtLeast (0 , 0 , 0 )) or
195- ! adwaita .enabled (config )) break :blur .{};
196-
197- // NOTE(pluiedev): CSDs are a f--king mistake.
198- // Please, GNOME, stop this nonsense of making a window ~30% bigger
199- // internally than how they really are just for your shadows and
200- // rounded corners and all that fluff. Please. I beg of you.
201- var x : f64 = 0 ;
202- var y : f64 = 0 ;
203- c .gtk_native_get_surface_transform (
204- @ptrCast (gtk_window ),
205- & x ,
206- & y ,
207- );
208-
209- break :blur .{
210- .x = @intFromFloat (x ),
211- .y = @intFromFloat (y ),
212- };
213- };
214-
215193 return .{
216194 .app = app ,
217195 .config = DerivedConfig .init (config ),
218196 .window = c .gdk_x11_surface_get_xid (surface ),
219197 .gtk_window = gtk_window ,
220- .blur_region = blur_region ,
221198 };
222199 }
223200
@@ -241,6 +218,24 @@ pub const Window = struct {
241218 }
242219
243220 pub fn syncAppearance (self : * Window ) ! void {
221+ self .blur_region = blur : {
222+ // NOTE(pluiedev): CSDs are a f--king mistake.
223+ // Please, GNOME, stop this nonsense of making a window ~30% bigger
224+ // internally than how they really are just for your shadows and
225+ // rounded corners and all that fluff. Please. I beg of you.
226+ var x : f64 = 0 ;
227+ var y : f64 = 0 ;
228+ c .gtk_native_get_surface_transform (
229+ @ptrCast (self .gtk_window ),
230+ & x ,
231+ & y ,
232+ );
233+
234+ break :blur .{
235+ .x = @intFromFloat (x ),
236+ .y = @intFromFloat (y ),
237+ };
238+ };
244239 try self .syncBlur ();
245240 }
246241
0 commit comments