From 54ba6d47f49ce8afc5c434ccce54f7512c1810ac Mon Sep 17 00:00:00 2001 From: Travis McLane Date: Tue, 2 May 2023 17:37:23 -0500 Subject: [PATCH] Revert "[linux] dispatchOnMainThread" This reverts commit 346517a185640aa40bc8710b815cf3e5ff7dc4a8. --- v3/pkg/application/webview_window_linux.go | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/v3/pkg/application/webview_window_linux.go b/v3/pkg/application/webview_window_linux.go index 264e93ca..04d4b9f6 100644 --- a/v3/pkg/application/webview_window_linux.go +++ b/v3/pkg/application/webview_window_linux.go @@ -326,21 +326,26 @@ func (w *linuxWebviewWindow) disableSizeConstraints() { } func (w *linuxWebviewWindow) unfullscreen() { - C.gtk_window_unfullscreen((*C.GtkWindow)(w.window)) - w.unmaximise() + fmt.Println("unfullscreen") + globalApplication.dispatchOnMainThread(func() { + C.gtk_window_unfullscreen((*C.GtkWindow)(w.window)) + w.unmaximise() + }) } func (w *linuxWebviewWindow) fullscreen() { w.maximise() w.lastWidth, w.lastHeight = w.size() - 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) + 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) + }) } func (w *linuxWebviewWindow) unminimise() {