Home | Software Map | Motif Forums | Bug Home sponsored by ICS 
Bugzilla Bug
  1565
     Query page      Enter new bug
Bug#:1565 Platform: Version:
Product: OS: Reporter:ochern@ics.com (Oleksiy Chernyavskyy)
Status: RESOLVED Priority: Cc:
Resolution: WONTFIX Severity: Component:
Assigned To: ochern@ics.com (Oleksiy Chernyavskyy) Target Milestone:
URL:
Summary:
Attachments: 08/02/12 09:23bug reproducer
08/02/12 09:283 reproducers by ochern. xlib based, xt based and motif based
08/02/12 09:31screenshot of the bug and shot of expected behaviour
08/02/12 10:32proposed patch
09/25/12 11:44Enhanced patch based on Oleksiy's one
12/31/12 08:18New patch. Old one doesn't fix completely. New patch explores different approach.
01/01/13 15:55slightly enhanced patch
11/29/13 20:15New patch. Must be applied to motif-2.3.4.
03/27/17 10:41The "fixed" version of currect fix. It is workable
03/27/17 10:44version 2 of my fix. Is has more profound reimplementation of the original fix. But it DOESN'T WORK. I just stopped working on it and put it here as is.
Create a new attachment (proposed patch, testcase, etc.)
Bug 1565 depends on: Show dependency tree
Show dependency graph
Bug 1565 blocks:
Votes for bug 1565:    Vote for this bug

Additional Comments:


Leave as RESOLVED WONTFIX
Reopen bug
Mark bug as VERIFIED
Mark bug as CLOSED

View Bug Activity Format For Printing
Description: Opened: 2012-08-02 09:21

https://bugzilla.redhat.com/show_bug.cgi?id=810435

Description of problem:
 The active window changes to inactive when the drop down list is clicked.
 Our customer strongly demands to fix this issue.

Version-Release number of selected component (if applicable):
 Red Hat Enterprise Linux 6
 openmotif-2.3.3-4.el6
 metacity-2.28.0-20.el6

How reproducible:
 Always.

Steps to Reproduce:
1. Extract attached reproducer.tar.gz, and make in reproducer directory.
2. Run ./sample

Actual results:
 See attached description.png

Expected results:
 See attached description.png


------- Additional Comments From Oleksiy Chernyavskyy 2012-08-02 09:23 -------
Created an attachment (id=334)
bug reproducer


------- Additional Comments From Oleksiy Chernyavskyy 2012-08-02 09:28 -------
Created an attachment (id=335)
3 reproducers by ochern. xlib based, xt based and motif based


------- Additional Comments From Oleksiy Chernyavskyy 2012-08-02 09:31 -------
Created an attachment (id=336)
screenshot of the bug and shot of expected behaviour


------- Additional Comments From Oleksiy Chernyavskyy 2012-08-02 10:32 -------
Created an attachment (id=337)
proposed patch


------- Additional Comments From Oleksiy Chernyavskyy 2012-08-02 10:36 -------
bug is rather old. It is reproduced on ancient Linux systems up to Fedora 2, in
KDE and this bug (bug?) exists in motif 1.2.5.


------- Additional Comments From arahne@arahne.si 2012-08-05 12:05 -------
I can confirm the existance of the bug, actually more of an annoyance.
Still, I would like the fix to be merged in the main source tree, if possible.


------- Additional Comments From Yura Syrota 2012-09-25 11:44 -------
Created an attachment (id=339)
Enhanced patch based on Oleksiy's one


------- Additional Comments From Yura Syrota 2012-09-25 11:52 -------
Fixed with the enhanced fix in HEAD and openmotif_2_3 branches


------- Additional Comments From Oleksiy Chernyavskyy 2012-12-31 08:18 -------
Created an attachment (id=344)
New patch. Old one doesn't fix completely. New patch explores different approach.


------- Additional Comments From Oleksiy Chernyavskyy 2012-12-31 08:18 -------
New patch created.


------- Additional Comments From Oleksiy Chernyavskyy 2013-01-01 15:55 -------
Created an attachment (id=345)
slightly enhanced patch


------- Additional Comments From Roger Grayson 2013-04-17 17:07 -------
The proposed fix for this bug that was released in motif-2.3.4 caused issues 
with cascading menus. Specifically, we saw that right-clicking to invoke a menu, 
then selecting a cascading component resulted in keyboard focus being apparently 
lost. Nothing seemed to have keyboard focus, and there was no way to get focus 
back without restarting the application.

To resolve this issue for our product, we are currently using a patched motif-
2.3.4 that removes the 'fix'. We're in agreement that this issue should 
currently remain open.


------- Additional Comments From graham.inggs@uct.ac.za 2013-11-21 01:32 -------
In Motif 2.3.4 in Debian I also have the problem with fix #1565 breaking
keyboard navigation of menus (see bug #1576).

Building Motif without fix #1565 solves the keyboard navigation of menus, and
using this version, I am unable to reproduce the original bug #1565 (the active
window changes to inactive when the drop down list is clicked) even testing the
reproducers attached to this bug.



------- Additional Comments From Oleksiy Chernyavskyy 2013-11-21 03:26 -------
Please try new patch.
http://bugs.motifzone.net/showattachment.cgi?attach_id=345

This one is free of problems with keyboard navigation. It must be applied on the
2.3.4 version with old patch. It removes old patch and new fix. New fix has
completely different approach.


------- Additional Comments From graham.inggs@uct.ac.za 2013-11-21 06:07 -------
I can try new patch, but I am unsure how to test it.  As I wrote previously, I
am unable to reproduce the original bug, even without fix #1565 applied.


------- Additional Comments From Oleksiy Chernyavskyy 2013-11-21 07:44 -------
> I can try new patch, but I am unsure how to test it.  As I wrote previously, I
> am unable to reproduce the original bug, even without fix #1565 applied.
What WM or DM you use? If it's CDE, than you will not see the bug. You may try
Gnome, KDE or some lightweight WM that uncovers this bug.


------- Additional Comments From graham.inggs@uct.ac.za 2013-11-21 10:05 -------
> What WM or DM you use? If it's CDE, than you will not see the bug.
> You may try Gnome, KDE or some lightweight WM that uncovers this bug.

I don't see the problem with Unity or FluxBox.  I will try others and report
back, thanks.


------- Additional Comments From graham.inggs@uct.ac.za 2013-11-21 11:32 -------
Also no problem with XFCE, but I was able to reproduce the original problem in
GNOME.

I can now confirm that your new patch (id = 345) does not change the active
window to inactive when a drop down list is clicked for the first time (to make
it drop down), and keyboard navigation of menu bars still works.

However, clicking on a drop down list a second time (to make it pop back up) now
changes the window to inactive.  This is different to the behaviour in WMs that
did not exhibit the original bug without fix #1565 applied; there the window
remained active.

Also, a new symbol, XmForceGrabKeyboard@Base, is now being exported by libXm.so.
 Is this necessary?


------- Additional Comments From Oleksiy Chernyavskyy 2013-11-21 12:09 -------
I suppose you tested with the original reproducer. hm, I forgot it absolutely.
It's not much handy for my, I use standard 'periodic' demo. And I didn't see
what you say:
> However, clicking on a drop down list a second time (to make it pop back up) now
> changes the window to inactive.  This is different to the behaviour in WMs that
> did not exhibit the original bug without fix #1565 applied; there the window
remained active.

Uh, I will check. But know what? This bug makes me crazy. This is a low-level
design problem.


------- Additional Comments From Oleksiy Chernyavskyy 2013-11-21 12:14 -------
Concerning XmForceGrabKeyboard export symbol. Here is my 10-month old comment on
this:
/*
   XmForceGrabKeyboard function is defined to be a substitutor of XSetInputFocus
calls
   for popup and pulldown menus that should grab keyboard focus yet main window
at the
   same time should visually stay in focus for window manager. This resolves
focus flip
   issue when popup or pulldown menu is raised. ~ochern
*/


------- Additional Comments From Oleksiy Chernyavskyy 2013-11-22 04:35 -------
Ok now I see that effect. Thank you Graham.
But I could reproduce it only in fluxbox. I have not see it in openbox or xfwm.
And in case of fluxbox I see that main window stay active but DropDownList have
focus lost. The patch needs additional review.


------- Additional Comments From graham.inggs@uct.ac.za 2013-11-26 06:36 -------
Strangely, I did not see that behaviour in FluxBox.

I did some more tests with the first reproducer and the periodic demo.  The
results were the same.

For me, the problem of the window becoming inactive occurs when ComboBox,
OptionMenu and PopupMenu widgets are clicked in LXDE, GNOME, KDE and Openbox.

I could not reproduce this problem in FluxBox, Motif Window Manager (MWM), Unity
or XFCE.

With patch (id = 345) applied, the problem was fixed for all WMs except for
GNOME and XFCE where clicking on a ComboBox for the second time resulted in the
window losing focus.  There was no problem with OptionMenu and PopupMenu widgets.

When I wrote:
> Also, a new symbol, XmForceGrabKeyboard@Base, is now being exported by
> libXm.so.  Is this necessary?

I meant is it really necessary to export the new XmForceGrabKeyboard function in
order for it to be used by other modules and thus change libXm.so's ABI, or is
it possible for it to be a private function only accessible from within libXm.so?


------- Additional Comments From Oleksiy Chernyavskyy 2013-11-26 14:08 -------
I can confirm that I see the same issue with patched and unpatched versions in
XFCE, OpenBox and FluxBox. But in fluxbox patched dropdown behaves somewhat
differently - after closing the DropDownList main window stays in focus BUT
DropDownList widget looses focus, that is wrong. In XFCE with patched version
closing DropDownList makes main window to loose focus, that is also incorrect.

I confirm that with unpatched version there is no focus loose in FluxBox and
XFCE. I see focus loosing in OpenBox and Gnome. I didn't test in LXDE and KDE.

On my side patch works ok in OpenBox and Gnome.

So I see almost the same as you. Working on fixing remaining misbehavior.


------- Additional Comments From Oleksiy Chernyavskyy 2013-11-29 20:15 -------
Created an attachment (id=383)
New patch. Must be applied to motif-2.3.4.


------- Additional Comments From Oleksiy Chernyavskyy 2013-11-29 20:23 -------
Graham, 
Looking forward for your comments about new patch.

Concerning 'XmForceGrabKeyboard' symbol, this function is private and not
intended to be called from applications. It is exported in XmI.h as many other
internal functions so it's symbol is seen in libXm.so library. But I can't bind
it's scope to a file to the symbol since it is called from different widget
classes that are defined in different files.


------- Additional Comments From graham.inggs@uct.ac.za 2013-11-30 05:54 -------
> But in fluxbox patched dropdown behaves somewhat
> differently - after closing the DropDownList main window stays in focus BUT
> DropDownList widget looses focus, that is wrong.
Ah yes, I do see the same with patch id=345 applied.

> Looking forward for your comments about new patch.
I have tested in Unity, MWM, XFCE, XFCE and FluxBox.
All good! :)

> Concerning 'XmForceGrabKeyboard' symbol, this function is private and not
> intended to be called from applications. It is exported in XmI.h as many other
> internal functions so it's symbol is seen in libXm.so library. But I can't
> bind
> it's scope to a file to the symbol since it is called from different widget
> classes that are defined in different files.
Thanks for the explanation.  It is not a problem, I can add it to
debian/libxm4.symbols.


------- Additional Comments From Oleksiy Chernyavskyy 2013-11-30 11:43 -------
Thank you Graham.
BTW what's your interest in Motif? Are you packager and/or developer?


------- Additional Comments From graham.inggs@uct.ac.za 2013-11-30 12:37 -------
> I have tested in Unity, MWM, XFCE, XFCE and FluxBox.
Err, I mean I have tested in Unity MWM, XFCE and FluxBox.
I can test LXDE, GNOME, KDE and Openbox on Monday.

> BTW what's your interest in Motif? Are you packager and/or developer?
Where I work, we use some commercial packages that depend on Motif and I
co-maintain the Motif package [1] in Debian.

[1] http://packages.qa.debian.org/m/motif.html


------- Additional Comments From graham.inggs@uct.ac.za 2013-12-02 05:53 -------
> I can test LXDE, GNOME, KDE and Openbox on Monday.
I have tested these now and found no problems.


------- Additional Comments From Oleksiy Chernyavskyy 2013-12-02 16:56 -------
Thanks a lot.


------- Additional Comments From Alexa 2014-02-02 21:20 -------
*** Bug 260998 has been marked as a duplicate of this bug. ***
Seen live from the domain http://volichat.com/adult-chat-rooms
Marked for reference. Resolved as fixed @bugzilla.


------- Additional Comments From graham.inggs@uct.ac.za 2015-03-17 13:23 -------
Hi Oleksiy

We've had your updated patch for #1565 in Debian testing since December 2013 and
released in Ubuntu 14.04 since April 2014.
I have recently become aware of bug LP: #1354961 [1], originally filed against
GNU DDD [2].  Something seems to be going wrong in function _XmEventDispatcher
around line 622 of Xm.c.
After reverting the updated patch #1565, the problem seems to go away.

[1] https://bugs.launchpad.net/bugs/1354961
[2] http://www.gnu.org/software/ddd/

Regards
Graham


------- Additional Comments From graham.inggs@uct.ac.za 2015-03-23 13:27 -------
Another bug reported in Ubuntu, LP: #1372649, this one against Xdpf [2].
This is a more reliable reproducer; open a PDF document, right-click and choose
full-screen, press Esc twice in quick succession.

[1] https://bugs.launchpad.net/bugs/1372649
[2] http://www.foolabs.com/xpdf/


------- Additional Comments From Oleksiy Chernyavskyy 2017-03-27 10:38 -------
I decided to remove the existing fix. I see different problems that it causes.
Generally I came to decision that 1565 should not be treated as a bug. The
inactivity of the main window when the drop down list or any popup menu is
opened is basically a side effect of Motif design. To "fix" it we must implement
Motif own main event loop (XmMainLoop) and use it instead of XtAppMainLoop. In
this loop we can control all incoming and outgoing event, control focus and
keyboard. It will require spending much effort to implement it.
Yet I have fixed existing 1565 fix. I have tested it in commercial BX, where the
original fix caused segmentation fault in special situations. It really made the
job, though I'm afraid it's not reliable anyway. I spent too much time
investigating to come to a decision that the only reasonable way is to remove
existing 1565 fix at all without trying to change it in some way. It's a
dead-end way.


------- Additional Comments From Oleksiy Chernyavskyy 2017-03-27 10:41 -------
Created an attachment (id=408)
The "fixed" version of currect fix. It is workable


------- Additional Comments From Oleksiy Chernyavskyy 2017-03-27 10:44 -------
Created an attachment (id=409)
version 2 of my fix. Is has more profound reimplementation of the original fix. But it DOESN'T WORK. I just stopped working on it and put it here as is.


------- Additional Comments From Oleksiy Chernyavskyy 2017-03-27 19:08 -------
released bugfix version 2.3.7 with removed 1565 fix.


------- Additional Comments From Andrey ``Bass'' Shcheglov 2017-03-28 14:12 -------
Epic fail.

     Query page      Enter new bug
This is Mr. Samsa: the Open Motif bug system using Bugzilla. For more information about what Bugzilla is and what it can do, see mozilla.org's bug pages.
New | Query | bug # | Reports | New account | Log in