Bug 123027

Summary: popup menus fail on Tarantella/VNC
Product: Red Hat Enterprise Linux 3 Reporter: Alastair McKinstry <mckinstry>
Component: openmotifAssignee: Thomas Woerner <twoerner>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 3.0CC: alastair.mckinstry, robinson, shillman, tao, van.okamura
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-06-08 16:05:29 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:
Bug Depends On:    
Bug Blocks: 116727    
Attachments:
Description Flags
Patch to MenuDiff.c none

Description Alastair McKinstry 2004-05-11 14:36:10 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.7 (X11; Linux i686; U;) Gecko/20030131

Description of problem:
In certain circumstances, popup menus fail when used on
Tarantella and VNC displays. This is seen in Oracle apps
(Oracle bug 3252085).

The problem occurs within _XmGrabPointer(), in motif/lib/Xm/MenuUtil.c
The code calls XGrabPointer() in a retry loop. This fails as
the time is before the Grab time on VNC and Tarantella. Unfortunately
it calls with the same parameters the next 5 times, so it always fails.

_XmGrabPointer() is called within several layers of motif code from
our TK layer, when posting the Motif Popup menu. It failing causes
_XmMenuGrabKeyboardAndPointer() to fail, leading to focus being
redirected away from the popup menu, and hence the wrong widgets get
the events destined for the popup. 

The fix is to detect when XGrabPointer() fails, and change time to
CurrentTime (== 0). This appears to have no implications to other code.

Analysis of the calls at the VNC server end shows that this is is what
the HP Motif code does: its first call at this point uses the value of
time passed from above, and fails, its second uses CurrentTime, which
succeeds. 

This fix has been tested in VNC and Tarantella. 


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


How reproducible:
Always

Steps to Reproduce:
1. Popup menu on a custom widget in Motif (not menu popup)
2. DISPLAY on a VNC or tarantella display
3. trace _XmMenuGrabKeyboardAndPointer(). It fails due to
InvalidGrabTime; 

Actual Results:  =effects depend on test: typically focus is no
longer on popup menu as required    

Expected Results:  It succeeds as on standard X display

Additional info:

Works with HP Motif code; patch applied works on VNC and Tarantella.

Comment 1 Alastair McKinstry 2004-05-11 14:38:48 UTC
Created attachment 100149 [details]
Patch to MenuDiff.c

Patch reproduces fixed effects seen on HP: Ran the Oracle code with the problem

on HP (ie using HP Motif libraries) and monitored calls to a debug VNC server.
Saw the HP version try	XGrabPointer() with the time passed in from the popup
event, fail, and then retry XGrabPointer with time = 0 (== CurrentTime), and
the program succeeded.

Comment 2 Alastair McKinstry 2004-05-11 14:56:39 UTC
Please Add me to CC list:
Alastair.McKinstry (This is an Oracle bug, not a Debian one).


Comment 3 Than Ngo 2004-05-11 16:55:18 UTC
you have selected the wrong component. I assigned it to correct
component openmotif

Comment 4 Suzanne Hillman 2004-05-12 21:30:10 UTC
Alastair - you need to have an account for that address in order to
add it. You appear not to.

Comment 15 Jay Turner 2004-09-02 02:21:38 UTC
An errata 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 the 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-2004-243.html