summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog23
-rw-r--r--src/display.c2
-rw-r--r--src/keybindings.c39
-rw-r--r--src/metacity.schemas.in47
-rw-r--r--src/prefs.c2
-rw-r--r--src/prefs.h2
-rw-r--r--src/window.c13
7 files changed, 125 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 96d756556..36cd8f70e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2002-08-15 Havoc Pennington <hp@pobox.com>
+
+ * src/window.c (recalc_window_features): leave has_fullscreen_func
+ set to TRUE if the window is screen sized and undecorated, even if
+ the window isn't resizable. idea from Christian - Manny Calavera -
+ Neumair
+
+ * src/keybindings.c (handle_toggle_fullscreen)
+ (handle_toggle_maximize): these disabled fullscreen/maximize if
+ the window wasn't resizable, should have used has_fullscreen_func
+ has_maximize_func instead.
+
+2002-08-15 Havoc Pennington <hp@pobox.com>
+
+ * src/keybindings.c: implement raise/lower
+
+ * src/metacity.schemas.in: add raise/lower
+
+ * src/prefs.c: add "raise" and "lower" prefs to keybindings
+
+ * src/display.c (meta_display_set_grab_op_cursor): assert that
+ the screen arg is non-NULL in appropriate cases
+
2002-08-14 Jayaraj Rajappan <jayaraj.rajappan@wipro.com>
* src/display.c (meta_display_set_grab_op_cursor):
diff --git a/src/display.c b/src/display.c
index e20fc32f6..ac1f787b4 100644
--- a/src/display.c
+++ b/src/display.c
@@ -2275,6 +2275,8 @@ meta_display_set_grab_op_cursor (MetaDisplay *display,
}
else
{
+ g_assert (screen != NULL);
+
if (XGrabPointer (display->xdisplay,
grab_xwindow,
False,
diff --git a/src/keybindings.c b/src/keybindings.c
index 2f3e1a1b0..6eaaefdfb 100644
--- a/src/keybindings.c
+++ b/src/keybindings.c
@@ -102,6 +102,14 @@ static void handle_raise_or_lower (MetaDisplay *display,
MetaWindow *window,
XEvent *event,
MetaKeyBinding *binding);
+static void handle_raise (MetaDisplay *display,
+ MetaWindow *window,
+ XEvent *event,
+ MetaKeyBinding *binding);
+static void handle_lower (MetaDisplay *display,
+ MetaWindow *window,
+ XEvent *event,
+ MetaKeyBinding *binding);
static void handle_run_command (MetaDisplay *display,
MetaWindow *window,
XEvent *event,
@@ -264,6 +272,8 @@ static const MetaKeyHandler window_handlers[] = {
{ META_KEYBINDING_MOVE_WORKSPACE_DOWN, handle_move_to_workspace,
GINT_TO_POINTER (META_MOTION_DOWN) },
{ META_KEYBINDING_RAISE_OR_LOWER, handle_raise_or_lower, NULL},
+ { META_KEYBINDING_RAISE, handle_raise, NULL},
+ { META_KEYBINDING_LOWER, handle_lower, NULL},
{ NULL, NULL, NULL }
};
@@ -2415,7 +2425,7 @@ handle_toggle_fullscreen (MetaDisplay *display,
{
if (window->fullscreen)
meta_window_unmake_fullscreen (window);
- else if (window->has_resize_func)
+ else if (window->has_fullscreen_func)
meta_window_make_fullscreen (window);
}
}
@@ -2570,6 +2580,9 @@ handle_raise_or_lower (MetaDisplay *display,
MetaScreen *screen;
+ /* FIXME I'm really not sure why we get the screen here
+ * instead of using window->screen
+ */
screen = meta_display_screen_for_root (display, event->xbutton.root);
if (screen == NULL)
return;
@@ -2612,6 +2625,30 @@ handle_raise_or_lower (MetaDisplay *display,
}
static void
+handle_raise (MetaDisplay *display,
+ MetaWindow *window,
+ XEvent *event,
+ MetaKeyBinding *binding)
+{
+ if (window)
+ {
+ meta_window_raise (window);
+ }
+}
+
+static void
+handle_lower (MetaDisplay *display,
+ MetaWindow *window,
+ XEvent *event,
+ MetaKeyBinding *binding)
+{
+ if (window)
+ {
+ meta_window_lower (window);
+ }
+}
+
+static void
handle_workspace_switch (MetaDisplay *display,
MetaWindow *window,
XEvent *event,
diff --git a/src/metacity.schemas.in b/src/metacity.schemas.in
index 982964c15..9031733ff 100644
--- a/src/metacity.schemas.in
+++ b/src/metacity.schemas.in
@@ -717,6 +717,53 @@ you set
</locale>
</schema>
+ <schema>
+ <key>/schemas/apps/metacity/window_keybindings/raise</key>
+ <applyto>/apps/metacity/window_keybindings/raise</applyto>
+ <owner>metacity</owner>
+ <type>string</type>
+ <!-- no default for this one -->
+ <locale name="C">
+ <short>Raise window above other windows</short>
+ <long>
+ This keybinding raises the window above other windows.
+
+ 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/lower</key>
+ <applyto>/apps/metacity/window_keybindings/lower</applyto>
+ <owner>metacity</owner>
+ <type>string</type>
+ <!-- no default for this one -->
+ <locale name="C">
+ <short>Lower window below other windows</short>
+ <long>
+ This keybinding lowers a window below other windows.
+
+ 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>
+
+
<!-- Global Keybindings -->
diff --git a/src/prefs.c b/src/prefs.c
index 9a9b59f2a..631464598 100644
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -897,6 +897,8 @@ static MetaKeyPref window_bindings[] = {
{ META_KEYBINDING_MOVE_WORKSPACE_UP, 0, 0 },
{ META_KEYBINDING_MOVE_WORKSPACE_DOWN, 0, 0 },
{ META_KEYBINDING_RAISE_OR_LOWER, 0, 0 },
+ { META_KEYBINDING_RAISE, 0, 0 },
+ { META_KEYBINDING_LOWER, 0, 0 },
{ NULL, 0, 0 }
};
diff --git a/src/prefs.h b/src/prefs.h
index c6cc0d035..1658cd96f 100644
--- a/src/prefs.h
+++ b/src/prefs.h
@@ -130,6 +130,8 @@ void meta_prefs_set_num_workspaces (int n_workspaces);
#define META_KEYBINDING_MOVE_WORKSPACE_UP "move_to_workspace_up"
#define META_KEYBINDING_MOVE_WORKSPACE_DOWN "move_to_workspace_down"
#define META_KEYBINDING_RAISE_OR_LOWER "raise_or_lower"
+#define META_KEYBINDING_RAISE "raise"
+#define META_KEYBINDING_LOWER "lower"
typedef enum _MetaKeyBindingAction
{
diff --git a/src/window.c b/src/window.c
index 5a8846fa9..49faa2444 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5284,11 +5284,20 @@ recalc_window_features (MetaWindow *window)
window->size_hints.min_height == window->size_hints.max_height)
window->has_resize_func = FALSE;
- /* don't allow fullscreen if we can't resize */
+ /* don't allow fullscreen if we can't resize, unless the size
+ * is entire screen size (kind of broken, because we
+ * actually fullscreen to xinerama head size not screen size)
+ */
if (!window->has_resize_func)
{
window->has_maximize_func = FALSE;
- window->has_fullscreen_func = FALSE;
+
+ if (window->size_hints.min_width == window->screen->width &&
+ window->size_hints.min_height == window->screen->height &&
+ !window->decorated)
+ ; /* leave fullscreen available */
+ else
+ window->has_fullscreen_func = FALSE;
}
/* no shading if not decorated */