Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A action "restore" for a key binding #233

Closed
rdnvndr opened this issue Oct 22, 2015 · 0 comments
Closed

A action "restore" for a key binding #233

rdnvndr opened this issue Oct 22, 2015 · 0 comments

Comments

@rdnvndr
Copy link
Contributor

rdnvndr commented Oct 22, 2015

Please add action "restore" for a key binding. The action "restore" minimizes normal window and restores maximising window to normal.
The patch file:

diff -cr old/src/event.c jwm-2.3.1/src/event.c
*** old/src/event.c 2015-07-30 09:17:37.000000000 +0300
--- jwm-2.3.1/src/event.c   2015-07-30 09:20:47.700732771 +0300
***************
*** 515,520 ****
--- 515,529 ----
           }
        }
        break;
+    case KEY_RESTORE:
+       if(np) {
+          if(np->state.maxFlags) {
+             MaximizeClient(np, MAX_NONE);
+          } else {
+             MinimizeClient(np, 1);
+          }
+       }
+       break;    
     case KEY_MAXTOP:
        ToggleMaximized(np, MAX_TOP | MAX_HORIZ);
        break;
diff -cr old/src/key.c jwm-2.3.1/src/key.c
*** old/src/key.c   2015-06-29 01:21:20.000000000 +0300
--- jwm-2.3.1/src/key.c 2015-07-30 09:19:38.144065649 +0300
***************
*** 301,306 ****
--- 301,307 ----
     case KEY_MAXRIGHT:
     case KEY_MAXV:
     case KEY_MAXH:
+    case KEY_RESTORE:
        return 1;
     default:
        return 0;
diff -cr old/src/key.h jwm-2.3.1/src/key.h
*** old/src/key.h   2015-06-29 01:21:20.000000000 +0300
--- jwm-2.3.1/src/key.h 2015-07-30 09:19:16.884065510 +0300
***************
*** 58,63 ****
--- 58,64 ----
  #define KEY_MAXRIGHT        38
  #define KEY_MAXV            39
  #define KEY_MAXH            40
+ #define KEY_RESTORE         41

  void InitializeKeys(void);
  void StartupKeys(void);
diff -cr old/src/parse.c jwm-2.3.1/src/parse.c
*** old/src/parse.c 2015-07-30 09:17:37.000000000 +0300
--- jwm-2.3.1/src/parse.c   2015-07-30 09:18:44.204065292 +0300
***************
*** 62,67 ****
--- 62,68 ----
     { "rdesktop",              KEY_RDESKTOP      },
     { "resize",                KEY_RESIZE        },
     { "restart",               KEY_RESTART       },
+    { "restore",               KEY_RESTORE       },
     { "right",                 KEY_RIGHT         },
     { "select",                KEY_ENTER         },
     { "sendd",                 KEY_SENDD         },

@rdnvndr rdnvndr changed the title Action "restore" for a key binding A action "restore" for a key binding Oct 22, 2015
@joewing joewing added this to the Version 2.3.3 milestone Oct 24, 2015
@joewing joewing closed this as completed Oct 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants