Bug 197168

Summary: problem with wm hints on x86_64
Product: [Fedora] Fedora Reporter: Jeff Layton <jlayton>
Component: xwritsAssignee: Jeff Layton <jlayton>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: extras-qa, steved
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: 2.24-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-07-20 19:34:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
proposed patch
none
2.23 patch
none
xwrits patch included in 2.24 none

Description Jeff Layton 2006-06-29 00:45:27 UTC
I've noticed that on x86_64, that when the xwrits window pops up, it's not
movable, whereas on i386 it is. The problem seems to be in how WM hints are
handled. When I comment this out of hands.c:

  /* window manager properties, including GNOME/KDE hints */
  XChangeProperty(port->display, nh->w, port->mwm_hints_atom,
                  port->mwm_hints_atom, 32, PropModeReplace,
                  (unsigned char *)mwm_hints, 4);

the problem goes away. mwm_hints gets set via bit shifts of long ints, so the
problem may be with word size differences.

The same problem seems to occur regardless of window manager, so I don't think
it's a wm bug (unless they all have the same bug).

Comment 1 Jeff Layton 2006-06-29 01:03:05 UTC
Ok, I think this may have something to do with it. The 5 arg to that statement
is "format":

       format    Specifies whether the data should be viewed as a list of
                 8-bit, 16-bit, or 32-bit quantities.  Possible values are 8,
                 16, and 32.  This information allows the X server to cor-
                 rectly perform byte-swap operations as necessary.  If the
                 format is 16-bit or 32-bit, you must explicitly cast your
                 data pointer to an (unsigned char *) in the call to XChange-
                 Property.

In the code, however, we're setting these to 64-bit values on x86_64 and 32-bit
on i386. Since both i386 and x86_64 have 4-byte int sizes, however, the best way
to fix this is probably to make it just use regular ints here.

Comment 2 Jeff Layton 2006-06-29 01:30:33 UTC
Actually, I think I'm wrong (and was looking at this wrong). Changing the mwm
bit shifts to use "1" instead of "1L" does't make any difference in the final
contents of the array. So this may be a WM bug after all...


Comment 3 Jeff Layton 2006-06-29 15:56:55 UTC
Created attachment 131754 [details]
proposed patch

The problem seems to be that on 64-bit platforms, window managers seem to
expect that hints come in an array of 64-bit integers. The attached patch seems
to correct this problem on x86_64, but does not break i386 (I've not been able
to test ppc).

I'd like to run this by the author before incorporating it.

Comment 4 Jeff Layton 2006-06-29 19:23:48 UTC
Created attachment 131767 [details]
2.23 patch

There's a new upstream version that made an attempt to fix this, but it doesn't
seem to. This patch, however, seems to fix it. Untested as of yet on i386.

Comment 5 Eddie Kohler 2006-07-10 01:47:55 UTC
Created attachment 132155 [details]
xwrits patch included in 2.24

Comment 6 Eddie Kohler 2006-07-10 01:50:24 UTC
Thanks for the patch Jeff.  I looked over the patch and did some digging to try
to understand the X property issues that were causing problems.  Now I've got
it, I think, and release 2.24 will contain the patch above.


Comment 7 Jeff Layton 2006-07-20 19:34:50 UTC
FC5 and devel packages updated to 2.24. Closing...