Custom sizes with XRandR (#25)

* xserver dummy with RandR.

* update.

* remove screen configurations from xorg.

* screen size cannot be nil anymore.

* use predefined screen configurations.

* use screen configurations.

* fix error.

* remove comment.
This commit is contained in:
Miroslav Šedivý 2023-02-14 21:18:47 +01:00 committed by GitHub
parent bfabee12e2
commit f8b128e1e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 666 additions and 107 deletions

View file

@ -13,11 +13,20 @@ func (h *MessageHandlerCtx) screenSet(session types.Session, payload *message.Sc
return errors.New("is not the admin")
}
data := types.ScreenSize(*payload)
if err := h.desktop.SetScreenSize(data); err != nil {
size, err := h.desktop.SetScreenSize(types.ScreenSize{
Width: payload.Width,
Height: payload.Height,
Rate: payload.Rate,
})
if err != nil {
return err
}
h.sessions.Broadcast(event.SCREEN_UPDATED, payload)
h.sessions.Broadcast(event.SCREEN_UPDATED, message.ScreenSize{
Width: size.Width,
Height: size.Height,
Rate: size.Rate,
})
return nil
}