Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
Merge 1d07ee5 into a95bcff
Browse files Browse the repository at this point in the history
  • Loading branch information
maddie committed Apr 28, 2022
2 parents a95bcff + 1d07ee5 commit 468defc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions astilectron.go
Expand Up @@ -13,7 +13,7 @@ import (
// Versions
const (
DefaultAcceptTCPTimeout = 30 * time.Second
DefaultVersionAstilectron = "0.52.0"
DefaultVersionAstilectron = "0.53.0"
DefaultVersionElectron = "11.4.3"
)

Expand Down Expand Up @@ -222,7 +222,7 @@ func (a *Astilectron) listenTCP() (err error) {

// watchNoAccept checks whether a TCP connection is accepted quickly enough
func (a *Astilectron) watchNoAccept(timeout time.Duration, chanAccepted chan bool) {
//check timeout
// check timeout
if timeout == 0 {
timeout = DefaultAcceptTCPTimeout
}
Expand Down
13 changes: 13 additions & 0 deletions window.go
Expand Up @@ -20,6 +20,7 @@ const (
EventNameWindowCmdCreate = "window.cmd.create"
EventNameWindowCmdDestroy = "window.cmd.destroy"
EventNameWindowCmdFocus = "window.cmd.focus"
EventNameWindowCmdGetBounds = "window.cmd.get.bounds"
EventNameWindowCmdHide = "window.cmd.hide"
EventNameWindowCmdLog = "window.cmd.log"
EventNameWindowCmdMaximize = "window.cmd.maximize"
Expand All @@ -44,12 +45,14 @@ const (
EventNameWindowEventContentProtectionSet = "window.event.content.protection.set"
EventNameWindowEventDidFinishLoad = "window.event.did.finish.load"
EventNameWindowEventFocus = "window.event.focus"
EventNameWindowEventGetBounds = "window.event.get.bounds"
EventNameWindowEventHide = "window.event.hide"
EventNameWindowEventMaximize = "window.event.maximize"
eventNameWindowEventMessage = "window.event.message"
eventNameWindowEventMessageCallback = "window.event.message.callback"
EventNameWindowEventMinimize = "window.event.minimize"
EventNameWindowEventMove = "window.event.move"
EventNameWindowEventWillMove = "window.event.will.move"
EventNameWindowEventReadyToShow = "window.event.ready.to.show"
EventNameWindowEventResize = "window.event.resize"
EventNameWindowEventResizeContent = "window.event.resize.content"
Expand Down Expand Up @@ -344,6 +347,16 @@ func (w *Window) Focus() (err error) {
return
}

// GetBounds gets the bounds of the window
func (w *Window) GetBounds() (rect *RectangleOptions, err error) {
if err = w.ctx.Err(); err != nil {
return
}
var event Event
event, err = synchronousEvent(w.ctx, w, w.w, Event{Name: EventNameWindowCmdGetBounds, TargetID: w.id}, EventNameWindowEventGetBounds)
return event.Bounds, err
}

// Hide hides the window
func (w *Window) Hide() (err error) {
if err = w.ctx.Err(); err != nil {
Expand Down

0 comments on commit 468defc

Please sign in to comment.