Multiple Window Managers.

I glad to introduce you an ease way to get 2 window managers handle X events at the same time.

I used Afterstep as my primary window manager for years, and I satisfied at all with it. It highly configurable, and handle windows/keyboard/mouse in way I like very much. But .. some time ago I begin to use matchbox window manager at home, just like a way that window get borrow entire screen, and you can easily switch between windows. But matchbox have no ability to split screen, so some(not primary) window should be viewable but have a smaller size(like speedbar in emacs). Then I find ION window manager. An extremely simple and useful at the same time. It done work that I expect from matchbox, but ION have no possibilities to handle windows in way that "normal" window managers do. And I began to miss afterstep. So I decide: why is it impossible to run 2 window managers at the same time?

I'm not an expert in programming X oriented applications, but X(idea and proto) is so simple on first sight, and I try to implement next:

I dig some in ION(stable) source and find out:

I also need to know a little about Xlib, so I dig some trough X sources and find:

I think it's enough to implement what I want.

Notes on ION:

stable - each physical(or xineramed) screen(WScreen) have a list of workspaces(WWorkspace) and workspace have frames list (WFrame) and information about splits.
ion-devel - New object introduced in ion-devel is ViewPort and WRegion .. there is two variants: Single Head: most common variant.
  You have 1 screen(WScreen) that contains 1 viewport (WViewPort) that have workspaces list(WWorkspace) and workspace contain frames list and split info.
Multi Head: assume we have dual head variant of multiheading
  You have 2 screens(WScreen) that points to a single viewport ..
Xinerama: assume we have 2 physical screens xineramed together
  You have 1 screen(WScreen) and 2 viewports(WViewPort) .. Also each thing in ION (like WScreen, WViewPort, WWorkspace or WFrame) have table of named functions. That functions will be called by ION.

Notes on ION modules programming:

Each ION module have:
Name of module:
To load module you should add line like this to your ion.conf:
  module "/path/to/module/module_name.so"
	  
so your module name would be "module_name"
init/deinit function:
You should provide functions:
  modulename_init();
  modulename_deinit();
	  
in your module .. modulename_init() calls when you load module, and modulename_deinit() when you unload it.
functions table:
Should be like this:
  WFunction modulename_funtab[] {
      /*        type  parametr func_string         real_function */
      FN_VOID(generic, WFrame, "myfunction_begin", myfunction_begin),
      {NULL, NULL, NULL, NULL, NULL} /* funtab terminator */
  };
	  
also you should implement myfunction_begin(). When you type Alt-F3(default) or a keys combination that stands for query_function and give your func_string, real_function will be called.
misc hooks:
ION provide some hooks in event handling mechanism, like:
  workspace_switch_hook, your hook function should looks like name_workspace_switch_hook()

Notes on Afterstep:

As a standard window manager afterstep behave: What we want in afterstep_init()? just nothing :). But we want to have function afterstep_gogo() to begin afterstep session in ION workspace, also we should omit initial windows handling, because ION's frames is also X windows.

Also to have afterstep works proper with ION you must register keyboard strokes(thats which you use to switch between workspaces in ION) in afterstep. Add lines like this to your feel file:
  ##                      3 - Mod3, M - Meta (or Mod1)
  Key 1           A       3       Nop ""
  Key 2           A       3       Nop ""
  Key 3           A       3       Nop ""
  Key 4           A       3       Nop ""
  Key 5           A       3       Nop ""
  Key 6           A       3       Nop ""
  Key 7           A       3       Nop ""
  Key 8           A       3       Nop ""
  Key 9           A       3       Nop ""
  Key 0           A       3       Nop ""

  Key d           A       M3      Nop ""
  Key f           A       M3      Nop ""

  Key 1           A       M3      Nop ""
  Key 2           A       M3      Nop ""
  Key 3           A       M3      Nop ""
  Key 4           A       M3      Nop ""

  Key 1           A       M       Nop ""
  Key 2           A       M       Nop ""
  Key 3           A       M       Nop ""
  Key 4           A       M       Nop ""
      

APPENDIX

[1] To ION developers: big thank you have time to implement this incredible window manager. And some questions: [2] patch for Afterstep-1.8.11: here - Note: not nice, but it works for me and I also have no time :(.

[3] patch for ION-20020207 (aka stable): here

[4] afterstep Makefile notes:
to build afterstep.so you will need pass next flags to your compiler:
-shared -DION_MODULE -I/patch/to/ion/tree

Hosted by uCoz