Revert "[linux] dispatchOnMainThread"

This reverts commit 346517a185640aa40bc8710b815cf3e5ff7dc4a8.
This commit is contained in:
Travis McLane
2023-05-10 09:10:03 -05:00
parent 17647e2c2f
commit 54ba6d47f4
+15 -10
View File
@@ -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() {