How do you control the focus in a Window Manager to do Click To Focus?

How do you control the focus in a Window Manager to do Click To Focus?

Post by Kelly Frenc » Sat, 24 Jul 1999 04:00:00



I'm trying to work with a small window manager and customize it's behavior.
 I'm working with lwm as a starting place.  One issue I've been struggling
with is how to keep focus from following the mouse.  The place where it's
being handled now is in the EnterNotify handler and when I make that
handler return, to keep the code from switch the focus of the windows, when
the mouse makes it over the client inside the frame, the input focus still
switches.  Is there some other message that changes the focus?  I tried
adding FocusIn and FocusOut handlers but I must not be registering properly
for those events because my handlers don't get called.

I've been trying to look in the code of fvwm2 but since they made it a
style it hasn't seemed really clear how they get ClickToFocus to work.

Any suggestions?

Kelly French

 
 
 

How do you control the focus in a Window Manager to do Click To Focus?

Post by D J Hawkey » Sat, 24 Jul 1999 04:00:00




> I'm trying to work with a small window manager and customize it's behavior.
>  I'm working with lwm as a starting place.  One issue I've been struggling
> with is how to keep focus from following the mouse.  The place where it's
> being handled now is in the EnterNotify handler and when I make that
> handler return, to keep the code from switch the focus of the windows, when
> the mouse makes it over the client inside the frame, the input focus still
> switches.  Is there some other message that changes the focus?  I tried
> adding FocusIn and FocusOut handlers but I must not be registering properly
> for those events because my handlers don't get called.

> I've been trying to look in the code of fvwm2 but since they made it a
> style it hasn't seemed really clear how they get ClickToFocus to work.

> Any suggestions?

> Kelly French


VTWM has resources to switch on or off this functionality. I believe
it's backward compatable and common to some other TWM-derived WMs.

Dave

--
  ---------------------------------------------------------------------

     CTC Distribution Direct, LLC        http://pluto.ctcdist.com/

       UNIX Systems Administrator        http://www.visi.com/~hawkeyd/
  ---------------------------------------------------------------------

 
 
 

How do you control the focus in a Window Manager to do Click To Focus?

Post by Kelly Frenc » Sat, 24 Jul 1999 04:00:00


Well, I'm really interested in what might be causing the focus to move
without using the EnterNotify event.  I know that that is where other
window managers move the focus and it doesn't seem to be working for me.
Anyone have any ideas?



> I'm trying to work with a small window manager and customize it's
behavior.
>  I'm working with lwm as a starting place.  One issue I've been
struggling
> with is how to keep focus from following the mouse.  The place where it's
> being handled now is in the EnterNotify handler and when I make that
> handler return, to keep the code from switch the focus of the windows,
when
> the mouse makes it over the client inside the frame, the input focus
still
> switches.  Is there some other message that changes the focus?  I tried
> adding FocusIn and FocusOut handlers but I must not be registering
properly
> for those events because my handlers don't get called.

> I've been trying to look in the code of fvwm2 but since they made it a
> style it hasn't seemed really clear how they get ClickToFocus to work.

> Any suggestions?

> Kelly French


 
 
 

How do you control the focus in a Window Manager to do Click To Focus?

Post by Valentin Guille » Wed, 28 Jul 1999 04:00:00


Kelly,

I'm running RH 5.1 which has 3 windowing managers which can be loaded
and configured at install time.  They are FVWM95, Lestif, and
AfterStep.  On this system, MOST of the config information is found in
FVWM95 subdirectory, but many of the individual items which are unique
to each environment are to be found in their own, other subdirectories.  

Now, the options on focus are, cick to focus, and something like
focus-follow-mouse.  This is set on my system in the WM config file
which controls all three environments.  On this system, there is a
primary config file,and then this calls one of the other three
sub-config files, depending upon which you have indicated to go into by
default.  

So, you find the actual config file which contains this in and uncomment
out the one you wish to use, and comment out the other option you don't
want.  If I remember right, on this system it's a file called
fvwm2rc.defstyles  or perhaps  fvwm2rc.defines.   Anyway, it's in one of
these which is in the same folder as these ones are.  

An easy way to find the file is to use   grep -G (text-search-string)
(filename)    all without the parentheses.  This will search the given
filename for a given text string.  Say you want to find files which
contain the word "focus".  You would use grep to search the file for the
word. If it finds it, it spits out the whole line in the file it's
contained on.  Thus, you can find the correct file fairly quickly if you
know the general area to look in.  Then, if you're in X you can use  
gvim  or another editor to go into the file and find the config lines
and either comment or uncomment out the appropriate entry.  You can use
this technique to find all kinds of config parameters, like to set
custom colors, default program geometry setting at startup, and lots
more.  

Best Regards
--
Valentin Guillen

remove capitalized letters to e-mail me
remueve mayusculas para enviarme e-mail