summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoonchild2020-04-02 19:00:07 -0700
committerMoonchild2020-04-02 19:00:07 -0700
commitfecef2b3d89fadc4b6eca90b28b71e4068b56e87 (patch)
tree6168372facccf52fc59ee3ad383ccc0b75a52a43
parent3630611a2fd4c27bfdf48f1582265bd1b1c1f946 (diff)
downloadaur-fecef2b3d89fadc4b6eca90b28b71e4068b56e87.tar.gz
Fix display (or lack thereof) of second hand
-rw-r--r--.SRCINFO5
-rw-r--r--PKGBUILD5
-rw-r--r--fix-second-hand.diff62
3 files changed, 70 insertions, 2 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 5dddbf609837..bf7ec3903636 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,14 +1,17 @@
pkgbase = buici-clock
pkgdesc = A minimalistic clock for X
pkgver = 0.4.9.4
- pkgrel = 2
+ pkgrel = 3
arch = x86_64
arch = i686
license = GPL v2
makedepends = m4
depends = xorg-server-devel
+ depends = xorg-xprop
source = http://http.debian.net/debian/pool/main/b/buici-clock/buici-clock_0.4.9.4.tar.xz
+ source = fix-second-hand.diff
sha256sums = f5138d220568e3ba5afd272c61a63e5a1a0009a6023387d2a0cbf15af9b3649f
+ sha256sums = 78a6a5ec40e30af30ededb6ac11bc08f934596f86cfd0fbe70f50407bafdb3a0
pkgname = buici-clock
diff --git a/PKGBUILD b/PKGBUILD
index ae8ee0104cde..9682981077f8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,6 +1,6 @@
pkgname="buici-clock"
pkgver="0.4.9.4"
-pkgrel=2
+pkgrel=3
pkgdesc="A minimalistic clock for X"
arch=("x86_64" "i686")
license=("GPL v2")
@@ -10,13 +10,16 @@ makedepends=("m4")
source=(
"http://http.debian.net/debian/pool/main/b/buici-clock/buici-clock_0.4.9.4.tar.xz"
+ "fix-second-hand.diff"
)
sha256sums=(
"f5138d220568e3ba5afd272c61a63e5a1a0009a6023387d2a0cbf15af9b3649f"
+ "78a6a5ec40e30af30ededb6ac11bc08f934596f86cfd0fbe70f50407bafdb3a0"
)
build() {
cd "$srcdir/buici"
+ patch -p1 < "$srcdir/fix-second-hand.diff"
./configure --prefix=/usr
# make _version.h
make #-j8
diff --git a/fix-second-hand.diff b/fix-second-hand.diff
new file mode 100644
index 000000000000..948404ee8aee
--- /dev/null
+++ b/fix-second-hand.diff
@@ -0,0 +1,62 @@
+diff -Nurd /home/mc/buici-clock/src/buici/clock.cxx buici/clock.cxx
+--- /home/mc/buici-clock/src/buici/clock.cxx 2012-12-29 10:51:29.000000000 -0800
++++ buici/clock.cxx 2020-04-02 18:53:14.016079223 -0700
+@@ -106,7 +106,7 @@
+ void draw_dial (Display* display, Visual* visual,
+ Pixmap pixmap, int dx, int dy);
+ void draw_hands (Display* display, Visual* visual,
+- Pixmap pixmap, int dx, int dy, int seconds);
++ Pixmap pixmap, int dx, int dy, int seconds, bool draw_second_hand);
+ void draw_dial_shape (Display* display, Pixmap pixmap, int dx, int dy);
+
+ class WTopLevel : public LWindow {
+@@ -538,7 +538,7 @@
+ _gc, 0, 0, width (), height (), 0, 0);
+
+
+- draw_hands (xdisplay (), xvisual (), pixmap, width (), height (), seconds);
++ draw_hands (xdisplay (), xvisual (), pixmap, width (), height (), seconds, m_fSecondHand);
+
+ #if 0
+ // -- Draw hands
+diff -Nurd /home/mc/buici-clock/src/buici/draw.cc buici/draw.cc
+--- /home/mc/buici-clock/src/buici/draw.cc 2012-12-29 10:51:29.000000000 -0800
++++ buici/draw.cc 2020-04-02 18:53:16.162757167 -0700
+@@ -145,7 +145,7 @@
+
+
+ void draw_hands (Display* display, Visual* visual,
+- Pixmap pixmap, int dx, int dy, int seconds)
++ Pixmap pixmap, int dx, int dy, int seconds, bool draw_second_hand)
+ {
+ cairo_surface_t* s = cairo_xlib_surface_create (display, pixmap, visual,
+ dx, dy);
+@@ -198,16 +198,18 @@
+ cairo_path_destroy (path);
+
+ // Second hand
+- cairo_save (cr);
+- cairo_rotate (cr, ((2.0*M_PI)*seconds)/60.0);
+- cairo_set_line_width (cr, WIDTH_THIN);
+- cairo_move_to (cr, 0, (DY/2.0)*0.20);
+- cairo_line_to (cr, 0, -(DY/2.0)*0.64);
+- cairo_set_source_rgb (cr, 1.0, 0, 0);
+- cairo_stroke (cr);
+- cairo_arc (cr, 0, -(DY/2.0)*0.64, DX*0.03, 0, 2*M_PI);
+- cairo_fill (cr);
+- cairo_restore (cr);
++ if (draw_second_hand) {
++ cairo_save (cr);
++ cairo_rotate (cr, ((2.0*M_PI)*seconds)/60.0);
++ cairo_set_line_width (cr, WIDTH_THIN);
++ cairo_move_to (cr, 0, (DY/2.0)*0.20);
++ cairo_line_to (cr, 0, -(DY/2.0)*0.64);
++ cairo_set_source_rgb (cr, 1.0, 0, 0);
++ cairo_stroke (cr);
++ cairo_arc (cr, 0, -(DY/2.0)*0.64, DX*0.03, 0, 2*M_PI);
++ cairo_fill (cr);
++ cairo_restore (cr);
++ }
+ }
+
+ cairo_destroy (cr);