summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2002-05-25 02:30:00 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-05-25 02:30:00 +0000
commita4fe1ad960521216a189f78d2444c7d0fcf53092 (patch)
treef18bc1c53c66d35abec764dc45724ae0c625ead8
parent750cb70f69da25c501ed2da9ccfeeb5342e88399 (diff)
downloadmetacity-a4fe1ad960521216a189f78d2444c7d0fcf53092.tar.gz
metacity-a4fe1ad960521216a189f78d2444c7d0fcf53092.tar.bz2
add minimize window binding
2002-05-24 Havoc Pennington <hp@pobox.com> * src/metacity.schemas: add minimize window binding * src/keybindings.c (handle_minimize_window): add minimize keybinding
-rw-r--r--ChangeLog6
-rw-r--r--src/keybindings.c15
-rw-r--r--src/metacity.schemas21
-rw-r--r--src/prefs.c1
-rw-r--r--src/prefs.h1
5 files changed, 44 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 5e93946..932d1d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2002-05-24 Havoc Pennington <hp@pobox.com>
+ * src/metacity.schemas: add minimize window binding
+
+ * src/keybindings.c (handle_minimize_window): add minimize keybinding
+
+2002-05-24 Havoc Pennington <hp@pobox.com>
+
* src/window.c (meta_window_show): change how focusing windows
on initial map works, so that we only steal focus from our
transient parent or from a panel/desktop, never from other
diff --git a/src/keybindings.c b/src/keybindings.c
index 957e6e6..1aa924b 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, },
@@ -1604,6 +1609,16 @@ handle_close_window (MetaDisplay *display,
}
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,
XEvent *event,
diff --git a/src/metacity.schemas b/src/metacity.schemas
index 6f64394..37505da 100644
--- a/src/metacity.schemas
+++ b/src/metacity.schemas
@@ -230,6 +230,27 @@ you set
</schema>
<schema>
+ <key>/schemas/apps/metacity/window_keybindings/minimize</key>
+ <applyto>/apps/metacity/window_keybindings/minimize</applyto>
+ <owner>metacity</owner>
+ <type>string</type>
+ <default>disabled</default>
+ <locale name="C">
+ <short>Minimize a window</short>
+ <long>
+ The keybinding used to minimize a window.
+ The format looks like "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1.
+ The parser is
+ fairly liberal and allows lower or upper case, and also
+ abbreviations such as "&lt;Ctl&gt;" and "&lt;Ctrl&gt;". If
+you set
+ the option to the special string "disabled", then there
+ will be no keybinding for this action.
+ </long>
+ </locale>
+ </schema>
+
+ <schema>
<key>/schemas/apps/metacity/window_keybindings/begin_move</key>
<applyto>/apps/metacity/window_keybindings/begin_move</applyto>
<owner>metacity</owner>
diff --git a/src/prefs.c b/src/prefs.c
index bb7a0d9..80dc7e8 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 bcd369b..975d4b4 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"