diff options
author | Deepa Natarajan <deepa.natarajan@wipro.com> | 2002-08-21 06:47:16 +0000 |
---|---|---|
committer | Deepa Natarajan <deepa@src.gnome.org> | 2002-08-21 06:47:16 +0000 |
commit | c39a03ad5992246e35a219a0c81254da9199c9ac (patch) | |
tree | 11faf7f96ea8cb347897720764c7b34808201a2e | |
parent | 0ac034ad4c58b19e4fd28c82ec52b5d68d534ae6 (diff) | |
download | metacity-c39a03ad5992246e35a219a0c81254da9199c9ac.tar.gz |
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.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/keybindings.c | 36 | ||||
-rw-r--r-- | src/metacity.schemas.in | 40 | ||||
-rw-r--r-- | src/prefs.c | 2 | ||||
-rw-r--r-- | src/prefs.h | 2 |
5 files changed, 86 insertions, 0 deletions
@@ -1,3 +1,9 @@ +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. + 2002-08-20 Steve Fox <drfickle@k-lug.org> * metacity.spec.in: Add so that the spec file gets auto-updated diff --git a/src/keybindings.c b/src/keybindings.c index 6eaaefdf..f46ec266 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 980e7bad..407918b9 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><Alt>F10</default> + <locale name="C"> + <short>Maximize a window</short> + <long> + The keybinding used to maximize 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. + </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><Alt>F5</default> + <locale name="C"> + <short>Unmaximize a window</short> + <long> + The keybinding used to unmaximize 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. + </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 63146459..7cccde03 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 1658cd96..243e9cbe 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" |