Bug 442769

Summary: Double-Click does not work with Metacity Window Manager and Motif with certain WM preference settings
Product: Red Hat Enterprise Linux 5 Reporter: ritz <rkhadgar>
Component: metacityAssignee: Søren Sandmann Pedersen <sandmann>
Status: CLOSED ERRATA QA Contact: desktop-bugs <desktop-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.1CC: kem, tao
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-20 21:17:42 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
patch none

Description ritz 2008-04-16 17:44:09 UTC
Description of problem:
Double-Click mouse clicks do not work in Motif-based applications under
GNOME/Metacity when the "Select Windows when the mouse moves over them"
preference is enabled.  The bug is reproducible with a simple
Xt/Motif program available at the link below.

Version-Release number of selected component (if applicable):
metacity-2.16.0-10.el5

How reproducible:
always

Steps to Reproduce:
1. Launch test program
2. Single Click on displayed button and observer terminal output
3. Double Click on displayed button and observe that terminal still displays
   the words "Single click"
4. Perform same tests after disabling "Select Windows when the mouse moves over
them"
and observe the double-clicking on the button produces the words "Double click"
in the terminal window.

Additional info:
Test program is available at

http://www.ecs.csun.edu/~renzo/cs585/Heller.book/Volume6/ch11/multi_click.c

Compile as:
 gcc -o mc -c multi_click.c -lXm -lXt -lX11 -L/usr/X11R6/lib

Everything works perfectly when running with click to focus.

From Soren --
Some preliminary results:
- This bug is caused by spurious crossing events that causes Xt to think
  that the pointer left the button between the two clicks.

- My guess is that this is related to metacity having a passive grab on
  the window in focus follows mouse mode.

This is a pick-your-poison situation.

Metacity can either have an XGrabButton on the window, or not. If it does, then
crossing events will be generated, and we will see this bug, which is
essentially gnome bug 102209 [1]. If it doesn't, then it has no way of
intercepting clicks on the window which means that it can't focus or raise the
window in response to clicks. 

The reason it works in click-to-focus is that in that case metacity drops the
XGrabButton when the window is focused. We could do the same in sloppy mode, but
then a user could alt-tab focus some other window and then have no way to focus
the window again, except mousing out and back in. See gnome bug 115072 [2].

I believe any window manager will have the same problem, and that the only real
fix is to add an extension to X that would allow XGrabButton without clicks
causing crossing events.

References:

[1] http://bugzilla.gnome.org/show_bug.cgi?id=115072
[2] http://bugzilla.gnome.org/show_bug.cgi?id=102209

---------------

+++ This bug was initially created as a clone of Bug #184143 +++

Comment 1 ritz 2008-04-16 17:44:09 UTC
Created attachment 302646 [details]
patch

Comment 2 RHEL Program Management 2008-06-02 20:05:48 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 4 Søren Sandmann Pedersen 2008-09-06 06:46:52 UTC
2.16.12EL should fix it

Comment 8 errata-xmlrpc 2009-01-20 21:17:42 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-0130.html