diff options
| author | Pietro Gagliardi <[email protected]> | 2014-02-17 01:40:53 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-02-17 01:40:53 -0500 |
| commit | 0595135d9a259f7c54a361f0df6a6f7cb830a076 (patch) | |
| tree | b2ef9b7fdfd709269d12f618e8891ddd6f4ef72a /sysdata_windows.go | |
| parent | 0856e953be71f13e4062c4e2ca44002ca4a68ac3 (diff) | |
Fixed the GTK+ crashes (I think) by making resizes synchronous. Since all control resizes happen on the UI thread anyway, we don't need to dispatch back; just call the resizing functions directly. Windows gets this fix too for consistency (and also because it gets rid of the only asynchronous oddity in the system).
Diffstat (limited to 'sysdata_windows.go')
| -rw-r--r-- | sysdata_windows.go | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/sysdata_windows.go b/sysdata_windows.go index 7a5abae..326db06 100644 --- a/sysdata_windows.go +++ b/sysdata_windows.go @@ -226,23 +226,15 @@ func (s *sysData) setText(text string) error { } func (s *sysData) setRect(x int, y int, width int, height int) error { - ret := make(chan uiret) - defer close(ret) - uitask <- &uimsg{ - call: _moveWindow, - p: []uintptr{ - uintptr(s.hwnd), - uintptr(x), - uintptr(y), - uintptr(width), - uintptr(height), - uintptr(_TRUE), - }, - ret: ret, - } - r := <-ret - if r.ret == 0 { // failure - return fmt.Errorf("error setting window/control rect: %v", r.err) + r1, _, err := _moveWindow.Call( + uintptr(s.hwnd), + uintptr(x), + uintptr(y), + uintptr(width), + uintptr(height), + uintptr(_TRUE)) + if r1 == 0 { // failure + return fmt.Errorf("error setting window/control rect: %v", err) } return nil } |
