summaryrefslogtreecommitdiff
path: root/libnotify.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-03-03 22:56:05 -0600
committerJeff Carr <[email protected]>2025-03-03 22:56:05 -0600
commit54bbe72aa8fe60c21e3bca46a5455a2965859c5b (patch)
treea82dc1ceb64f65b1b034f9530863b539003d3ca2 /libnotify.go
parentb373eab346cc96c8c790d9713824a9208e435748 (diff)
SIGWINCH works on background and libnotify widgets
Diffstat (limited to 'libnotify.go')
-rw-r--r--libnotify.go45
1 files changed, 30 insertions, 15 deletions
diff --git a/libnotify.go b/libnotify.go
index 9658ad2..487c429 100644
--- a/libnotify.go
+++ b/libnotify.go
@@ -105,12 +105,15 @@ func libNotifyUpdate() {
// check for SIGWINCH. If so, move the libnotify clock
w, h := me.baseGui.Size()
if me.winchW != w || me.winchH != h {
+ me.winchW = w
+ me.winchH = h
log.Info("handle SIGWINCH!", w, h)
me.notify.clock.tk.MoveToOffset(w-me.notify.clock.offsetW, me.notify.clock.offsetH)
me.notify.clock.tk.Hide()
me.notify.clock.tk.Show()
- me.winchW = w
- me.winchH = h
+
+ sigWinchBG()
+ sigWinchMenu()
}
// update the time
@@ -237,6 +240,30 @@ func hardDrawAtgocuiSize(tk *guiWidget) {
log.Verbose("hardDrawAtgocuiSize() err ok widget", tk.cuiName, a, b, c, d, tk.v.Name())
}
+func sigWinchMenu() {
+ w, _ := me.baseGui.Size()
+ me.notify.menu.tk.MoveToOffset(w-me.notify.menu.offsetW, me.notify.menu.offsetH)
+ me.notify.menu.tk.Hide()
+ me.notify.menu.tk.Show()
+}
+
+func sigWinchBG() {
+ tk := me.BG.tk
+ w, h := me.baseGui.Size()
+ a := -1
+ b := -1
+ c := w + 1
+ d := h + 1
+ var err error
+ tk.v, err = me.baseGui.SetView(tk.cuiName, a, b, c, d, 0)
+ if err == nil {
+ tk.dumpWidget("drawView() err")
+ log.Log(ERROR, "drawView() internal plugin error err = nil")
+ return
+ }
+ log.Info("background resized to", a, b, c, d)
+}
+
// find the "BG" widget and set it to the background on the very very bottom
func setBottomBG() {
if me.BG.tk == nil {
@@ -246,19 +273,7 @@ func setBottomBG() {
tk := me.BG.tk
// log.Info("found BG. setting to bottom", tk.cuiName)
if tk.v == nil {
- w, h := me.baseGui.Size()
- a := -1
- b := -1
- c := w + 1
- d := h + 1
- var err error
- tk.v, err = me.baseGui.SetView(tk.cuiName, a, b, c, d, 0)
- if err == nil {
- tk.dumpWidget("drawView() err")
- log.Log(ERROR, "drawView() internal plugin error err = nil")
- return
- }
- log.Info("background tk View not initialized")
+ sigWinchBG()
return
}
if me.dark {