You are not logged in.

#1 2012-12-26 14:07:54

z7
Member
Registered: 2012-12-26
Posts: 2

[solved] DWM: Focus and mouse pointer?

Hello, I just went from openbox to dwm.

I really enjoy this so far, but there are two things that I don't like.

Lets say I have two views (1 & 2) with this kind of window layout:

 _______________
|       |   B   |
|   A   |_______|
|       |       |
|       |   C   |
|_______|_______|

Steps:

1. I'm in view 1 and my mouse is over A and it's focused
2. I switch to view 2 (MODKEY+2) and move mouse pointer over B
3. I switch back to view 1 (MODKEY+1) - The focus is still on A, even though my mouse pointer is over B

Is this normal? I would like to set it so that focus always follows my mouse pointer,
I would also like it so that when I move focus with MODKEY+j/k it would move my mouse pointer over that window.

Is there an option or a patch to do this?

I'm using dwm-6.0.

Last edited by z7 (2012-12-26 21:37:06)

Offline

#2 2012-12-26 14:38:04

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: [solved] DWM: Focus and mouse pointer?

z7 wrote:

I would like to set it so that focus always follows my mouse pointer,
I would also like it so that when I move focus with MODKEY+j/k it would move my mouse pointer over that window.

Is there an option or a patch to do this?

I'm using dwm-6.0.

There's one here, but it might require some modifications as it's made for 5.9:
http://dwm.suckless.org/patches/warp

I don't know about the other, sorry.


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#3 2012-12-26 15:21:48

illusionist
Member
From: localhost
Registered: 2012-04-03
Posts: 498

Re: [solved] DWM: Focus and mouse pointer?

By default focus always follows mouse in dwm unless you disable it manually.


  Never argue with stupid people,They will drag you down to their level and then beat you with experience.--Mark Twain
@github

Offline

#4 2012-12-26 15:28:11

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,554
Website

Re: [solved] DWM: Focus and mouse pointer?

I have not looked at that 5.9 patch, but it should apply just fine as there should not be any changes to the relevant code.

Otherwise, all that's needed is a single line of code added to the focus window function to call XWarpPointer.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2012-12-26 21:36:25

z7
Member
Registered: 2012-12-26
Posts: 2

Re: [solved] DWM: Focus and mouse pointer?

Unia wrote:

There's one here, but it might require some modifications as it's made for 5.9:


I don't know about the other, sorry.

Thanks! This "wrap" patch actually showed me that my first problem wasn't really a problem for me. big_smile
Now the pointer moves always over the last focused window when I switch back to a view.

And yes it applied fine to dwm 6.0.

edit. But it kind of ruins switching views from statusbar with mouse, since the pointer always hops to the center of focused window. But I think I can live with it.

Last edited by z7 (2012-12-26 21:41:42)

Offline

Board footer

Powered by FluxBB