Bug 197168 - problem with wm hints on x86_64
problem with wm hints on x86_64
Product: Fedora
Classification: Fedora
Component: xwrits (Show other bugs)
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Layton
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2006-06-28 20:45 EDT by Jeff Layton
Modified: 2014-06-18 03:35 EDT (History)
2 users (show)

See Also:
Fixed In Version: 2.24-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-07-20 15:34:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
proposed patch (887 bytes, patch)
2006-06-29 11:56 EDT, Jeff Layton
no flags Details | Diff
2.23 patch (341 bytes, patch)
2006-06-29 15:23 EDT, Jeff Layton
no flags Details | Diff
xwrits patch included in 2.24 (1.52 KB, patch)
2006-07-09 21:47 EDT, Eddie Kohler
no flags Details | Diff

  None (edit)
Description Jeff Layton 2006-06-28 20:45:27 EDT
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-28 21:03:05 EDT
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-

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-28 21:30:33 EDT
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 11:56:55 EDT
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 15:23:48 EDT
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-09 21:47:55 EDT
Created attachment 132155 [details]
xwrits patch included in 2.24
Comment 6 Eddie Kohler 2006-07-09 21:50:24 EDT
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 15:34:50 EDT
FC5 and devel packages updated to 2.24. Closing...

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