Skip to content

Commit

Permalink
do not hardcode window class, let applications do it
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergii Zaitsev committed Nov 27, 2018
1 parent 9cd25ac commit e233144
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 6 additions & 1 deletion examples/counter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"net/http"
"os"
"os/signal"
"runtime"
"sync"

"github.com/zserge/lorca"
Expand All @@ -35,7 +36,11 @@ func (c *counter) Value() int {
}

func main() {
ui, err := lorca.New("", "", 480, 320)
args := []string{}
if runtime.GOOS == "linux" {
args = append(args, "--class=Lorca")
}
ui, err := lorca.New("", "", 480, 320, args...)
if err != nil {
log.Fatal(err)
}
Expand Down
4 changes: 0 additions & 4 deletions ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"io/ioutil"
"os"
"reflect"
"runtime"
)

// UI interface allows talking to the HTML5 UI from Go.
Expand Down Expand Up @@ -76,9 +75,6 @@ func New(url string, dir string, width, height int, customArgs ...string) (UI, e
args = append(args, fmt.Sprintf("--window-size=%d,%d", width, height))
args = append(args, customArgs...)
args = append(args, "--remote-debugging-port=0")
if runtime.GOOS == "linux" {
args = append(args, "--class=Lorca")
}

chrome, err := newChromeWithArgs(ChromeExecutable(), args...)
done := make(chan struct{})
Expand Down

0 comments on commit e233144

Please sign in to comment.