summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDeepa Natarajan <deepa.natarajan@wipro.com>2002-08-21 06:47:16 +0000
committerDeepa Natarajan <deepa@src.gnome.org>2002-08-21 06:47:16 +0000
commitc39a03ad5992246e35a219a0c81254da9199c9ac (patch)
tree11faf7f96ea8cb347897720764c7b34808201a2e /src
parent0ac034ad4c58b19e4fd28c82ec52b5d68d534ae6 (diff)
downloadmetacity-c39a03ad5992246e35a219a0c81254da9199c9ac.tar.gz
metacity-c39a03ad5992246e35a219a0c81254da9199c9ac.tar.bz2
add maximize and unmaximize keybinding setting. Partly fixes bug# 78999.
2002-08-21 Deepa Natarajan <deepa.natarajan@wipro.com> * src/keybindings.c, src/metacity.schemas.in, src/prefs.[ch]: add maximize and unmaximize keybinding setting. Partly fixes bug# 78999.
Diffstat (limited to 'src')
-rw-r--r--src/keybindings.c36
-rw-r--r--src/metacity.schemas.in40
-rw-r--r--src/prefs.c2
-rw-r--r--src/prefs.h2
4 files changed, 80 insertions, 0 deletions
diff --git a/src/keybindings.c b/src/keybindings.c
index 6eaaefd..f46ec26 100644
--- a/src/keybindings.c
+++ b/src/keybindings.c
@@ -66,6 +66,14 @@ static void handle_toggle_maximize (MetaDisplay *display,
MetaWindow *window,
XEvent *event,
MetaKeyBinding *binding);
+static void handle_maximize (MetaDisplay *display,
+ MetaWindow *window,
+ XEvent *event,
+ MetaKeyBinding *binding);
+static void handle_unmaximize (MetaDisplay *display,
+ MetaWindow *window,
+ XEvent *event,
+ MetaKeyBinding *binding);
static void handle_toggle_shade (MetaDisplay *display,
MetaWindow *window,
XEvent *event,
@@ -233,6 +241,8 @@ static const MetaKeyHandler window_handlers[] = {
{ META_KEYBINDING_WINDOW_MENU, handle_activate_menu, NULL },
{ META_KEYBINDING_TOGGLE_FULLSCREEN, handle_toggle_fullscreen, NULL },
{ META_KEYBINDING_TOGGLE_MAXIMIZE, handle_toggle_maximize, NULL },
+ { META_KEYBINDING_MAXIMIZE, handle_maximize, NULL },
+ { META_KEYBINDING_UNMAXIMIZE, handle_unmaximize, NULL },
{ META_KEYBINDING_TOGGLE_SHADE, handle_toggle_shade, NULL },
{ META_KEYBINDING_CLOSE, handle_close_window, NULL },
{ META_KEYBINDING_MINIMIZE, handle_minimize_window, NULL },
@@ -2446,6 +2456,32 @@ handle_toggle_maximize (MetaDisplay *display,
}
static void
+handle_maximize (MetaDisplay *display,
+ MetaWindow *window,
+ XEvent *event,
+ MetaKeyBinding *binding)
+{
+ if (window)
+ {
+ if (window->has_maximize_func)
+ meta_window_maximize (window);
+ }
+}
+
+static void
+handle_unmaximize (MetaDisplay *display,
+ MetaWindow *window,
+ XEvent *event,
+ MetaKeyBinding *binding)
+{
+ if (window)
+ {
+ if (window->maximized)
+ meta_window_unmaximize (window);
+ }
+}
+
+static void
handle_toggle_shade (MetaDisplay *display,
MetaWindow *window,
XEvent *event,
diff --git a/src/metacity.schemas.in b/src/metacity.schemas.in
index 980e7ba..407918b 100644
--- a/src/metacity.schemas.in
+++ b/src/metacity.schemas.in
@@ -188,6 +188,46 @@ you set
</schema>
<schema>
+ <key>/schemas/apps/metacity/window_keybindings/maximize</key>
+ <applyto>/apps/metacity/window_keybindings/maximize</applyto>
+ <owner>metacity</owner>
+ <type>string</type>
+ <default>&lt;Alt&gt;F10</default>
+ <locale name="C">
+ <short>Maximize a window</short>
+ <long>
+ The keybinding used to maximize 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/unmaximize</key>
+ <applyto>/apps/metacity/window_keybindings/unmaximize</applyto>
+ <owner>metacity</owner>
+ <type>string</type>
+ <default>&lt;Alt&gt;F5</default>
+ <locale name="C">
+ <short>Unmaximize a window</short>
+ <long>
+ The keybinding used to unmaximize 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/toggle_shaded</key>
<applyto>/apps/metacity/window_keybindings/toggle_shaded</applyto>
<owner>metacity</owner>
diff --git a/src/prefs.c b/src/prefs.c
index 6314645..7cccde0 100644
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -874,6 +874,8 @@ static MetaKeyPref window_bindings[] = {
{ META_KEYBINDING_WINDOW_MENU, 0, 0 },
{ META_KEYBINDING_TOGGLE_FULLSCREEN, 0, 0 },
{ META_KEYBINDING_TOGGLE_MAXIMIZE, 0, 0 },
+ { META_KEYBINDING_MAXIMIZE, 0, 0 },
+ { META_KEYBINDING_UNMAXIMIZE, 0, 0 },
{ META_KEYBINDING_TOGGLE_SHADE, 0, 0 },
{ META_KEYBINDING_MINIMIZE, 0, 0 },
{ META_KEYBINDING_CLOSE, 0, 0 },
diff --git a/src/prefs.h b/src/prefs.h
index 1658cd9..243e9cb 100644
--- a/src/prefs.h
+++ b/src/prefs.h
@@ -107,6 +107,8 @@ void meta_prefs_set_num_workspaces (int n_workspaces);
#define META_KEYBINDING_WINDOW_MENU "activate_window_menu"
#define META_KEYBINDING_TOGGLE_FULLSCREEN "toggle_fullscreen"
#define META_KEYBINDING_TOGGLE_MAXIMIZE "toggle_maximized"
+#define META_KEYBINDING_MAXIMIZE "maximize"
+#define META_KEYBINDING_UNMAXIMIZE "unmaximize"
#define META_KEYBINDING_TOGGLE_SHADE "toggle_shaded"
#define META_KEYBINDING_MINIMIZE "minimize"
#define META_KEYBINDING_CLOSE "close"