release button notify bug?

Olivier Fourdan fourdan at xfce.org
Thu Oct 16 23:20:14 CEST 2003


Hi,

Alt, Ctrl, Shift are called "modifiers", because these keys are usually
used in conjunction with other keys or mouse events (ie, Alt+A, Ctrl+C,
Shift+Mouse click etc.)

The GIMP uses "Alt" as a "regular" key to switch GTK buttons in its
dialog, ie if you press "Alt" alone, the button state changes. Thus,
when you press Alt followed by Tab key, what happen is that 1) the GIMP
gets the Alt keypress (normal behaviour, Alt alone is not a shortcut for
xfwm4), then xfwm4 receives Alt+Tab, ie keypress Tab with modifier key
"Alt" being pressed, which is detected as a shortcut by xfwm4 and the
GIMP won't receive the key event (the event is taken by the WM). That is
normal and that is the correct behaviour. From what I see, the GIMP also
release the button on focus change which makes sense.

To put some more weight in what I'm saying, I did play a bit with xev (a
very usefull tool that shows what events are received by a given app).
What the following events show are a Alt+Tab sequence, the xev window
being focused.

Here we go (I cleanup the log, removing time and pointer coord that are
meaningless in our case):

1) With metacity

KeyPress event, serial 25, synthetic NO, window 0x2000001,
    state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes:  ""

FocusOut event, serial 25, synthetic NO, window 0x2000001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 25, synthetic NO, window 0x2000001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 25, synthetic NO, window 0x0,
    keys:  2   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0

FocusOut event, serial 25, synthetic NO, window 0x2000001,
    mode NotifyNormal, detail NotifyNonlinear

2) In wmaker: 

KeyPress event, serial 22, synthetic NO, window 0x2000001,
    state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes:  ""

FocusOut event, serial 22, synthetic NO, window 0x2000001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 22, synthetic NO, window 0x2000001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 22, synthetic NO, window 0x0,
    keys:  2   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0

FocusOut event, serial 22, synthetic NO, window 0x2000001,
    mode NotifyNormal, detail NotifyNonlinear

3) In xfwm4:

KeyPress event, serial 28, synthetic NO, window 0xa00001,
    state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes:  ""

FocusOut event, serial 28, synthetic NO, window 0xa00001,
    mode NotifyGrab, detail NotifyNonlinear

FocusIn event, serial 28, synthetic NO, window 0xa00001,
    mode NotifyUngrab, detail NotifyNonlinear

KeymapNotify event, serial 28, synthetic NO, window 0x0,
    keys:  2   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0

FocusOut event, serial 28, synthetic NO, window 0xa00001,
    mode NotifyNormal, detail NotifyNonlinear

As you can see, the event sequence is the same in all three cases, and
in no case the key release is received by the app. I see nothing wrong
with xfwm4 here. No bug, no fix.

Cheers,
Olivier.


On Tue, 2003-10-14 at 09:50, Karol Krenski wrote: 
> > Better put a screenshot of what you mean 'cuz I don't see what you are
> > talking about. Also could you describe more precisely your problem?
> Sorry Olivier, here comes the screenshot:
> http://www.inf.sgsp.edu.pl/~mimooh/gimp_xfwm4.png
> When I alt+tab into gimp window button 2 gets temporairly pressed. Then
> next alt+tab should leave gimp window with button 1 pressed -
> WindowMaker does it, but xfwm4 leaves gimp window with button 2
> permanently pressed. Hopes this is more clear.
> 
> mimooh
>  
> > > Seems there's a bug in xfwm4. Working with gimp-1.3.21. I use
> > > alt+tab to switch windows. There's a "move tool" in gimp that has
> > > three modes, three small buttons. Those small buttons get focus for
> > > a while when I alt+tab into gimp window and the bad thing is that
> > > leaving gimp window leaves wrong button pressed. Gimp hackers told
> > > me it's xfwm4's problem with "release button notify". 
> 
> _______________________________________________
> Xfce mailing list
> Xfce at xfce.org
> http://moongroup.com/mailman/listinfo/xfce

-- 
Olivier Fourdan - fourdan at xfce.org
   
   Interoperability is the keyword, uniformity is a dead end. 
   http://www.xfce.org





More information about the Xfce mailing list