Subject: FVWM: Problems with ClickToFocus

From: [email-masked]
Date: Mon, 26 Jul 1999 11:19:26 -0400 (EDT)

Hello everybody,

I have a similar problem as Kelly stated about ClickToFocus too. I am
working on a special WM project and which based from fvwm. I want this
WM only have ClickToFocus active and want to change focus whatever user
click (any combination of keystroke with mouse button click) to any of
window (which include title bar, button, border, application widget,
... etc.).

I have been updated my source based on the archive Mar 24, 1999 which
Dominik Vogt suggest. I have modified the file event.c in the function
HandleButtonPress() and comment out the line to check for modifier key.
But I still can not make to above requirement work.

For example, I have two xterm (let's call them xtermA and xtermB)
running. First, xtermA have the focus. Then, press shift plus first
mouse button click on xtermB (try not on border and title bar). The
xtermB won't get the focus on the action. And then, try just first
mouse button click to xtermB again. This time the xtermB have the
focus. Would anyone explain how the ClickToFocus work in fvwm in
detail? What will be the event flow from X server to a window itself to
make it focus?

Many thanks in advance!!

Samuel
[email-masked]

--- Kelly French <[email-masked]> wrote:
> I apologize for repeating this message but I
> realized that I hadn't
> included my email address and didn't want to force
> anyone to reply to
> the list just to answer one of my questions.
> 
> 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 it is a style it
> hasn't seemed really clear how ClickToFocus works.
> System info; using a PII 333 with 64M and a 3GB
> drive, I've installed
> Red Hat 6.0 full install.
> 
> Any suggestions?
> 
> Kelly French
> [email-masked]
> 
> --
> Visit the official FVWM web page at <URL:
> http://www.fvwm.org/>.
> To unsubscribe from the list, send "unsubscribe
> fvwm" in the body of a
> message to [email-masked].
> To report problems, send mail to
> [email-masked].
> 

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 27 Jul 1999 02:55:23 +0200

On Mon, Jul 26, 1999 at 11:19:26AM -0400, [email-masked] wrote:
> detail?

> What will be the event flow from X server to a window itself to
> make it focus?

None. The window itself doesn't deal with the keyboard focus.
(Usually - it *may* request to receive the FocusIn and FocusOut
events, to do something itself). If the window has the keyboard
focus X sends keyboard events to its application (if requested),
if it doesn't have the focus it doesn't send them.

What are you trying to do in events.c? There is no check for
the pressed modifier key in the relevant part of the code:

-----------------------------------------------------------------------
void HandleButtonPress(void)
{
  int LocalContext;
  char *action;
  Window OldPressedW;

  DBUG("HandleButtonPress","Routine Entered");

  /* click to focus stuff goes here */
  if((Tmp_win)&&(HAS_CLICK_FOCUS(Tmp_win))&&(Tmp_win != Scr.Ungrabbed))
  {
    SetFocus(Tmp_win->w,Tmp_win,1);    <---- !!!
    ...
-----------------------------------------------------------------------

The 'SetFocus' function handles focus switching. This works regardless
of the modifier keys held.

Bye

Dominik ^_^

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].