Bug 392731 - xclock window is too small with certain X resources
xclock window is too small with certain X resources
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: xorg-x11-apps (Show other bugs)
8
i386 Linux
low Severity low
: ---
: ---
Assigned To: Søren Sandmann Pedersen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-11-20 12:09 EST by Jay Berkenbilt
Modified: 2014-06-18 05:09 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-11-26 11:56:31 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
FreeDesktop.org 15903 None None None Never

  None (edit)
Description Jay Berkenbilt 2007-11-20 12:09:03 EST
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 12:09:03 EST
Created attachment 265141 [details]
Fedora 8 xclock image
Comment 2 Jay Berkenbilt 2007-11-20 12:10:06 EST
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 12:13:21 EST
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 07:31:12 EST
Created attachment 265941 [details]
reproduction with Rawhide

Yes, I can reproduce this with Rawhide.
Comment 5 Jay Berkenbilt 2008-05-10 22:28:36 EDT
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-10 22:28:58 EDT
Created attachment 305049 [details]
proper patch
Comment 7 Jay Berkenbilt 2008-05-10 22:29:56 EDT
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-11 22:05:25 EDT
See also https://bugs.freedesktop.org/show_bug.cgi?id=15903
Comment 9 Jay Berkenbilt 2008-05-12 17:21:18 EDT
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 13:39:05 EDT
Should I close this with "UPSTREAM"?
Comment 11 Bug Zapper 2008-11-26 03:37:12 EST
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 11:56:31 EST
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.