From 281f6335c1b81ef9580d971d09e128860da42e75 Mon Sep 17 00:00:00 2001 From: Travis McLane Date: Tue, 2 May 2023 13:12:26 -0500 Subject: [PATCH] [linux] dispatchOnMainThread --- v3/pkg/application/webview_window_linux.go | 25 +++++++++------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/v3/pkg/application/webview_window_linux.go b/v3/pkg/application/webview_window_linux.go index 359ff1383..53e11c96c 100644 --- a/v3/pkg/application/webview_window_linux.go +++ b/v3/pkg/application/webview_window_linux.go @@ -326,26 +326,21 @@ func (w *linuxWebviewWindow) disableSizeConstraints() { } func (w *linuxWebviewWindow) unfullscreen() { - fmt.Println("unfullscreen") - globalApplication.dispatchOnMainThread(func() { - C.gtk_window_unfullscreen((*C.GtkWindow)(w.window)) - w.unmaximise() - }) + C.gtk_window_unfullscreen((*C.GtkWindow)(w.window)) + w.unmaximise() } func (w *linuxWebviewWindow) fullscreen() { w.maximise() w.lastWidth, w.lastHeight = w.size() - globalApplication.dispatchOnMainThread(func() { - x, y, width, height, scale := w.getCurrentMonitorGeometry() - if x == -1 && y == -1 && width == -1 && height == -1 { - return - } - w.setMinMaxSize(0, 0, width*scale, height*scale) - w.setSize(width*scale, height*scale) - C.gtk_window_fullscreen((*C.GtkWindow)(w.window)) - w.setPosition(0, 0) - }) + x, y, width, height, scale := w.getCurrentMonitorGeometry() + if x == -1 && y == -1 && width == -1 && height == -1 { + return + } + w.setMinMaxSize(0, 0, width*scale, height*scale) + w.setSize(width*scale, height*scale) + C.gtk_window_fullscreen((*C.GtkWindow)(w.window)) + w.setPosition(0, 0) } func (w *linuxWebviewWindow) unminimise() {