5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-10 20:53:21 +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,26 +326,21 @@ func (w *linuxWebviewWindow) disableSizeConstraints() {
} }
func (w *linuxWebviewWindow) unfullscreen() { func (w *linuxWebviewWindow) unfullscreen() {
fmt.Println("unfullscreen") C.gtk_window_unfullscreen((*C.GtkWindow)(w.window))
globalApplication.dispatchOnMainThread(func() { w.unmaximise()
C.gtk_window_unfullscreen((*C.GtkWindow)(w.window))
w.unmaximise()
})
} }
func (w *linuxWebviewWindow) fullscreen() { func (w *linuxWebviewWindow) fullscreen() {
w.maximise() w.maximise()
w.lastWidth, w.lastHeight = w.size() w.lastWidth, w.lastHeight = w.size()
globalApplication.dispatchOnMainThread(func() { x, y, width, height, scale := w.getCurrentMonitorGeometry()
x, y, width, height, scale := w.getCurrentMonitorGeometry() if x == -1 && y == -1 && width == -1 && height == -1 {
if x == -1 && y == -1 && width == -1 && height == -1 { return
return }
} w.setMinMaxSize(0, 0, width*scale, height*scale)
w.setMinMaxSize(0, 0, width*scale, height*scale) w.setSize(width*scale, height*scale)
w.setSize(width*scale, height*scale) C.gtk_window_fullscreen((*C.GtkWindow)(w.window))
C.gtk_window_fullscreen((*C.GtkWindow)(w.window)) w.setPosition(0, 0)
w.setPosition(0, 0)
})
} }
func (w *linuxWebviewWindow) unminimise() { func (w *linuxWebviewWindow) unminimise() {