After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 134003 - cannot change layer whilst focusing icon
cannot change layer whilst focusing icon
Status: RESOLVED FIXED
Product: atk
Classification: Platform
Component: gail
unspecified
Other All
: Urgent critical
: ---
Assigned To: padraig.obriain
padraig.obriain
AP1
: 139390 140942 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-02-10 16:55 UTC by david.hawthorne
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
a "human readable" output from gnopernicus (1.08 KB, text/plain)
2004-03-02 14:56 UTC, remus draica
  Details
a modified file from gnopernicus (10.60 KB, text/x-csrc)
2004-04-06 13:09 UTC, remus draica
  Details
a new tester (4.89 KB, text/x-csrc)
2004-04-06 13:14 UTC, remus draica
  Details
a standalone tester (4.20 KB, patch)
2004-04-08 09:29 UTC, remus draica
none Details | Review
output required by Padraig (32.66 KB, text/plain)
2004-04-08 09:54 UTC, remus draica
  Details
output created by tester proposed at comment #17 (2.46 KB, patch)
2004-04-20 14:07 UTC, remus draica
none Details | Review
Proposed patch (1.22 KB, patch)
2004-04-21 07:52 UTC, padraig.obriain
none Details | Review

Description david.hawthorne 2004-02-10 16:55:02 UTC
using gnopernicus from 9th Feb 2004.

-launch gnopernicus
-launch nautilus
-focus a file in 'icon view'
-attempt to change layer, e.g. to layer 5, "np-0, np5"

.gnopernicus does not switch layer, instead outputs the currently focused
icon. Focusing the 'open with..' button in the left side-panel(whilst in
information view) and retrying does change layer.
Comment 1 Dana Ormenisan 2004-02-19 14:30:20 UTC
If I focus a file in 'icon view' in nautilus and the NumLock key is
on, every time when I press a numpad key a focus event for the focused
file will be emitted. So, to change the layer, e.g. to layer 5, I
press 0 from numpad (and a focus event occurs) followed by 5 from
numpad (and an other focus event occurs). 
I ran gnopernicus with GNOPERNICUS_LOG set to at-spi and the following
output was emitted when 'bin' folder is focused (in nautilus, 'icon
view') and I try to switch to layer 5:

AT:80e2610p----"focus:" for 80e06c0p "bin" role "icon" from "GAIL"
with details 0 and 0
AT:80e6c30p----"object:selection-changed" for 80e38c8p "Icon View"
role "layered pane" from "GAIL" with details 0 and 0
AT:bfffdf10p--key event:sym 65363 (S)	mods 10	code 102	time 1542551
keystring "Right"	type 2 (press = 1, release = 2)
<SRSOUT priority="0" preempt="true"><TEXT voice="name">bin
Folder</TEXT><TEXT voice="role">Icon</TEXT></SRSOUT>
AT:bfffe6b0p--key event:sym 65456 (°)	mods 10	code 90	time 1542913
keystring "0"	type 1 (press = 1, release = 2)
AT:bfffe6b0p--key event:sym 65456 (°)	mods 10	code 90	time 1543002
keystring "0"	type 2 (press = 1, release = 2)
AT:80e5f90p----"focus:" for 80e06c0p "bin" role "icon" from "GAIL"
with details 0 and 0
<SRSOUT priority="0" preempt="true"><TEXT voice="name">bin
Folder</TEXT><TEXT voice="role">Icon</TEXT></SRSOUT>
AT:bfffe6b0p--key event:sym 65461 (µ)	mods 10	code 84	time 1543252
keystring "5"	type 1 (press = 1, release = 2)
<SRSOUT priority="0" preempt="true"><TEXT voice="system">layer
5</TEXT></SRSOUT>
AT:bfffe6b0p--key event:sym 65461 (µ)	mods 10	code 84	time 1543311
keystring "5"	type 2 (press = 1, release = 2)
AT:80e1418p----"focus:" for 80e06c0p "bin" role "icon" from "GAIL"
with details 0 and 0
<SRSOUT priority="0" preempt="true"><TEXT voice="name">bin
Folder</TEXT><TEXT voice="role">Icon</TEXT></SRSOUT>
Comment 2 padraig.obriain 2004-02-19 16:13:03 UTC
I will have a look at this.
Comment 3 padraig.obriain 2004-02-19 16:37:01 UTC
I am not seeing this behavior on Solaris; see below.

AT:137988p----"focus:" for 1280f0p "4256368" role "icon" from "GAIL"
with details 0 and 0
AT:137730p----"object:selection-changed" for 128d00p "Icon View" role
"layered pane" from "GAIL" with details 0 and 0
AT:ffbfd940p--key event:sym 65363 (S)   mods 20 code 83 time
-828788972 keystring "Right"       type 2 (press = 1, release = 2)
<SRSOUT priority="0" preempt="true"><TEXT voice="name">4256368
Folder</TEXT><TEXT voice="role">Icon</TEXT></SRSOUT>

AT:ffbfd940p--key event:sym 65438 ()    mods 20 code 102        time
-828781076keystring ""     type 1 (press = 1, release = 2)
AT:ffbfd940p--key event:sym 65438 ()    mods 20 code 102        time
-828780996keystring ""     type 2 (press = 1, release = 2)
AT:ffbfd940p--key event:sym 65500 (\334)   mods 20 code 97 time
-828780324 keystring ""    type 1 (press = 1, release = 2)
<SRSOUT priority="0" preempt="true"><TEXT voice="system">layer
5</TEXT></SRSOUT>

AT:ffbfd940p--key event:sym 65500 (\334)   mods 20 code 97 time
-828780260 keystring ""    type 2 (press = 1, release = 2)
Comment 4 padraig.obriain 2004-02-20 08:52:02 UTC
We may need some help from Bill on this.
Comment 5 remus draica 2004-02-25 13:13:56 UTC
For me seems that this bug is a duplicate of bug 108664.
Comment 6 bill.haneman 2004-02-25 17:34:25 UTC
I do not think this is a dup of 108664.
Comment 7 remus draica 2004-03-02 14:56:57 UTC
Created attachment 25046 [details]
a "human readable" output from gnopernicus
Comment 8 remus draica 2004-03-02 14:58:36 UTC
I still believe that this is a duplicate of 108664.

The patch above shows that unwanted events are received by gnopernicus.
Comment 9 bill.haneman 2004-03-02 17:25:21 UTC
The question is, why does this happen only while icons are focussed? 
That doesn't make sense, because it's not clear how the icon being
focussed affects the rest of the event history (as received by at-spi
internals).
Comment 10 padraig.obriain 2004-03-09 09:50:59 UTC
I am not seeing the behavior reported by Remus on my Solaris box.

Remus,

Does increasing the value of 200 in line 951 of
at-spi/regostryd/registry.c change the behavior?
Comment 11 remus draica 2004-03-26 12:21:16 UTC
I increased the value to 900 then to 2000. By doing that, no events for window 
are received by gnopernicus, but a new focus event for current object is 
again received.
Comment 12 remus draica 2004-04-06 13:09:29 UTC
Created attachment 26402 [details]
a modified file from gnopernicus


This file (from gnopernicus/kbd_mouse/libke) contains only the interested part
in this bug. The time to process an event is very short, the tester will show
the event and will return.
Comment 13 remus draica 2004-04-06 13:14:14 UTC
Created attachment 26403 [details]
a new tester


This is same as previous, except that it registers only one key combination.
Comment 14 remus draica 2004-04-06 13:18:43 UTC
The file should be copied in gnopernicus/kbd_mouse/libke, then gnopernicus
should be recompiled. To see the unwanted focus event the following commnad must
be run before:

export GNOPERNICUS_LOG=at-spi

Comment 15 padraig.obriain 2004-04-06 13:33:29 UTC
Remus,

Please change line 28 of at-spi/registyy/registy.c to #define SPI_QUEUE_DEBUG
and rebuild. Then run at-spi-registryd in an xterm using the command below and
reproduce the problem. I am hoping that the output from at-spi-registyd will
allow me to understand why the focus events are happening.

kill <pid>; `which at-spi-registryd`
--oaf-activate-iid=OAFIID:Accessibility_Registry:1.0 --oaf-ior-fd=33
Comment 16 bill.haneman 2004-04-06 14:30:11 UTC
Remus: do you see the same behavior with a standalone test program (for
instance, a modified version of key-listener-test) which listens for the same
key combination as your most recent patch aboves?  That would greatly simplify
debugging if we need to get nautilus involved too.
Comment 17 remus draica 2004-04-08 09:29:54 UTC
Created attachment 26461 [details] [review]
a standalone tester

The source file is a modified file from at-spi/test directory.

It register a listener for one key from numpad (key "0") and another listener
for focus and all window events.
Comment 18 remus draica 2004-04-08 09:54:28 UTC
Created attachment 26463 [details]
output required by Padraig
Comment 19 bill.haneman 2004-04-08 10:16:58 UTC
thanks Remus for the standalone tester and the outpu, this should help a lot.
Comment 20 padraig.obriain 2004-04-08 14:33:26 UTC
I an running the test program in one terminal and at-spi-registryd in another
terminal I have nautilus running with an icon in the icon view selected.

I assume I now press 0 on the numeric keypad with NumLock on.
What output do you see from the test program?
Comment 21 remus draica 2004-04-19 08:39:55 UTC
*** Bug 138391 has been marked as a duplicate of this bug. ***
Comment 22 remus draica 2004-04-19 11:53:57 UTC
*** Bug 139390 has been marked as a duplicate of this bug. ***
Comment 23 remus draica 2004-04-20 14:07:49 UTC
Created attachment 26864 [details] [review]
output created by tester proposed at comment #17
Comment 24 padraig.obriain 2004-04-20 15:23:33 UTC
I am reproducing this on Solaris using page tab (Untitled 1) in gedit.

It looks like the problem occurs only when an object which does not correspond
to a GtkWidget has focus, e.g. Notebook page icon or icon. It does not seem to
happen when an object corresponding to a widget has focus, e.g. down arrow
toggle button in gedit.

I do not see any difference in output from at-spi-registryd when focus is on
page tab and toggle button. I need to investigate some more.
Comment 25 padraig.obriain 2004-04-20 16:24:59 UTC
The focus event is discarded when the focus object corresponds to a GtkWidget
and not otherwise. I need to see why.

I am transferring to at-spi as that is the correct place for the bug now.
Comment 26 padraig.obriain 2004-04-21 07:48:14 UTC
I think I understand what is happening.

In registry.c the focus_object is set when a state-change:focused event is
discarded after a window:deactivate event is received because a window:activate
event has been received for the same window within the timeout period.
The focus object is used to suppress a focus event for that object. It is
released when a window:deactivate event is received.

When we have the problem the object in the state-change:focused event is the
Notebook not the NotebookPage which we report as having focus. Also the Notebook
is reported as having state ATK_STATE_FOCUS set when we report the NotebookPage
as having focus.

I assume that both of these are incorrect.
Comment 27 padraig.obriain 2004-04-21 07:52:53 UTC
Created attachment 26899 [details] [review]
Proposed patch

Remus,

Can you check that the proposed patch works for you.
Comment 28 bill.haneman 2004-04-21 10:43:29 UTC
Padraig: if the patch is applied, does the focus-event source (in this case, the
GtkNotebook page) have state FOCUSSED?  I think we're agreed that focus: event
sources always should; otherwise the patch seems right to me.
Comment 29 padraig.obriain 2004-04-21 10:58:01 UTC
The GtkNotenbook page does have state focused; that was fixed in bug #127400. It
is nothing to do with this patch.
Comment 30 bill.haneman 2004-04-21 11:31:50 UTC
Thanks Padraig for confirming, I had forgotten the patch for 127400.  I take it
that this patch fixes the reproducible test case we were looking at, which is
great news; it's nice to have an explanation of why the focus: rejection logic
was failing.
Comment 31 remus draica 2004-04-21 13:22:45 UTC
The bug is still present.
When I tried to change the layer, everything was OK, but When I tried another
command (layer 0 key 9) gnopernicus worked in same way (unwnated event were
received).

Also the bug seems to be present when a key from numpad is pressed and held for
a while. Also I observed the bug in same conditions when I run gnopernicus and
the tester (#17) in same time.  

I checked with "Enable repeat keys" on and off, but still same results.
Comment 32 padraig.obriain 2004-04-21 14:26:22 UTC
<SRSOUT priority="0" preempt="true"><TEXT voice="name">136625_files
Folder</TEXT><TEXT voice="role">Icon</TEXT></SRSOUT>
<SRSOUT priority="0" preempt="true"><TEXT voice="system">layer 9</TEXT></SRSOUT>
<SRSOUT priority="0" preempt="true"><TEXT voice="system">layer 5</TEXT></SRSOUT>

When I tried gnopernicus from CVS HEAD with an icon focused in nautilus I got
the output above which looks correct.

How can I reproduce the problem?
Comment 33 bill.haneman 2004-04-21 15:49:01 UTC
Remus: do your event logs look the same in the new test case?  And can it be
reproduced with the standalone test program?  If not, then either this bug is
fixed and a new bug needs to be opened, or the test program is invalid/incomplete.
Comment 34 padraig.obriain 2004-04-23 12:13:23 UTC
I have committed this patch to CVS HEAD and am marking this bug as fixed.

Please open a new bug if there are issues still unresolved.
Comment 35 Dana Ormenisan 2004-04-26 07:29:24 UTC
*** Bug 140942 has been marked as a duplicate of this bug. ***