Subject: FVWM: Focus via FvwmIconMan; resizing windows at placement?

From: "Eddy J. Gurney" <[email-masked]>
Date: Mon, 20 Jan 1997 11:01:45 -0500

I have two questions:

Is it possible to set up FvwmIconMan so that while the mouse is in the
FvwmIconMan list, whatever window the cursor is "on" in the list has focus?
This makes it easy to change focus (especially with click to focus)
without clicking on windows all over the display. You can simply nudge
the mouse up or down a few pixels and focus on whatever window you have
the mouse pointing at. Obviously this might not work well for some
people who constantly bump the mouse, but 'twm' supports something like
this, and it is quite useful.

Second, I still cannot figure out how to resize a window when in
ActivePlacement mode when I have the 3x3 grid. In every other window
manager I know of, clicking-and-dragging allows you to resize the window,
and releasing the button actually places it. I can't get this to work in
fvwm2, .43 or .44. Is is because I'm overriding some functionality with
my function definitions, or is this not possible in fvwm2?

Eddy
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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: Allen Brady Montz <[email-masked]>
Date: 20 Jan 1997 13:06:16 -0700

> my function definitions, or is this not possible in fvwm2?

Quite possible. Just make a binding like:

*FvwmIconMan*action	Select	sendcommand select select Focus

In FvwmIconMan lingo, select means to move the mouse into a button. This has
FvwmIconMan send the command "Focus" to the currently selected window. The
syntax is horrible I admit, but I haven't had the energy to come up with
something better. 

Slight problem is that with fvwm, if you Focus a window, it will raise it as
well. I used to release a patch which made Focus just focus, but it's a bit
out of date now. If you want to do it youself, just comment out the lines:

  RaiseWindow(t);
  KeepOnTop();

  /* If the window is still not visible, make it visible! */
  if(((t->frame_x + t->frame_height)< 0)||(t->frame_y + t->frame_width < 0)||
     (t->frame_x >Scr.MyDisplayWidth)||(t->frame_y>Scr.MyDisplayHeight))
  {
    SetupFrame(t,0,0,t->frame_width, t->frame_height,False);
    if(!(t->flags & ClickToFocus))
      XWarpPointer(dpy, None, Scr.Root, 0, 0, 0, 0, 2,2);
  }
  UngrabEm();

at the end of the function FocusOn in builtins.c.

-- 
 Brady Montz
 [email-masked]

---

From: "Eddy J. Gurney" <[email-masked]>
Date: Mon, 20 Jan 1997 17:53:23 -0500

> *FvwmIconMan*action	Select	sendcommand select select Focus

Cool. I just got it set up and I like it! :-) There is only one problem:
FvwmIconMan goes nuts if 'unclutter' is running. In case you don't know,
unclutter is a cool little utility that hides the mouse pointer after so
many seconds of no mouse movement. Basically, after the unclutter timeout
expires (and the mouse is in FvwmIconMan, so it was responsible for maintaing
the focus on the window the mouse was pointing at) the focus rapidly comes
and goes from the window, until you move the mouse and make the cursor
appear again. If the unclutter timer expires when the mouse is not in
FvwmIconMan, it works fine. It is only when I use the mouse in FvwmIconMan
to select focus that I have a problem... any ideas?

> well.

Hmm. It would be nice if this were a user-settable option, like "RaiseOnFocus".

Regards,
Eddy

---

From: Allen Brady Montz <[email-masked]>
Date: 20 Jan 1997 17:29:14 -0700

> to select focus that I have a problem... any ideas?

Very odd. unclutter must be doing something which is generating some sort of X
event like MotionNotify or EnterNotify. 

I just use sloppy focus, and I move the cursor to the root window if it's in
my way.

> 
> > Slight problem is that with fvwm, if you Focus a window, it will raise it
> > as well.
> 

Well, it sort of is. Originally, Focus warped the cursor to the window, as
well as raising it. I then proposed a WarpToWindow function which would warp
the cursor to a given window, and making Focus just focus, and nothing else.
Cause then with WarpToWindow, RaiseWindow, and the new trim Focus, you could 
make a fvwm function which would emulate the old Focus behavior if you really
liked it. The WarpToWindow function was added, and Focus stopped warping the
cursor, but it still raised the window. That was 2.0.43 I think. 

Something to think about after 2.0 gets oficially released.

---

From: Joey Hess <[email-masked]>
Date: Mon, 20 Jan 1997 22:03:14 -0500 (EST)

> event like MotionNotify or EnterNotify. 

Unclutter works by creating a small (1x1, I think) window that's of the
same color as the pixel behind it, and making the mouse cursor enter that
window and beocme tranparent or something. So maybe FvwmIconMan is
noticing that the mouse is effectivly leaving its window when unclutter
activates?

The original poster may want to try the -grab option to unclutter and see
if that works better. 

-- Joey, not an X programmer, so just guessing..

---

From: [email-masked] (Albrecht Kadlec)
Date: Tue, 21 Jan 97 14:13:37 +0100

>>>>> Allen Brady Montz writes:

> my function definitions, or is this not possible in fvwm2?

A> Quite possible. Just make a binding like:

A> *FvwmIconMan*action	Select	sendcommand select select Focus

A> In FvwmIconMan lingo, select means to move the mouse into a button. This has
A> FvwmIconMan send the command "Focus" to the currently selected window. The
A> syntax is horrible I admit, but I haven't had the energy to come up with
A> something better. 

A> Slight problem is that with fvwm, if you Focus a window, it will raise it as
A> well. I used to release a patch which made Focus just focus, but it's a bit
A> out of date now. If you want to do it youself, just comment out the lines:

A>   RaiseWindow(t);
A>   KeepOnTop();

A>   /* If the window is still not visible, make it visible! */
A>   if(((t->frame_x + t->frame_height)< 0)||(t->frame_y + t->frame_width < 0)||
A>      (t->frame_x >Scr.MyDisplayWidth)||(t->frame_y>Scr.MyDisplayHeight))
A>   {
A>     SetupFrame(t,0,0,t->frame_width, t->frame_height,False);
A>     if(!(t->flags & ClickToFocus))
A>       XWarpPointer(dpy, None, Scr.Root, 0, 0, 0, 0, 2,2);
A>   }
A>   UngrabEm();

A> at the end of the function FocusOn in builtins.c.

I thought focus doesn't raise the window?
hmm....

well it does (from the source).

maybe we should change that?

we already ripped the mouse-warping from the focus function, why not the
raise, too?

you can always call a user-defined fvwmFunction, which does focus & raise
the window.

Chuck, what do you think?

BTW: the raise_it function - now obsolete - is still defined  in
builtins.c & function.c

albrecht
-- 
Overhead the albatross hangs	    |  And everything is green and submarine
Motionless upon the air		    |  And no one showed us to the land
And deep beneath the rolling waves  |  And no one knows the wheres or whys

In labyrinths of coral caves	    |  But something stares
The echo of a distant tide	    |  And something tries
Comes willowing across the sand     |  And starts to climb towards the light
							-- Pink Floyd, "Echoes"
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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: [email-masked] (Albrecht Kadlec)
Date: Tue, 21 Jan 97 14:18:53 +0100

> Slight problem is that with fvwm, if you Focus a window, it will raise it as

E> Hmm. It would be nice if this were a user-settable option, like "RaiseOnFocus".
                                                                   ^^^^^^^^^^^^^^

NOOOO please don't do that !!!
rip raise from focus & let the user choose, if he uses MyFocus (does
focus/raise) or Focus !!

albrecht
-- 
We place our faith in human rights
In the paper wars that tie the redtape tight
I know that I would rather be out of this conspiracy	-- Marillion
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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: [email-masked] (Albrecht Kadlec)
Date: Tue, 21 Jan 97 14:24:46 +0100

> to select focus that I have a problem... any ideas?

A> Very odd. unclutter must be doing something which is generating some sort of X
A> event like MotionNotify or EnterNotify. 

yes it's an iconify or close event or sth. (user-defineable)

A> I just use sloppy focus, and I move the cursor to the root window if it's in
A> my way.

A> Well, it sort of is. Originally, Focus warped the cursor to the window, as
A> well as raising it. I then proposed a WarpToWindow function which would warp
A> the cursor to a given window, and making Focus just focus, and nothing else.
A> Cause then with WarpToWindow, RaiseWindow, and the new trim Focus, you could 
A> make a fvwm function which would emulate the old Focus behavior if you really
A> liked it. The WarpToWindow function was added, and Focus stopped warping the
A> cursor, but it still raised the window. That was 2.0.43 I think. 

RaiseWindow already exists as "Raise".

A> Something to think about after 2.0 gets oficially released.

it's a two-line change in builtin.c, but many .fvwm2rc's will have to be
changed.

I'd put it in 2.0.45, but Chuck has to decide.

Shall I butcher focus & mail a patch?

albrecht
-- 
Now, in houses with a south aspect, the sun's rays penetrate into the porticoes
in winter, but in summer, the path of the sun is right above the roof so that
there is shade. If, then, this is the best arrangement, we should build the
south side loftier to get the winter sun, and the north side lower to keep out
the cold winds.						 --- Socrates, 360 B.C.
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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].