diff --git a/gtk-helpers.go b/gtk-helpers.go index a14e723..2886b93 100644 --- a/gtk-helpers.go +++ b/gtk-helpers.go @@ -32,7 +32,7 @@ func createTab(jid string, isMuc bool) { } } -func switchToTab(jid string) { +func switchToTab(jid string, w *gtk.Window) { current = jid tab, ok := tabs.Load(current) if !ok { @@ -145,6 +145,7 @@ func switchToTab(jid string) { }() win.SetChild(profile_box) + win.SetTransientFor(win) win.Present() }) userbox.AddController(gesture) diff --git a/main.go b/main.go index 617387a..fcb4fdc 100644 --- a/main.go +++ b/main.go @@ -45,6 +45,8 @@ var clientroot *xmpp.Client var uiQueue = make(chan func(), 100) +var window *gtk.ApplicationWindow + // stores members of mucs var mucmembers sync.Map @@ -243,7 +245,7 @@ func main() { b := gtk.NewButtonWithLabel(user) b.ConnectClicked(func() { b.AddCSSClass("accent") - switchToTab(user) + switchToTab(user, &window.Window) }) menu.Append(b) } @@ -308,7 +310,7 @@ func activate(app *gtk.Application) { gtk.STYLE_PROVIDER_PRIORITY_APPLICATION, ) - window := gtk.NewApplicationWindow(app) + window = gtk.NewApplicationWindow(app) app.SetMenubar(gio.NewMenu()) window.SetTitle("Lambda") @@ -436,7 +438,7 @@ func activate(app *gtk.Application) { b := gtk.NewButtonWithLabel(t) b.ConnectClicked(func() { b.AddCSSClass("accent") - switchToTab(t) + switchToTab(t, &window.Window) }) menu.Append(b) }