Skip to content

Commit

Permalink
WindowBase: Fix setAndClearStyleBits in case of overlapping
Browse files Browse the repository at this point in the history
  • Loading branch information
lxn committed Jun 30, 2015
1 parent bc11db1 commit 8afd555
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions window.go
Expand Up @@ -482,10 +482,7 @@ func (wb *WindowBase) setAndClearStyleBits(set, clear uint32) error {
return lastError("GetWindowLong")
}

var newStyle uint32
newStyle = (style | set) &^ clear

if newStyle != style {
if newStyle := style&^clear | set; newStyle != style {
win.SetLastError(0)
if win.SetWindowLong(wb.hWnd, win.GWL_STYLE, int32(newStyle)) == 0 {
return lastError("SetWindowLong")
Expand Down

0 comments on commit 8afd555

Please sign in to comment.