Subject: Pager problems

From: Matthias Clasen <[email-masked]>
Date: Wed, 12 May 1999 00:27:18 +0200

A couple of things I noticed with the pager:

Why is "GotoDesk 0 10000" send before going to the actual page+desk
in SwitchToDeskAndPage ?

This causes modules like FvwmBacker or FvwmEvent to execute the action
bound to desk changes twice instead of once.

If I use Mouse 3 to switch desks, the desk names are not de-highlighted
correctly. I end up with both names (in a two-desk pager) being
highlighted at the same time.

-- 
Matthias Clasen, 
Tel. 0761/203-5606
Email: [email-masked]
Mathematisches Institut, Albert-Ludwigs-Universitaet Freiburg
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Bob Woodside <[email-masked]>
Date: Fri, 21 May 1999 01:10:09 -0400

> Why is "GotoDesk 0 10000" send before going to the actual page+desk

	Well, I just discovered the reason. It was a hack to avoid the
following visual unpleasantness (and overhead).

	Put several windows on page 0,0 of desk 0. Put several more on page 1,0
of desk 0, and make sure there are none on page 1,0 of page 1. Situate
your viewport on 0,0,0. Now click on page 1,0 of desk 1 in the Pager and
watch the transition.

	You first see the viewport switch to 1,0, so all those windows on page
1,0 of desk 0 flash into view. Then the desk is switched. You'd have a
similar problem if you did the desk switch first, then the page switch.

	Something like the old hack has to go back in. Maybe we need to modify
changeDesks slightly, adding a new argument to suppress broadcasting the
desk switch, and adding a new wrapper like changeDesks_func that sets
that flag. Then the Pager could call it this way once to hide its
nefarious activities, and then call it the regular way to do the real
switch to the target desk. 

	I'll play with this idea tomorrow if I have some time, or over the
weekend otherwise. I think it should eliminate the problems you were
originally having, but I'm not totally sure about the
double-highlighting bug - I haven't looked into it far enough to see why
it happens specifically with Button 3.

- Bob

---

From: Matthias Clasen <[email-masked]>
Date: Fri, 21 May 1999 09:44:21 +0200

> following visual unpleasantness (and overhead).

Yes, I noticed this too, but I removed the GotoDesk 0 10000 nevertheless,
because it is a bad hack and has unwanted side effects. Removing it also 
fixed the double highlighting bug. If you really want to avoid the 
"visual unpleasantness", the proper fix would be a new command to switch
desk and viewport in one go: GotoDeskAndPage x y z 

Matthias

---

From: Bob Woodside <[email-masked]>
Date: Fri, 21 May 1999 09:56:58 -0400

Matthias Clasen wrote:
> because it is a bad hack and has unwanted side effects. 

	Unfortunately, the cure is worse than the disease. But you're right, it
was a bad hack.

> Removing it also fixed the double highlighting bug.

	I think "masked" is a better word.

> If you really want to avoid the "visual unpleasantness",

	Oh, I do, I do.

> the proper fix would be a new command to switch desk and viewport
> in one go: GotoDeskAndPage x y z

	Yeah, after a little reflection that's what I'm inclined to do. I'll
work on it this weekend.

- Bob

---

From: Bob Woodside <[email-masked]>
Date: Mon, 24 May 1999 13:13:13 -0400

>         Yeah, after a little reflection that's what I'm inclined to do. I'll

	Ok, I've done this. To avoid massive duplication of code, I've removed
most of the old changeDesks function to a couple of new funcs, UnmapDesk
and MapDesk, which are also used by the new gotoDeskAndPage_func.
Because of this, I want to test a few more things unrelated to the
original issue before committing the change.

	It's also raised a couple of questions, because I've made a change in
the way changeDesks handles focus switching. 

	When the desk is switched, the old code will restore focus to the last
ClickToFocus window that had focus on the new desk, if it can find one -
even if a Sticky window currently has the focus (i.e., the currently
focused window is going to lose focus when it appears on the new desk).
My change gives precedence to a Sticky window that currently has the
focus.

	I think the old way was mistaken, but I could be wrong. At any rate, I
definitely like the new way better. Any opinions?

	The second question: this remember-last-focused-clicky-window logic has
an #ifndef NO_REMEMBER_FOCUS hack that probably should be removed - or
else made official. I don't see anywhere that it's supported by config.
I don't know the history of this stuff, but it was like this in 2.0.46.
Again, any opinions or insights?

- Bob

---

From: Brad Giaccio <[email-masked]>
Date: Mon, 24 May 1999 13:50:25 -0400

> My change gives precedence to a Sticky window that currently has the

Just a question, since it is a behavior I use currentlly you can focus a
window then in the pager right click a different page not desk and when
you get to the new page you still have foucs on the other page, I often
use this with apps that start of lots of windows real fast and I don't
want to clutter my current page with them.  This is a behavior I enjoy
and if possible would prefer it not broken.  Thanks.

-- 
--- There are two kinds of knowledge, you either know the answer or
			you know where to find it
		      -Kane, Johnson, and anonymous
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Bob Woodside <[email-masked]>
Date: Mon, 24 May 1999 14:20:03 -0400

Brad Giaccio wrote:
> >       When the desk is switched, the...code will restore focus to the last

	Me, too. The page switch focus logic isn't touched. Breathe easy.

	Actually, I'm not sure I wouldn't like to be able to do this across
desks as well as pages. Maybe the NO_REMEMBER_FOCUS #ifdef hack should
be made into an official option - only it would have to work slightly
differently from the way it does now.

- Bob

---

From: Brad Giaccio <[email-masked]>
Date: Mon, 24 May 1999 14:22:17 -0400

> differently from the way it does now.

I would be all for that.

---

From: Bob Woodside <[email-masked]>
Date: Mon, 24 May 1999 16:25:27 -0400

Brad Giaccio wrote:
> > desks as well as pages.

	Onnnn the other hand...maybe not.

	I didn't stop to think that windows on desks other than the current one
are unmapped. I don't think we want to be trying to focus unmapped
windows.

- Bob

---

From: Matthias Clasen <[email-masked]>
Date: Mon, 24 May 1999 23:16:11 +0200

> are unmapped. I don't think we want to be trying to focus unmapped

Right, windows on other desks are unmapped and X doesn't allow to put
focus on an unviewable window.

---

From: Bob Woodside <[email-masked]>
Date: Mon, 24 May 1999 22:21:34 -0400

Bob Woodside wrote:
> 
>             [...rewrote changeDesks, blah, blah...]
> I want to test a few more things unrelated to the original issue
> before committing the change.

	I just committed this change. I'm leaving the old changeDesks code in,
but ifdef'ed around, for a couple of days in case anyone would like to
do
some performance tests against both versions (I don't see a significant
difference on my box). To test the old version, set a define for
OLD_DESKSWITCH and recompile virtual.c - there are further comments at
the beginning of changeDesks.

	I'll drop the old stuff in a couple of days if I don't find a reason to
revert to it.

- Bob