mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 09:31:48 +08:00
[linux] Fix min/max size after fullscreen
This commit is contained in:
parent
30a4f47cba
commit
3d02a314b9
@ -495,16 +495,17 @@ func gtkBool(input bool) C.gboolean {
|
||||
}
|
||||
|
||||
type Window struct {
|
||||
appoptions *options.App
|
||||
debug bool
|
||||
gtkWindow unsafe.Pointer
|
||||
contentManager unsafe.Pointer
|
||||
webview unsafe.Pointer
|
||||
applicationMenu *menu.Menu
|
||||
menubar *C.GtkWidget
|
||||
vbox *C.GtkWidget
|
||||
accels *C.GtkAccelGroup
|
||||
minWidth, minHeight, maxWidth, maxHeight int
|
||||
appoptions *options.App
|
||||
debug bool
|
||||
gtkWindow unsafe.Pointer
|
||||
contentManager unsafe.Pointer
|
||||
webview unsafe.Pointer
|
||||
applicationMenu *menu.Menu
|
||||
menubar *C.GtkWidget
|
||||
vbox *C.GtkWidget
|
||||
accels *C.GtkAccelGroup
|
||||
minWidth, minHeight, maxWidth, maxHeight int
|
||||
tempMaxWidth, tempMinWidth, tempMaxHeight, tempMinHeight int
|
||||
}
|
||||
|
||||
func bool2Cint(value bool) C.int {
|
||||
@ -586,6 +587,10 @@ func (w *Window) cWebKitUserContentManager() *C.WebKitUserContentManager {
|
||||
}
|
||||
|
||||
func (w *Window) Fullscreen() {
|
||||
w.tempMaxWidth = w.maxWidth
|
||||
w.tempMaxHeight = w.maxHeight
|
||||
w.tempMinWidth = w.minWidth
|
||||
w.tempMinHeight = w.minHeight
|
||||
w.SetMaxSize(0, 0)
|
||||
w.SetMinSize(0, 0)
|
||||
C.ExecuteOnMainThread(C.gtk_window_fullscreen, C.gpointer(w.asGTKWindow()))
|
||||
@ -593,8 +598,8 @@ func (w *Window) Fullscreen() {
|
||||
|
||||
func (w *Window) UnFullscreen() {
|
||||
C.ExecuteOnMainThread(C.gtk_window_unfullscreen, C.gpointer(w.asGTKWindow()))
|
||||
w.SetMaxSize(w.maxWidth, w.maxHeight)
|
||||
w.SetMinSize(w.minWidth, w.minHeight)
|
||||
w.SetMaxSize(w.tempMaxWidth, w.tempMaxHeight)
|
||||
w.SetMinSize(w.tempMinWidth, w.tempMinHeight)
|
||||
}
|
||||
|
||||
func (w *Window) Destroy() {
|
||||
|
Loading…
Reference in New Issue
Block a user