KWin & VMware annoyance

Malte Starostik malte at kde.org
Wed Aug 7 23:54:30 BST 2002


Hi,

when using VMware there is a noticeable delay between VMware releasing its 
grab and the pointer working normally in KDE.
In case you're not familiar with it, VMware can be configured to either 
manually or automatically grab the pointer and keyboard to for the virtual 
machine, when grabbing automatically, this can be done on either/and/or key 
press, mouse click or just mouse enter. With their tools installed in the 
virtual machine, the grab can be automatically released when moving the mouse 
out of the vm's window. So, normally it should be possible to smoothly move 
the mouse into and out of the vm without any weird behaviour.
Unfortunately this doesn't work with kwin :-( When VMware releases its grab, 
no matter whether because the mouse left its window or on explicit release by 
keyboard, there is a delay until the mouse works "normally" again: while 
anything that has hover effects will continue to work as usual, the pointer 
is "dead" for a few seconds after clicking a button. By dead I mean it will 
stil move but clients don't receive any mouse events.

This only applies during a short time span after getting out of the vm, but 
when working heavily with both the host and guest OS at a time it can get 
rather annoying. Normally, this delay is about 2 seconds, sometimes it takes 
up to and more than 10 seconds though, depending on load and (no proof for 
this yet, how long VMware was running). If it gets really bad, restarting 
kwin can help a little bit.

So I placed an xev window next  to VMware and moved the pointer from VMware's 
into xev's window, once with kwin running, once w/o any WM. The result: in 
both cases xev receives an immediate EnterNotify event as I'd expect and any 
mouse motion gets to xev fine.
When kwin is not running, mouse clicks work as well. But when kwin is there, a 
mouse click will result in this series of events (or non-events rather):


EnterNotify event, serial 27, synthetic NO, window 0x1400001,
    root 0x63, subw 0x0, time 2259714668, (0,143), root:(1052,172),
    mode NotifyNormal, detail NotifyAncestor, same_screen YES,
    focus NO, state 16

KeymapNotify event, serial 27, synthetic NO, window 0x0,
    keys:  99  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···

**********> some MotionNotify events here
Now I clicked the first button, not too sure if the LeaveNotify arrived before 
or after that

LeaveNotify event, serial 27, synthetic NO, window 0x1400001,
    root 0x63, subw 0x0, time 2259715892, (18,137), root:(1070,166),
    mode NotifyGrab, detail NotifyAncestor, same_screen YES,
    focus NO, state 272

**********> 1-2 secs pause here, sometimes it would even take > 10 secs

FocusIn event, serial 27, synthetic NO, window 0x1400001,
    mode NotifyNormal, detail NotifyNonlinear

KeymapNotify event, serial 27, synthetic NO, window 0x0,
    keys:  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   0···

PropertyNotify event, serial 27, synthetic NO, window 0x1400001,
    atom 0x107 (_KDE_NET_USER_TIME), time 2259716947, state PropertyNewValue

EnterNotify event, serial 27, synthetic NO, window 0x1400001,
    root 0x63, subw 0x0, time 2259716947, (18,137), root:(1070,166),
    mode NotifyUngrab, detail NotifyAncestor, same_screen YES,
    focus YES, state 272

KeymapNotify event, serial 27, synthetic NO, window 0x0,
    keys:  68  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···

**********> Now this is the button press above, arriving rather late, see 
timestamps

ButtonPress event, serial 27, synthetic NO, window 0x1400001,
    root 0x63, subw 0x0, time 2259715892, (18,137), root:(1070,166),
    state 0x10, button 1, same_screen YES

ButtonRelease event, serial 27, synthetic NO, window 0x1400001,
    root 0x63, subw 0x0, time 2259716947, (18,137), root:(1070,166),
    state 0x110, button 1, same_screen YES


The Grab / Ungrab notifications only happen when kwin is active and seem to 
relate to kwin's passive button grab. With that grab commented out, things 
get *alot* better (except of course click to focus doesn't work anymore 
then).

But still, with or without the grab enabled in kwin, Enter and Leave 
notifications for xev's kwin Client arrive with the beforementioned delay - 
also easily visible in that with focus follows mouse the window is focused 
long after entering it with the mouse. Focus policy doesn't seem to affect 
the overall behaviour at all though, just some side effects.

Either way, I wonder why xev with no kwin gets all events regularly and in 
time, while even kwin itself will get them heavily delayed. Any clues?

Thanks a bunch,
-Malte
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20020808/3af26564/attachment.sig>


More information about the kde-core-devel mailing list