mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 06:39:30 +08:00
[Linux] Restore min/max after fullscreen
This commit is contained in:
parent
876b845762
commit
99ca6d5e77
@ -495,17 +495,16 @@ func gtkBool(input bool) C.gboolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Window struct {
|
type Window struct {
|
||||||
appoptions *options.App
|
appoptions *options.App
|
||||||
debug bool
|
debug bool
|
||||||
gtkWindow unsafe.Pointer
|
gtkWindow unsafe.Pointer
|
||||||
contentManager unsafe.Pointer
|
contentManager unsafe.Pointer
|
||||||
webview unsafe.Pointer
|
webview unsafe.Pointer
|
||||||
applicationMenu *menu.Menu
|
applicationMenu *menu.Menu
|
||||||
menubar *C.GtkWidget
|
menubar *C.GtkWidget
|
||||||
vbox *C.GtkWidget
|
vbox *C.GtkWidget
|
||||||
accels *C.GtkAccelGroup
|
accels *C.GtkAccelGroup
|
||||||
minWidth, minHeight, maxWidth, maxHeight int
|
minWidth, minHeight, maxWidth, maxHeight int
|
||||||
tempMaxWidth, tempMinWidth, tempMaxHeight, tempMinHeight int
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func bool2Cint(value bool) C.int {
|
func bool2Cint(value bool) C.int {
|
||||||
@ -587,19 +586,17 @@ func (w *Window) cWebKitUserContentManager() *C.WebKitUserContentManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (w *Window) Fullscreen() {
|
func (w *Window) Fullscreen() {
|
||||||
w.tempMaxWidth = w.maxWidth
|
C.SetMinMaxSize(w.asGTKWindow(), C.int(0), C.int(0), C.int(0), C.int(0))
|
||||||
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()))
|
C.ExecuteOnMainThread(C.gtk_window_fullscreen, C.gpointer(w.asGTKWindow()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *Window) UnFullscreen() {
|
func (w *Window) UnFullscreen() {
|
||||||
|
if !w.IsFullScreen() {
|
||||||
|
return
|
||||||
|
}
|
||||||
C.ExecuteOnMainThread(C.gtk_window_unfullscreen, C.gpointer(w.asGTKWindow()))
|
C.ExecuteOnMainThread(C.gtk_window_unfullscreen, C.gpointer(w.asGTKWindow()))
|
||||||
w.SetMaxSize(w.tempMaxWidth, w.tempMaxHeight)
|
w.SetMinSize(w.minWidth, w.minHeight)
|
||||||
w.SetMinSize(w.tempMinWidth, w.tempMinHeight)
|
w.SetMaxSize(w.maxWidth, w.maxHeight)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *Window) Destroy() {
|
func (w *Window) Destroy() {
|
||||||
|
Loading…
Reference in New Issue
Block a user