mirror of
https://github.com/XZB-1248/Spark
synced 2025-09-27 04:26:20 +08:00
fix: desktop viewer doesn't work on unix-like system
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
## v0.2.1
|
## v0.2.1
|
||||||
|
|
||||||
* Fix: desktop connection timeout.
|
* Fix: desktop connection timeout.
|
||||||
|
* Fix: desktop viewer doesn't work on unix-like system.
|
||||||
* Add: show resolution of desktop.
|
* 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 {
|
func (s *screen) capture(img *image.RGBA, _ image.Rectangle) error {
|
||||||
var err error
|
image, err := screenshot.CaptureDisplay(displayIndex)
|
||||||
img, err = screenshot.CaptureDisplay(displayIndex)
|
if err == nil {
|
||||||
|
*img = *image
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -63,7 +63,7 @@ func InitDesktop(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// desktopEventWrapper returns a eventCallback function that will
|
// 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 {
|
func desktopEventWrapper(desktop *desktop) common.EventCallback {
|
||||||
return func(pack modules.Packet, device *melody.Session) {
|
return func(pack modules.Packet, device *melody.Session) {
|
||||||
if pack.Act == `RAW_DATA_ARRIVE` && pack.Data != nil {
|
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
|
// 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 {
|
func terminalEventWrapper(terminal *terminal) common.EventCallback {
|
||||||
return func(pack modules.Packet, device *melody.Session) {
|
return func(pack modules.Packet, device *melody.Session) {
|
||||||
if pack.Act == `RAW_DATA_ARRIVE` && pack.Data != nil {
|
if pack.Act == `RAW_DATA_ARRIVE` && pack.Data != nil {
|
||||||
|
Reference in New Issue
Block a user