Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions draw/init_plan9.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ type Display struct {
DefaultFont *Font
DefaultSubfont *Subfont

dir string
conn *drawFile
ctl *os.File
mousectl *Mousectl
Expand Down Expand Up @@ -159,8 +160,8 @@ func Init(errch chan<- error, fontname, label, winsize string) (*Display, error)
}

id := atoi(info[:1*12])
drawDir := fmt.Sprintf("/dev/draw/%d", id)
fd, err := os.OpenFile(drawDir+"/data", os.O_RDWR|syscall.O_CLOEXEC, 0666)
d.dir = fmt.Sprintf("/dev/draw/%d", id)
fd, err := os.OpenFile(d.dir+"/data", os.O_RDWR|syscall.O_CLOEXEC, 0666)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -263,6 +264,13 @@ func (d *Display) getwindow(ref int) error {
// If reattaching, maintain value of screen pointer.
func gengetwindow(d *Display, winname string, ref int) error {
var i *Image
var err error

d.ctl.Close()
d.ctl, err = os.OpenFile(d.dir + "/ctl", os.O_RDWR|syscall.O_CLOEXEC, 0666)
if err != nil {
return err
}

buf, err := ioutil.ReadFile(winname)
if err != nil {
Expand Down