file chooser dialog diabled by default.

This commit is contained in:
Miroslav Šedivý
2023-11-24 10:39:09 +01:00
parent d9bcde3331
commit b40c0778c8
7 changed files with 37 additions and 10 deletions

View File

@ -84,6 +84,10 @@ func (manager *DesktopManagerCtx) CloseFileChooserDialog() {
}
}
func (manager *DesktopManagerCtx) IsFileChooserDialogEnabled() bool {
return manager.config.FileChooserDialog
}
func (manager *DesktopManagerCtx) IsFileChooserDialogOpened() bool {
mu.Lock()
defer mu.Unlock()

View File

@ -71,11 +71,15 @@ func (manager *DesktopManagerCtx) Start() {
manager.logger.Panic().Err(err).Msg("unable to connect to input driver")
}
// set up event listeners
xevent.Unminimize = manager.config.Unminimize
xevent.FileChooserDialog = manager.config.FileChooserDialog
go xevent.EventLoop(manager.config.Display)
// In case it was opened
go manager.CloseFileChooserDialog()
// in case it was opened
if manager.config.FileChooserDialog {
go manager.CloseFileChooserDialog()
}
manager.OnEventError(func(error_code uint8, message string, request_code uint8, minor_code uint8) {
manager.logger.Warn().