More info about this patch: http://www.cis.upenn.edu/~bjornk/ctwm/

To apply this patch:

1) cd to your CTWM source directory and
2) Run 'patch -l -p3 < path_to_this_file'
3) Run 'make install'

Workspace patch:
----------------
I found it very annoying that ctwm treats the workspace window as a "normal"
window. I'd like to be able to bind keys tat will only work when the pointer is
in the workspace manager window, just as you can bind keys to functions when
the pointer is in the icon manager window. This was a quick'n'dirty hack, so
perhaps someone more familiar with the inner workings of ctwm could take a look
at it. The key bindings below illustrates my point:

"F1"    =       : iconmgr       : !"xeyes &"

Vanilla ctwm can bind F1 to pop up xeyes, if pressed in the icon manager, but
to get the same effect for the workspace manager, one would have to bind F1 in
all application windows. My patch allow you to bind keys in the workspace
window context, e.g.:

"F1"    =       : workspace     : !"xeyes &"

will pop up xeyes if F1 is pressed in the workspace manager, but not anywhere
else.

-------------------
Bjorn Knutsson  http://www.cis.upenn.edu/~bjornk/

Patch against CTWM 3.6:

diff -rwc /tmp/ctwm-3.6/events.c /usr/local/src/ctwm-3.6/events.c
*** /tmp/ctwm-3.6/events.c      2001-12-11 10:38:52.000000000 -0500
--- /usr/local/src/ctwm-3.6/events.c    2002-06-17 18:12:46.000000000 -0400
***************
*** 1228,1233 ****
--- 1228,1235 ----
            Context = C_ICONMGR;
        if (Tmp_win->list && Event.xany.window == Tmp_win->list->icon)
            Context = C_ICONMGR;
+       if (Tmp_win == Scr->workSpaceMgr.workspaceWindow.twm_win)
+           Context = C_WORKSPACE;
      }
  
      modifier = (Event.xkey.state | AlternateKeymap) & mods_used;
diff -rwc /tmp/ctwm-3.6/gram.y /usr/local/src/ctwm-3.6/gram.y
*** /tmp/ctwm-3.6/gram.y        2001-12-11 10:38:52.000000000 -0500
--- /usr/local/src/ctwm-3.6/gram.y      2002-06-17 18:12:46.000000000 -0400
***************
*** 514,519 ****
--- 514,520 ----
                | ICON                  { cont |= C_ICON_BIT; }
                | ROOT                  { cont |= C_ROOT_BIT; }
                | FRAME                 { cont |= C_FRAME_BIT; }
+               | WORKSPACE             { cont |= C_WORKSPACE_BIT; }
                | ICONMGR               { cont |= C_ICONMGR_BIT; }
                | META                  { cont |= C_ICONMGR_BIT; }
                | ALTER                 { cont |= C_ALTER_BIT; }
***************
*** 530,535 ****
--- 531,537 ----
                | ICON                  { cont |= C_ICON_BIT; }
                | ROOT                  { cont |= C_ROOT_BIT; }
                | FRAME                 { cont |= C_FRAME_BIT; }
+               | WORKSPACE             { cont |= C_WORKSPACE_BIT; }
                | ICONMGR               { cont |= C_ICONMGR_BIT; }
                | META                  { cont |= C_ICONMGR_BIT; }
                | ALL                   { cont |= C_ALL_BITS; }
diff -rwc /tmp/ctwm-3.6/twm.h /usr/local/src/ctwm-3.6/twm.h
*** /tmp/ctwm-3.6/twm.h 2001-12-11 10:38:52.000000000 -0500
--- /usr/local/src/ctwm-3.6/twm.h       2002-06-17 18:12:46.000000000 -0400
***************
*** 145,151 ****
  #define C_NAME                6
  #define C_IDENTIFY      7
  #define C_ALTERNATE     8
! #define NUM_CONTEXTS  9
  
  #define C_WINDOW_BIT  (1 << C_WINDOW)
  #define C_TITLE_BIT   (1 << C_TITLE)
--- 145,152 ----
  #define C_NAME                6
  #define C_IDENTIFY      7
  #define C_ALTERNATE     8
! #define C_WORKSPACE   9
! #define NUM_CONTEXTS  10
  
  #define C_WINDOW_BIT  (1 << C_WINDOW)
  #define C_TITLE_BIT   (1 << C_TITLE)
***************
*** 155,162 ****
  #define C_ICONMGR_BIT (1 << C_ICONMGR)
  #define C_NAME_BIT    (1 << C_NAME)
  #define C_ALTER_BIT   (1 << C_ALTERNATE)
  
! #define C_ALL_BITS    (C_WINDOW_BIT | C_TITLE_BIT | C_ICON_BIT |\
                         C_ROOT_BIT | C_FRAME_BIT | C_ICONMGR_BIT)
  
  /* modifiers for button presses */
--- 156,164 ----
  #define C_ICONMGR_BIT (1 << C_ICONMGR)
  #define C_NAME_BIT    (1 << C_NAME)
  #define C_ALTER_BIT   (1 << C_ALTERNATE)
+ #define C_WORKSPACE_BIT       (1 << C_WORKSPACE)
  
! #define C_ALL_BITS    (C_WORKSPACE_BIT | C_WINDOW_BIT | C_TITLE_BIT | C_ICON_BIT |\
                         C_ROOT_BIT | C_FRAME_BIT | C_ICONMGR_BIT)
  
  /* modifiers for button presses */

Reply via email to