mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
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:
@ -188,16 +188,13 @@ func (config *VideoConfig) GetPipeline(screen ScreenSize) (string, error) {
|
||||
}[:], " "), nil
|
||||
}
|
||||
|
||||
func (config *VideoConfig) GetBitrateFn(getScreen func() *ScreenSize) func() (int, error) {
|
||||
func (config *VideoConfig) GetBitrateFn(getScreen func() ScreenSize) func() (int, error) {
|
||||
return func() (int, error) {
|
||||
if config.Bitrate > 0 {
|
||||
return config.Bitrate, nil
|
||||
}
|
||||
|
||||
screen := getScreen()
|
||||
if screen == nil {
|
||||
return 0, fmt.Errorf("screen is nil")
|
||||
}
|
||||
|
||||
values := map[string]any{
|
||||
"width": screen.Width,
|
||||
|
@ -19,12 +19,6 @@ type ScreenSize struct {
|
||||
Rate int16
|
||||
}
|
||||
|
||||
type ScreenConfiguration struct {
|
||||
Width int
|
||||
Height int
|
||||
Rates map[int]int16
|
||||
}
|
||||
|
||||
type KeyboardModifiers struct {
|
||||
NumLock *bool
|
||||
CapsLock *bool
|
||||
@ -57,9 +51,9 @@ type DesktopManager interface {
|
||||
ButtonPress(code uint32) error
|
||||
KeyPress(codes ...uint32) error
|
||||
ResetKeys()
|
||||
ScreenConfigurations() map[int]ScreenConfiguration
|
||||
SetScreenSize(ScreenSize) error
|
||||
GetScreenSize() *ScreenSize
|
||||
ScreenConfigurations() []ScreenSize
|
||||
SetScreenSize(ScreenSize) (ScreenSize, error)
|
||||
GetScreenSize() ScreenSize
|
||||
SetKeyboardMap(KeyboardMap) error
|
||||
GetKeyboardMap() (*KeyboardMap, error)
|
||||
SetKeyboardModifiers(mod KeyboardModifiers)
|
||||
|
Reference in New Issue
Block a user