[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fvwm
Subject:    Re: FVWM: Problems with ClickToFocus
From:       Dominik Vogt <dominik.vogt () gmx ! de>
Date:       1999-07-27 0:55:23
[Download RAW message or body]

On Mon, Jul 26, 1999 at 11:19:26AM -0400, samuel_chung@yahoo.com wrote:
> 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?

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, dominik.vogt@gmx.de
Reply-To: dominik.vogt@gmx.de
--
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 majordomo@fvwm.org.
To report problems, send mail to fvwm-owner@fvwm.org.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic