Public bug reported:

[reproduced on Precise]
[any versions of x11-apps have this bug]

"oclock -fg yellow -hour white -minute red -jewel blue -transparent"
makes hour-hand, minute-hand and jewel _red_ (the color only for minute-hand)
although
"oclock -fg yellow -hour white -minute red -jewel blue"
(without "-transparent") works fine.

i.e.
[expected] "oclock -transparent -hour red" paints its hour-hand red.
[actual result] The hour-hand is not red.

[cause] The code simplifies the routine too much when transparent, I guess. 
(though I'm not a programmer.)
If oclock is transparent, it apparently uses shapeGC to specify its 
non-transparent shape.
I guess it should also paint hourGC and minuteGC _over_ the shape.

[patch] (Maybe the last chunk is unnecessary. It seems that oclock works
fine with or without it.)

diff -bpu oclock/Clock.c{.orig,}
--- oclock/Clock.c.orig 2012-08-17 05:30:57.000000000 +0900
+++ oclock/Clock.c      2013-10-26 16:10:18.804424872 +0900
@@ -152,12 +152,6 @@ static void Initialize (Widget greq, Wid

     valuemask = GCForeground;

-    if (w->clock.transparent)
-    {
-       ;
-    }
-    else
-    {
        myXGCV.foreground = w->clock.minute;
        w->clock.minuteGC = XtGetGC(gnew, valuemask, &myXGCV);

@@ -169,7 +163,6 @@ static void Initialize (Widget greq, Wid

        myXGCV.foreground = w->core.background_pixel;
        w->clock.eraseGC = XtGetGC(gnew, valuemask, &myXGCV);
-    }

     /* wait for Realize to add the timeout */
     w->clock.interval_id = 0;
@@ -371,12 +364,10 @@ static void Destroy (Widget gw)
 {
      ClockWidget w = (ClockWidget)gw;
      if (w->clock.interval_id) XtRemoveTimeOut (w->clock.interval_id);
-     if (! w->clock.transparent) {
         XtReleaseGC(gw, w->clock.minuteGC);
         XtReleaseGC(gw, w->clock.hourGC);
         XtReleaseGC(gw, w->clock.jewelGC);
         XtReleaseGC(gw, w->clock.eraseGC);
-     }
      if (w->clock.shapeGC)
        XFreeGC(XtDisplay(gw), w->clock.shapeGC);
     if (w->clock.shape_mask)

@@ -389,11 +380,8 @@ static void Redisplay(Widget gw, XEvent
     ClockWidget        w;

     w = (ClockWidget) gw;
-    if (!w->clock.transparent)
-    {
        paint_jewel (w, XtWindow (w), w->clock.jewelGC);
        paint_hands (w, XtWindow (w), w->clock.minuteGC, w->clock.hourGC);
-    }
 }

 /*
@@ -425,7 +413,6 @@ static void new_time (XtPointer client_d
        Time_t          now;
        struct tm       *tm;

-       if (!w->clock.transparent)
        if (w->clock.polys_valid) {
                paint_hands (w, XtWindow (w), w->clock.eraseGC, 
w->clock.eraseGC);
                check_jewel (w, XtWindow (w), w->clock.jewelGC);
@@ -449,7 +436,6 @@ static void new_time (XtPointer client_d
        compute_hands (w);
        if (w->clock.transparent)
            Resize ((Widget)w);
-       else
            paint_hands (w, XtWindow (w), w->clock.minuteGC, w->clock.hourGC);
 } /* new_time */

** Affects: x11-apps (Ubuntu)
     Importance: Undecided
         Status: New

** Patch added: "redraw hands and jewel over shape"
   
https://bugs.launchpad.net/bugs/1244889/+attachment/3891694/+files/oclock_colors2.diff

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1244889

Title:
  "oclock" ignores colors for hands when transparent

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/x11-apps/+bug/1244889/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to