Re: Tabs implementation question

2006-07-13 Thread David
On Thu, 13 Jul 2006 11:34:58 +1000, Scott Smedley [EMAIL PROTECTED]
said:
 Hi David,
 
  I'm trying to find out how to have multiple windows sharing the same frame.
  I'm playing with FvwmTabs but I also want to experiment with a simpler
  implementation on my own.
 
 Simpler? H.
 
I just want to get four functions working - add, next, close and detatch
tab.
That is enough functionality for what I want to do. I want to see what
would
be possible if it was integrated into fvwm.

It would remove the need to create a tabber first - just join any two
windows
together; and also remove the second title bar - it could be integrated
into the
main one. The aim would be to make it transparent to the user rather
than
offering alot of functionality and configuration. It's just an idea I
wanted to
play around with based on how pekwm does this.

 
 You need to use XSetInputFocus().

The client window does get input focus and works normally, except that
the
frame decor isn't changed when the focus does. The event handlers aren't
called so I can't think of anywhere to put this that would work. I also
think
that it is a problem with events in general and not just input focus.

The thing I don't understand is how the second client is different from
the first.
When they are selected, they are both equal to fw-wins.client. They
have the
same parent, the same FvwmContext and similar setting from add_window.

-- 
David

-- 
http://www.fastmail.fm - A no graphics, no pop-ups email service




Re: Tabs implementation question

2006-07-13 Thread Scott Smedley
Hi David,

   I'm trying to find out how to have multiple windows sharing the same 
   frame.
   I'm playing with FvwmTabs but I also want to experiment with a simpler
   implementation on my own.
  
  Simpler? H.
  
 I just want to get four functions working - add, next, close and detatch
 tab.
 That is enough functionality for what I want to do. I want to see what
 would
 be possible if it was integrated into fvwm.

Most of the features you talk about are already possible with the
FvwmTabs module or could be implemented without too much effort.

 It would remove the need to create a tabber first - just join any two
 windows together

I've been using the following function to combine create  add
commands into a single action:

# CreateTabberWithWin will put the focused window into a new tabber,
# creating it at the same position as the window.
DestroyFunc CreateTabberWithWin
AddToFunc CreateTabberWithWin
+ I Current (!FvwmTabs) SetEnv CTWW_ID $[w.id]
+ I TestRc (NoMatch) Break
+ I PipeRead 'echo SetEnv CTWW_COUNT $(( $CTWW_COUNT+1 ))'
+ I NewTabber --geometry=+$[w.x]+$[w.y] .$[CTWW_COUNT]
+ I Wait FvwmTabs*
+ I WindowId $[CTWW_ID] Tabize .$[CTWW_COUNT]

Key Z A CM CreateTabberWithWin

To combine additional add commands into the same action would just
require the use of the MultiAddTab function.

 and also remove the second title bar

*FvwmTabs: showTitlebar false

 - it could be integrated into the main one.

*FvwmTabs: useTMTitlebar true

 The aim would be to make it transparent to the user rather
 than offering alot of functionality and configuration.

I agree that it's a pain that FvwmTabs depends on external libraries
(X11::Protocol  Tk) which can make configuration difficult for some
users. I don't think I've ever heard a user complain about too much
functionality though! (Some people complain about Emacs, but that's
different! :)

 It's just an idea I wanted to
 play around with based on how pekwm does this.

Go right ahead - the more people hacking on FVWM the better! IMHO.

  You need to use XSetInputFocus().
 
 The client window does get input focus and works normally, except that
 the
 frame decor isn't changed when the focus does. The event handlers aren't
 called so I can't think of anywhere to put this that would work. I also
 think
 that it is a problem with events in general and not just input focus.

Sorry, that's a little too cryptic for me to understand. I assume you
know you have to ask the X server which events you're interested in
(for each window) right? This is usually accomplished by setting the
event mask with XChangeWindowAttributes().

Scott. :)



Tabs implementation question

2006-07-12 Thread David Maciver
Hello,
I'm trying to find out how to have multiple windows sharing the same frame.
I'm playing with FvwmTabs but I also want to experiment with a simpler
implementation on my own. I wrote something like the following in the main
fvwm code.

Add tab: (client is the fw-wins.client from another frame)
XReparentWindow(dpy, client, fw-wins.parent, 0, 0);
XResizeWindow(dpy, client, fw-frame_g.width, fw-frame_g.height);
XLowerWindow(dpy, client);
XUnmapWindow(dpy, client);

Next tab: (fw-wins.client is advanced by a linked list)
XMapWindow(dpy, fw-wins.client);
XRaiseWindow(dpy, fw-wins.client);
XSaveContext(dpy, fw-wins.client, FvwmContext, (caddr_t) fw);
rectangle frame_g = fw-frame_g;
frame_force_setup_window(
fw, frame_g.x, frame_g.y, frame_g.width, frame_g.height,
True);

When I switch to another tab, the window works as normal except it doesn't
recieve FocusIn/Out events. This stops the focus decor from changing when the
mouse is in the window. When I switch back to the first tab, it works properly.

There seems to be something special about the first client window because it
was originally in that frame. I thought setting FvwmContext would give each
client the exact same structure but it doesn't. HandleFocusIn is never called
except for the first window. I'm just wondering, what is the solution to this?

David




Re: Tabs implementation question

2006-07-12 Thread Scott Smedley
Hi David,

 I'm trying to find out how to have multiple windows sharing the same frame.
 I'm playing with FvwmTabs but I also want to experiment with a simpler
 implementation on my own.

Simpler? H.

 I wrote something like the following in the main
 fvwm code.
 
 Add tab: (client is the fw-wins.client from another frame)
   XReparentWindow(dpy, client, fw-wins.parent, 0, 0);
   XResizeWindow(dpy, client, fw-frame_g.width, fw-frame_g.height);
   XLowerWindow(dpy, client);
   XUnmapWindow(dpy, client);
 
 Next tab: (fw-wins.client is advanced by a linked list)
   XMapWindow(dpy, fw-wins.client);
   XRaiseWindow(dpy, fw-wins.client);
   XSaveContext(dpy, fw-wins.client, FvwmContext, (caddr_t) fw);
   rectangle frame_g = fw-frame_g;
   frame_force_setup_window(
   fw, frame_g.x, frame_g.y, frame_g.width, frame_g.height,
   True);
 
 When I switch to another tab, the window works as normal except it doesn't
 recieve FocusIn/Out events. This stops the focus decor from changing when the
 mouse is in the window. When I switch back to the first tab, it works 
 properly.
 
 There seems to be something special about the first client window because it
 was originally in that frame. I thought setting FvwmContext would give each
 client the exact same structure but it doesn't. HandleFocusIn is never called
 except for the first window. I'm just wondering, what is the solution to this?

You need to use XSetInputFocus().

SCoTT. :)