[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
185/197: installer: Avoid flicker in network page.
From: |
Danny Milosavljevic |
Subject: |
185/197: installer: Avoid flicker in network page. |
Date: |
Mon, 3 Jul 2017 20:37:22 -0400 (EDT) |
dannym pushed a commit to branch wip-installer-2
in repository guix.
commit d2a38b645b7b682280fcb653d337c8ccf27c6bd7
Author: John Darrington <address@hidden>
Date: Sun Feb 19 14:19:24 2017 +0100
installer: Avoid flicker in network page.
* gnu/system/installer/network.scm (network-page-init): Cache the flags
of all interfaces, and refresh the menu only if they have changed.
---
gnu/system/installer/network.scm | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/gnu/system/installer/network.scm b/gnu/system/installer/network.scm
index 60ae111..a4ffbff 100644
--- a/gnu/system/installer/network.scm
+++ b/gnu/system/installer/network.scm
@@ -162,8 +162,13 @@
(refresh* (inner (page-wwin page)))
(menu-refresh (page-datum page 'menu)))
+(define (if-flags ifce)
+ (network-interface-flags
+ (socket SOCK_STREAM AF_INET 0)
+ (assq-ref ifce 'name)))
(define (network-page-init p)
+ (define prev-flags (map-in-order if-flags (interfaces)))
(let* ((s (page-surface p))
(pr (make-boxed-window #f
(- (getmaxy s) 4) (- (getmaxx s) 2)
@@ -196,9 +201,7 @@
(format #f "~55a ~a"
(name->description (assq-ref datum 'name))
(if (zero? (logand IFF_RUNNING
- (network-interface-flags
- (socket SOCK_STREAM AF_INET 0)
- (assq-ref datum 'name))))
+ (if-flags datum)))
(gettext "Down")
(gettext "Running")))))))
@@ -208,7 +211,15 @@
;; Raise sigalarm every second to refresh the menu
- (sigaction SIGALRM (lambda (_) (menu-redraw menu)))
+ (sigaction SIGALRM (lambda (_)
+ (let ((flags
+ (map-in-order
+ if-flags
+ (interfaces))))
+
+ (when (not (equal? prev-flags flags))
+ (set! prev-flags flags)
+ (menu-redraw menu)))))
(setitimer ITIMER_REAL 1 0 1 0)
(push-cursor (page-cursor-visibility p))
- 156/197: installer: New page to select language., (continued)
- 156/197: installer: New page to select language., Danny Milosavljevic, 2017/07/03
- 168/197: installer: Fix the startup locale., Danny Milosavljevic, 2017/07/03
- 173/197: installer: Remove whitespace., Danny Milosavljevic, 2017/07/03
- 01/197: gnu: Add graphical installer, Danny Milosavljevic, 2017/07/03
- 174/197: installer: Provide the ability to add new users., Danny Milosavljevic, 2017/07/03
- 178/197: installer: Infer likely entries for user accounts from the gecos field., Danny Milosavljevic, 2017/07/03
- 180/197: installer: Use a different mount-point for each install attempt., Danny Milosavljevic, 2017/07/03
- 183/197: installer: Specify a pid file for wpa_supplicant., Danny Milosavljevic, 2017/07/03
- 181/197: installer: Make the install attempts counter global., Danny Milosavljevic, 2017/07/03
- 186/197: installer: Return to network page after passphrase entry., Danny Milosavljevic, 2017/07/03
- 185/197: installer: Avoid flicker in network page.,
Danny Milosavljevic <=
- 169/197: installer: Add users page., Danny Milosavljevic, 2017/07/03
- 193/197: install: %installation-services: Make mingetty-service autologin to the installer., Danny Milosavljevic, 2017/07/03
- 196/197: installer: Add imports., Danny Milosavljevic, 2017/07/03
- 195/197: installer: Emit (gnu bootloader grub) import., Danny Milosavljevic, 2017/07/03
- 191/197: gurses: form: Handle Ctrl-F and Ctrl-B in forms., Danny Milosavljevic, 2017/07/03