code review 7102052: taowm: fix changeWorkspace when the destination workspa... (issue 7102052)

3 views
Skip to first unread message

nige...@golang.org

unread,
Jan 12, 2013, 9:17:35 PM1/12/13
to nige...@golang.org, ta...@googlegroups.com, re...@codereview-hr.appspotmail.com
Reviewers: nigeltao,

Message:
Hello nige...@golang.org (cc: ta...@googlegroups.com),

I'd like you to review this change to
https://code.google.com/p/taowm/


Description:
taowm: fix changeWorkspace when the destination workspace's screen
is non-nil.

Please review this at https://codereview.appspot.com/7102052/

Affected files:
M taowm/actions.go


Index: taowm/actions.go
===================================================================
--- a/taowm/actions.go
+++ b/taowm/actions.go
@@ -163,7 +163,7 @@
break
}
}
- changeWorkspace(k0, k1)
+ changeWorkspace(k0.screen, k0, k1)
return true
}

@@ -179,19 +179,27 @@
if k1 == &dummyWorkspace || k1 == k0 {
return true
}
- changeWorkspace(k0, k1)
+ changeWorkspace(k0.screen, k0, k1)
return true
}

func doWorkspaceNew(k0 *workspace, _ interface{}) bool {
- changeWorkspace(k0, newWorkspace(k0.screen))
+ changeWorkspace(k0.screen, k0, newWorkspace(k0.screen))
return true
}

-func changeWorkspace(k0, k1 *workspace) {
+func changeWorkspace(s0 *screen, k0, k1 *workspace) {
+ if s0 == nil || k0 == nil || k1 == nil {
+ return
+ }
k0.listing = listNone
- s := k0.screen
- s.workspace, k1.screen, k0.screen = k1, s, nil
+ s1 := k1.screen
+ if s1 != nil {
+ s1.workspace, k0.screen = k0, s1
+ } else {
+ k0.screen = nil
+ }
+ s0.workspace, k1.screen = k1, s0
k1.layout()
k0.layout()
if p, err := xp.QueryPointer(xConn, rootXWin).Reply(); err != nil {
@@ -200,7 +208,10 @@
} else {
k1.focusFrame(k1.frameContaining(p.RootX, p.RootY))
}
- s.repaint()
+ s0.repaint()
+ if s1 != nil {
+ s1.repaint()
+ }
makeLists()
}



nige...@golang.org

unread,
Jan 12, 2013, 9:18:59 PM1/12/13
to nige...@golang.org, ta...@googlegroups.com, re...@codereview-hr.appspotmail.com
*** Submitted as
https://code.google.com/p/taowm/source/detail?r=6ed85b453795 ***

taowm: fix changeWorkspace when the destination workspace's screen
is non-nil.

R=nigeltao
CC=taowm
https://codereview.appspot.com/7102052


https://codereview.appspot.com/7102052/
Reply all
Reply to author
Forward
0 new messages