Project

General

Profile

unexist.dev

Assorted tidbits and projects

Bug #289

grab as 'lambda { nil }' looses window focus

Added by David Herrmann over 12 years ago. Updated over 12 years ago.

Status:
Not a bug
Priority:
Urgent
Category:
Bugfix
Target version:
-
Start date:
04/28/2012
Due date:
% Done:

0%

Estimated time:
0.00 h

Description

Hi

I run subtle-hg and I defined a grab as:
grab 'C-B4', lambda { nil }
grab 'C-B5', lambda { nil }

That is, ctrl+scroll does not zoom in browsers etc. but is simply ignored. This finally works, however, when I invoke ctrl+scrolling then the window looses focus and any mouse input is ignored until I switch to another view and back. Keyboard input still works.

Regards
David

History

#1 Updated by Christoph Kappel over 12 years ago

  • Status changed from Unconfirmed to Not a bug
  • Assignee set to Non member users
  • Priority changed from Immediate to Urgent

Well, I can clearly reproduce the problem, but I don't think that is a problem of subtle at all.

subtle handles the event, leaves the event handler, waits for new events and handles them. Looks like the window adds an active grab on the mouse, that doesn't happen when no client has focus on the root window. When you switch the view you forcefully break the focus of the current window.

In my tests the cursor is the text cursor all the time, subtle never sets this special cursor and other events are processed.

#2 Updated by David Herrmann over 12 years ago

Could you then tell me another way how to disable a specific key combination? I am lost here :-/

#3 Updated by Christoph Kappel over 12 years ago

Uhm why do you want that in the first place? I just don't get it.

#4 Updated by David Herrmann over 12 years ago

ctrl+scroll zooms in chromium/firefox/etc. however, on my intel atom this is horribly slow. I would avoid using it but if I scroll the webpage and then use some ctrl+whatever shortcut to do something else, it zooms the webpage. Since there is no way to disable the shortcut in these applications, I want to catch it earlier on.
The window-manager is the only application I know which can disable shortcuts so I tried it here.

btw. on faster computers this doesn't bother me but on my small Intel Atom processor, zooming a webpage is so horribly slow that I cannot do anything else in the meantime.

#5 Updated by Christoph Kappel over 12 years ago

Uhm I am kind of speechless, so because your netbook is too slow you want to overwrite an app binding form your window manager?

Pro tip: Just don't use C-B4/C-B5 when you are on your netbook. :p

#6 Updated by David Herrmann over 12 years ago

Maybe I wasn't clear enough: If I scroll the webpage the scrolling is still in effect while I want to perform another action with a ctrl+whatever shortcut. I don't use C-B4/5 on purpose. Both actions overlap and this is causing the problems. Yes, I could wait 1 second after scrolling before performing any other action, however, that's definitely a worse solution than binding it to null.

Just enable Coasting for your trackpad (synaptics) if you want to simulate that feature. "CoastingSpeed 5" should be slow enough to demonstrate this problem. On slower machines even normal scrolling looks like Coasting enabled, so that sarcasm is not really appropriate here...

Maybe you haven't used a computer with <1GHz recently but this is a very common problem (ask google if you don't believe it). Zooming is horribly slow. This is why I am not even using the wheel in browsers on my ARM SoCs.

Also, other WMs even recommend using a null-bind for this and it works perfectly well so I was wondering whether there is a way to make subtle behave this way. If there isn't then I probably have to live with switching views. That's at least faster than waiting for the zooming to end.

Thanks
David

#7 Updated by Christoph Kappel over 12 years ago

Now I am confused, so you want to overwrite the binding for zoom, but complain about slow performance of your browsers on machines with less than 1Ghz. I have a machine with less than 1Ghz, but I wouldn't try to use any bloated browser there, especially not chromium and firefox.

I generally think that it is a better way to tell Xorg to avoid the buttons and don't generate any events at all, since your machine is pretty slow. During my checks I saw no fault of subtle, just that the app applied a global grab of the mouse/keyboard. When you switch the view you basically unmap the window and it has to release the grab.

Technically, you cannot overwrite bindings of windows that use keys, because subtle uses a fall-through concept and just receives key presses, when no other window catches them.

Btw: Can you point me to docs of window managers that suggest that?

#8 Updated by David Herrmann over 12 years ago

I've seen the recommendation here:
http://groups.google.com/a/googleproductforums.com/forum/#!topic/chrome/-rtDLZmN9bk

It was about fluxbox (technically, they set the bind to /bin/true but that's about the same).
Then I asked at #gnome and they told me to bind it to /bin/true in gconfd for metacity. It both worked for me.
I don't know whether gnome3 still uses metacity, though. It's some time ago I used it.

It's a quite commonly asked question. See:
https://www.google.com/search?ie=UTF-8&q=disable+ctrl%2Bscroll

In firefox I can set mousewheel.withcontrolkey.action=0 to disable it. However, firefox is much slower than chromium.
I also do not own a faster machine than my Atom N450, only slower ones, so not using chromium or firefox is not an option.

Thanks
David

Also available in: Atom PDF