5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-10 22:19:46 +08:00

[linux] dispatchOnMainThread

This commit is contained in:
Travis McLane 2023-05-02 13:12:26 -05:00
parent 5129c0f4e2
commit 281f6335c1

View File

@ -326,17 +326,13 @@ func (w *linuxWebviewWindow) disableSizeConstraints() {
}
func (w *linuxWebviewWindow) unfullscreen() {
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()
globalApplication.dispatchOnMainThread(func() {
x, y, width, height, scale := w.getCurrentMonitorGeometry()
if x == -1 && y == -1 && width == -1 && height == -1 {
return
@ -345,7 +341,6 @@ func (w *linuxWebviewWindow) fullscreen() {
w.setSize(width*scale, height*scale)
C.gtk_window_fullscreen((*C.GtkWindow)(w.window))
w.setPosition(0, 0)
})
}
func (w *linuxWebviewWindow) unminimise() {