Bug 392731 - xclock window is too small with certain X resources
Summary: xclock window is too small with certain X resources
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: xorg-x11-apps
Version: 8
Hardware: i386
OS: Linux
low
low
Target Milestone: ---
Assignee: Søren Sandmann Pedersen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-11-20 17:09 UTC by Jay Berkenbilt
Modified: 2018-04-11 09:07 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-11-26 16:56:31 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Fedora 8 xclock image (2.69 KB, image/png)
2007-11-20 17:09 UTC, Jay Berkenbilt
no flags Details
expected xclock image; taken from a Debian system (2.64 KB, image/png)
2007-11-20 17:10 UTC, Jay Berkenbilt
no flags Details
reproduction with Rawhide (4.84 KB, image/png)
2007-11-21 12:31 UTC, Matěj Cepl
no flags Details
proper patch (2.38 KB, patch)
2008-05-11 02:28 UTC, Jay Berkenbilt
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
FreeDesktop.org 15903 0 None None None Never

Description Jay Berkenbilt 2007-11-20 17:09:03 UTC
Description of problem:

xclock window is too small with certain X resources.

Version-Release number of selected component (if applicable):

xorg-x11-apps-7.3-1.fc8

How reproducible:

always

Steps to Reproduce:
1. xrdb --load <<EOF
XClock*analog:  false
XClock*padding: 3
XClock*font:    fixed
XClock*geometry:        -0-0
EOF

2. xclock
  
Actual results:

xclock is cut off on the bottom and right.  This is to a great enough extent
that the time does not fully display.  See window dump in xclock.png, attached

Expected results:

I would have expected something more like the image xclock2.png, which is
approximately what I would have seen in Fedora 7 and which is basically what I
see on every other version of Linux I've used for the past 15 years.  The
xclock2.png image was captured from my Debian 4.0 system.  (I actually ran
xclock from there displayed on my Fedora 8 desktop, thus ruling out all possible
causes except the clock program itself and any resource files included with it.)

Comment 1 Jay Berkenbilt 2007-11-20 17:09:03 UTC
Created attachment 265141 [details]
Fedora 8 xclock image

Comment 2 Jay Berkenbilt 2007-11-20 17:10:06 UTC
Created attachment 265151 [details]
expected xclock image; taken from a Debian system

Note that I can see this, albeit with slight font differences, if I resize the
xclock window from my Fedora 8 system.

Comment 3 Jay Berkenbilt 2007-11-20 17:13:21 UTC
For what it's worth, the debian and Fedora XClock and XClock-color app-defaults
files are identical.

Yes, some people actually do still run xclock, shocking as that may be.

Comment 4 Matěj Cepl 2007-11-21 12:31:12 UTC
Created attachment 265941 [details]
reproduction with Rawhide

Yes, I can reproduce this with Rawhide.

Comment 5 Jay Berkenbilt 2008-05-11 02:28:36 UTC
I have what I believe is a correct patch.  I can't be 100% certain because I
can't test this with multiple languages, but looking at a diff between a working
version of xclock and the current version, I was able to narrow the arrow down
to a specific line of code.  Looking at the logic, it seems that they just
botched the scope of an else block.  I just added a pair of braces.  I get
correct behavior now with LANG=C, no LANG, and LANG=en_US.UTF-8, so I believe
this is probably correct now, or at least closer than it was.  I hope you will
consider inclusion of this patch.

Inline, I'm including a diff -uw so you can see how small the change is.  I'm
attaching a patch that includes reindenting the changed code.

--- Clock.c.orig	2007-09-14 17:18:56.000000000 -0400
+++ Clock.c	2008-05-10 22:18:46.147733977 -0400
@@ -656,6 +656,7 @@
 		     2 * w->clock.padding;
        }
        else
+       {
 #endif
 #ifndef NO_I18N 
        if (!no_locale) {
@@ -698,6 +699,7 @@
 	       w->clock.font->descent + 2 * w->clock.padding;
        }
     }
+    }
     if (w->core.width == 0)
 	w->core.width = min_width;
     if (w->core.height == 0)

The patch is relative to the xclock directory.

Comment 6 Jay Berkenbilt 2008-05-11 02:28:58 UTC
Created attachment 305049 [details]
proper patch

Comment 7 Jay Berkenbilt 2008-05-11 02:29:56 UTC
For what it's worth, I've also included this patch in debian bug 443227,
http://bugs.debian.org/443227.

Comment 8 Jay Berkenbilt 2008-05-12 02:05:25 UTC
See also https://bugs.freedesktop.org/show_bug.cgi?id=15903

Comment 9 Jay Berkenbilt 2008-05-12 21:21:18 UTC
Turns out this problem was already fixed upstream.  xclock in the x.org git
repository is correct and has the missing set of braces applied as well as
another fix in the same block of code.

Comment 10 Jay Berkenbilt 2008-09-16 17:39:05 UTC
Should I close this with "UPSTREAM"?

Comment 11 Bug Zapper 2008-11-26 08:37:12 UTC
This message is a reminder that Fedora 8 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 8.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '8'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 8's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 8 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 12 Jay Berkenbilt 2008-11-26 16:56:31 UTC
I don't know what the status of this is in Fedora or RedHat, but I know it's been fixed upstream a long time ago, so I'm going to close it.


Note You need to log in before you can comment on or make changes to this bug.