diff --git a/server/internal/remote/manager.go b/server/internal/remote/manager.go index fe4413fb..23620046 100644 --- a/server/internal/remote/manager.go +++ b/server/internal/remote/manager.go @@ -102,10 +102,8 @@ func (manager *RemoteManager) StartStream() { if !xorg.ValidScreenSize(manager.config.ScreenWidth, manager.config.ScreenHeight, manager.config.ScreenRate) { manager.logger.Warn().Msgf("invalid screen option %dx%d@%d", manager.config.ScreenWidth, manager.config.ScreenHeight, manager.config.ScreenRate) - } else { - if err := xorg.ChangeScreenSize(manager.config.ScreenWidth, manager.config.ScreenHeight, manager.config.ScreenRate); err != nil { - manager.logger.Warn().Err(err).Msg("unable to change screen size") - } + } else if err := xorg.ChangeScreenSize(manager.config.ScreenWidth, manager.config.ScreenHeight, manager.config.ScreenRate); err != nil { + manager.logger.Warn().Err(err).Msg("unable to change screen size") } manager.createPipelines() diff --git a/server/internal/websocket/session.go b/server/internal/websocket/session.go index 2201ce53..23d71cdb 100644 --- a/server/internal/websocket/session.go +++ b/server/internal/websocket/session.go @@ -12,11 +12,6 @@ func (h *MessageHandler) SessionCreated(id string, session types.Session) error return err } - // send screen current resolution - if err := h.screenResolution(id, session); err != nil { - return err - } - if session.Admin() { // send screen configurations if admin if err := h.screenConfigurations(id, session); err != nil { @@ -37,6 +32,11 @@ func (h *MessageHandler) SessionConnected(id string, session types.Session) erro return err } + // send screen current resolution + if err := h.screenResolution(id, session); err != nil { + return err + } + // tell session there is a host host, ok := h.sessions.GetHost() if ok {