Merge pull request #91 from m1k1o/screen-size-bug

Screen size bug
This commit is contained in:
Nurdism 2020-06-18 18:54:25 -04:00 committed by GitHub
commit aee08f6830
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 9 deletions

View File

@ -102,11 +102,9 @@ 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 {
} 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()
manager.video.Start()

View File

@ -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 {