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: turn off fullscreen when there's no fullscreen window; when
replacing a closed fullscreen window, allow the replacement to come
from an already framed window.
Please review this at
https://codereview.appspot.com/7198043/
Affected files:
M taowm/actions.go
M taowm/main.go
Index: taowm/actions.go
===================================================================
--- a/taowm/actions.go
+++ b/taowm/actions.go
@@ -381,12 +381,22 @@
}
w.configure()
}
+ if k0.fullscreen && k0.focusedFrame.window == nil {
+ if k0.screen != nil {
+ doFullscreen(k0, nil)
+ } else {
+ k0.fullscreen = false
+ }
+ }
}
makeLists()
return true
}
func doFullscreen(k *workspace, _ interface{}) bool {
+ if !k.fullscreen && k.focusedFrame.window == nil {
+ return true
+ }
k.fullscreen = !k.fullscreen
if p, err := xp.QueryPointer(xConn, rootXWin).Reply(); err != nil {
log.Println(err)
@@ -395,7 +405,7 @@
}
k.configure()
k.screen.repaint()
- return false
+ return true
}
func doHide(k *workspace, _ interface{}) bool {
Index: taowm/main.go
===================================================================
--- a/taowm/main.go
+++ b/taowm/main.go
@@ -209,18 +209,22 @@
}
}
if f := w.frame; f != nil {
+ k := f.workspace
replacement := (*window)(nil)
if w.transientFor != nil && w.transientFor.frame == nil {
replacement = w.transientFor
} else {
bestOffscreenSeqNum := uint32(0)
for w1 := w.link[next]; w1 != w; w1 = w1.link[next] {
- if w1.offscreenSeqNum > bestOffscreenSeqNum && w1.frame == nil {
+ if w1.offscreenSeqNum > bestOffscreenSeqNum && (k.fullscreen ||
w1.frame == nil) {
replacement, bestOffscreenSeqNum = w1, w1.offscreenSeqNum
}
}
}
if replacement != nil {
+ if f0 := replacement.frame; f0 != nil {
+ f0.window, replacement.frame = nil, nil
+ }
f.window, replacement.frame = replacement, f
replacement.configure()
if p, err := xp.QueryPointer(xConn, rootXWin).Reply(); err != nil {
@@ -230,6 +234,9 @@
}
} else {
f.window = nil
+ if k.fullscreen && f == k.focusedFrame {
+ doFullscreen(k, nil)
+ }
}
}
w.link[next].link[prev] = w.link[prev]