diff --git a/ChangeLog b/ChangeLog index 5e939465c..932d1d39d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-05-24 Havoc Pennington + + * src/metacity.schemas: add minimize window binding + + * src/keybindings.c (handle_minimize_window): add minimize keybinding + 2002-05-24 Havoc Pennington * src/window.c (meta_window_show): change how focusing windows diff --git a/src/keybindings.c b/src/keybindings.c index 957e6e694..1aa924b89 100644 --- a/src/keybindings.c +++ b/src/keybindings.c @@ -74,6 +74,10 @@ static void handle_close_window (MetaDisplay *display, MetaWindow *window, XEvent *event, MetaKeyBinding *binding); +static void handle_minimize_window (MetaDisplay *display, + MetaWindow *window, + XEvent *event, + MetaKeyBinding *binding); static void handle_begin_move (MetaDisplay *display, MetaWindow *window, XEvent *event, @@ -177,6 +181,7 @@ static const MetaKeyHandler window_handlers[] = { { META_KEYBINDING_TOGGLE_MAXIMIZE, handle_toggle_maximize, NULL }, { META_KEYBINDING_TOGGLE_SHADE, handle_toggle_shade, NULL }, { META_KEYBINDING_CLOSE, handle_close_window, NULL }, + { META_KEYBINDING_MINIMIZE, handle_minimize_window, NULL }, { META_KEYBINDING_BEGIN_MOVE, handle_begin_move, }, { META_KEYBINDING_BEGIN_RESIZE, handle_begin_resize, }, { META_KEYBINDING_TOGGLE_STICKY, handle_toggle_sticky, }, @@ -1603,6 +1608,16 @@ handle_close_window (MetaDisplay *display, meta_window_delete (window, event->xkey.time); } +static void +handle_minimize_window (MetaDisplay *display, + MetaWindow *window, + XEvent *event, + MetaKeyBinding *binding) +{ + if (window) + meta_window_minimize (window); +} + static void handle_begin_move (MetaDisplay *display, MetaWindow *window, diff --git a/src/metacity.schemas b/src/metacity.schemas index 6f6439433..37505da05 100644 --- a/src/metacity.schemas +++ b/src/metacity.schemas @@ -229,6 +229,27 @@ you set + + /schemas/apps/metacity/window_keybindings/minimize + /apps/metacity/window_keybindings/minimize + metacity + string + disabled + + Minimize a window + + The keybinding used to minimize a window. + The format looks like "<Control>a" or "<Shift><Alt>F1. + The parser is + fairly liberal and allows lower or upper case, and also + abbreviations such as "<Ctl>" and "<Ctrl>". If +you set + the option to the special string "disabled", then there + will be no keybinding for this action. + + + + /schemas/apps/metacity/window_keybindings/begin_move /apps/metacity/window_keybindings/begin_move diff --git a/src/prefs.c b/src/prefs.c index bb7a0d969..80dc7e8cb 100644 --- a/src/prefs.c +++ b/src/prefs.c @@ -829,6 +829,7 @@ static MetaKeyPref window_bindings[] = { { META_KEYBINDING_TOGGLE_FULLSCREEN, 0, 0 }, { META_KEYBINDING_TOGGLE_MAXIMIZE, 0, 0 }, { META_KEYBINDING_TOGGLE_SHADE, 0, 0 }, + { META_KEYBINDING_MINIMIZE, 0, 0 }, { META_KEYBINDING_CLOSE, 0, 0 }, { META_KEYBINDING_BEGIN_MOVE, 0, 0 }, { META_KEYBINDING_BEGIN_RESIZE, 0, 0 }, diff --git a/src/prefs.h b/src/prefs.h index bcd369b6e..975d4b404 100644 --- a/src/prefs.h +++ b/src/prefs.h @@ -90,6 +90,7 @@ void meta_prefs_set_num_workspaces (int n_workspaces); #define META_KEYBINDING_TOGGLE_FULLSCREEN "toggle_fullscreen" #define META_KEYBINDING_TOGGLE_MAXIMIZE "toggle_maximized" #define META_KEYBINDING_TOGGLE_SHADE "toggle_shaded" +#define META_KEYBINDING_MINIMIZE "minimize" #define META_KEYBINDING_CLOSE "close" #define META_KEYBINDING_BEGIN_MOVE "begin_move" #define META_KEYBINDING_BEGIN_RESIZE "begin_resize"