mirror of
https://github.com/XZB-1248/Spark
synced 2025-09-26 20:21:11 +08:00
fix: desktop viewer doesn't work on unix-like system
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
## v0.2.1
|
||||
|
||||
* Fix: desktop connection timeout.
|
||||
* Fix: desktop viewer doesn't work on unix-like system.
|
||||
* Add: show resolution of desktop.
|
||||
|
||||
* 修复:远程桌面连接超时。
|
||||
* 修复:远程桌面在类unix系统下无法显示。
|
||||
* 新增:显示远程桌面的分辨率。
|
||||
|
||||
|
||||
|
@@ -17,8 +17,10 @@ func (s *screen) init(displayIndex int) {
|
||||
}
|
||||
|
||||
func (s *screen) capture(img *image.RGBA, _ image.Rectangle) error {
|
||||
var err error
|
||||
img, err = screenshot.CaptureDisplay(displayIndex)
|
||||
image, err := screenshot.CaptureDisplay(displayIndex)
|
||||
if err == nil {
|
||||
*img = *image
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
@@ -63,7 +63,7 @@ func InitDesktop(ctx *gin.Context) {
|
||||
}
|
||||
|
||||
// desktopEventWrapper returns a eventCallback function that will
|
||||
// be called when device need to send a packet to browser terminal
|
||||
// be called when device need to send a packet to browser
|
||||
func desktopEventWrapper(desktop *desktop) common.EventCallback {
|
||||
return func(pack modules.Packet, device *melody.Session) {
|
||||
if pack.Act == `RAW_DATA_ARRIVE` && pack.Data != nil {
|
||||
|
@@ -64,7 +64,7 @@ func InitTerminal(ctx *gin.Context) {
|
||||
}
|
||||
|
||||
// terminalEventWrapper returns a eventCallback function that will
|
||||
// be called when device need to send a packet to browser terminal
|
||||
// be called when device need to send a packet to browser
|
||||
func terminalEventWrapper(terminal *terminal) common.EventCallback {
|
||||
return func(pack modules.Packet, device *melody.Session) {
|
||||
if pack.Act == `RAW_DATA_ARRIVE` && pack.Data != nil {
|
||||
|
Reference in New Issue
Block a user