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() {