summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/50-marco-global-key.xml.in3
-rw-r--r--src/core/keybindings.c45
-rw-r--r--src/core/screen-private.h3
-rw-r--r--src/core/workspace.c9
-rw-r--r--src/core/workspace.h3
-rw-r--r--src/include/all-keybindings.h5
-rw-r--r--src/org.mate.marco.gschema.xml7
-rw-r--r--src/ui/tile-preview.c15
8 files changed, 82 insertions, 8 deletions
diff --git a/src/50-marco-global-key.xml.in b/src/50-marco-global-key.xml.in
index 81a8db85..84276a86 100644
--- a/src/50-marco-global-key.xml.in
+++ b/src/50-marco-global-key.xml.in
@@ -127,5 +127,8 @@
schema="org.mate.Marco.general"
comparison="gt" />
+ <KeyListEntry name="switch-to-workspace-prev"
+ _description="Switch to previously selected workspace" />
+
</KeyListEntries>
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 73966a80..068199b8 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -2288,6 +2288,14 @@ handle_switch_to_workspace (MetaDisplay *display,
{
gint which = binding->handler->data;
MetaWorkspace *workspace;
+
+ if (which == META_MOTION_PREV)
+ {
+ workspace = screen->prev_workspace;
+ if (workspace)
+ meta_workspace_activate (workspace, event->xkey.time);
+ return;
+ }
if (which < 0)
{
@@ -3421,3 +3429,40 @@ meta_set_keybindings_disabled (gboolean setting)
meta_topic (META_DEBUG_KEYBINDINGS,
"Keybindings %s\n", all_bindings_disabled ? "disabled" : "enabled");
}
+
+static void
+handle_run_terminal (MetaDisplay *display,
+ MetaScreen *screen,
+ MetaWindow *window,
+ XEvent *event,
+ MetaKeyBinding *binding)
+{
+ const char *command;
+ GError *err;
+
+ command = meta_prefs_get_terminal_command ();
+
+ if (command == NULL)
+ {
+ char *s;
+
+ meta_topic (META_DEBUG_KEYBINDINGS,
+ "No terminal command to run in response to "
+ "keybinding press\n");
+
+ s = g_strdup_printf (_("No terminal command has been defined.\n"));
+ error_on_command (-1, NULL, s, screen->screen_name, event->xkey.time);
+ g_free (s);
+
+ return;
+ }
+
+ err = NULL;
+ if (!meta_spawn_command_line_async_on_screen (command, screen, &err))
+ {
+ error_on_command (-1, command, err->message, screen->screen_name,
+ event->xkey.time);
+
+ g_error_free (err);
+ }
+}
diff --git a/src/core/screen-private.h b/src/core/screen-private.h
index ee014ff2..c1552ab0 100644
--- a/src/core/screen-private.h
+++ b/src/core/screen-private.h
@@ -85,6 +85,9 @@ struct _MetaScreen
MetaWorkspace *active_workspace;
+ /* Previous active workspace */
+ MetaWorkspace *prev_workspace;
+
/* This window holds the focus when we don't want to focus
* any actual clients
*/
diff --git a/src/core/workspace.c b/src/core/workspace.c
index 928f3de6..e2a397a0 100644
--- a/src/core/workspace.c
+++ b/src/core/workspace.c
@@ -389,6 +389,9 @@ meta_workspace_activate_with_focus (MetaWorkspace *workspace,
/* Note that old can be NULL; e.g. when starting up */
old = workspace->screen->active_workspace;
+ /* Save old workspace, to be able to switch back. */
+ workspace->screen->prev_workspace = old;
+
workspace->screen->active_workspace = workspace;
set_active_space_hint (workspace->screen);
@@ -807,6 +810,8 @@ meta_motion_direction_to_string (MetaMotionDirection direction)
return "Left";
case META_MOTION_RIGHT:
return "Right";
+ case META_MOTION_PREV:
+ return "Previous";
}
return "Unknown";
@@ -847,6 +852,8 @@ meta_workspace_get_neighbor (MetaWorkspace *workspace,
case META_MOTION_DOWN:
layout.current_row += 1;
break;
+ case META_MOTION_PREV:
+ break;
}
/* LEFT */
@@ -923,6 +930,8 @@ meta_workspace_get_neighbor (MetaWorkspace *workspace,
if (wrap == META_WRAP_TOROIDAL)
layout.current_col = layout.current_col < layout.cols - 1 ? layout.current_col + 1 : 0;
break;
+ case META_MOTION_PREV:
+ break;
}
i = layout.grid[layout.current_row * layout.cols + layout.current_col];
diff --git a/src/core/workspace.h b/src/core/workspace.h
index 40942e1a..4b52f96e 100644
--- a/src/core/workspace.h
+++ b/src/core/workspace.h
@@ -43,7 +43,8 @@ typedef enum
META_MOTION_UP = -1,
META_MOTION_DOWN = -2,
META_MOTION_LEFT = -3,
- META_MOTION_RIGHT = -4
+ META_MOTION_RIGHT = -4,
+ META_MOTION_PREV = -5
} MetaMotionDirection;
struct _MetaWorkspace
diff --git a/src/include/all-keybindings.h b/src/include/all-keybindings.h
index 5773a810..a26720a1 100644
--- a/src/include/all-keybindings.h
+++ b/src/include/all-keybindings.h
@@ -186,6 +186,8 @@ keybind (run-command-32, handle_run_command, 31, 0)
keybind (run-command-screenshot, handle_run_command, 32, 0)
keybind (run-command-window-screenshot, handle_run_command, 33, 0)
+keybind (run-command-terminal, handle_run_terminal, 0, 0)
+
/* No description because this is undocumented */
keybind (set-spew-mark, handle_set_spew_mark, 0, 0)
@@ -275,5 +277,8 @@ keybind (move-to-side-w, handle_move_to_side_w, 0,
keybind (move-to-center, handle_move_to_center, 0,
BINDING_PER_WINDOW)
+keybind (switch-to-workspace-prev, handle_switch_to_workspace,
+ META_MOTION_PREV, 0)
+
/* eof all-keybindings.h */
diff --git a/src/org.mate.marco.gschema.xml b/src/org.mate.marco.gschema.xml
index 6bd57811..0e24ab19 100644
--- a/src/org.mate.marco.gschema.xml
+++ b/src/org.mate.marco.gschema.xml
@@ -167,7 +167,7 @@
<description>Some applications disregard specifications in ways that result in window manager misfeatures. This option puts Marco in a rigorously correct mode, which gives a more consistent user interface, provided one does not need to run any misbehaving applications.</description>
</key>
<key name="center-new-windows" type="b">
- <default>true</default>
+ <default>false</default>
<summary>Determine if new windows are created on the center of the screen</summary>
<description>By default, marco open new windows on the top left of the screen. If this option is enabled, new windows are open on the center of the screen, instead.</description>
</key>
@@ -507,6 +507,11 @@
<summary>Switch to workspace below the current workspace</summary>
<description>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.</description>
</key>
+ <key name="switch-to-workspace-prev" type="s">
+ <default>'disabled'</default>
+ <summary>Switch to previously selected workspace</summary>
+ <description>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.</description>
+ </key>
<key name="switch-group" type="s">
<default>'disabled'</default>
<summary>Move between windows of an application, using a popup window</summary>
diff --git a/src/ui/tile-preview.c b/src/ui/tile-preview.c
index 6682de69..e14ffe25 100644
--- a/src/ui/tile-preview.c
+++ b/src/ui/tile-preview.c
@@ -69,13 +69,9 @@ meta_tile_preview_expose (GtkWidget *widget,
if (preview->has_alpha)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
- GdkRGBA preview_color = *preview->preview_color;
-#endif
-
/* Fill the preview area with a transparent color */
#if GTK_CHECK_VERSION (3, 0, 0)
- gdk_cairo_set_source_rgba (cr, &preview_color);
+ gdk_cairo_set_source_rgba (cr, preview->preview_color);
#else
cairo_set_source_rgba (cr,
(double)preview->preview_color->red / 0xFFFF,
@@ -89,7 +85,7 @@ meta_tile_preview_expose (GtkWidget *widget,
/* Use the opaque color for the border */
#if GTK_CHECK_VERSION (3, 0, 0)
- gdk_cairo_set_source_rgba (cr, &preview_color);
+ gdk_cairo_set_source_rgba (cr, preview->preview_color);
#else
gdk_cairo_set_source_color (cr, preview->preview_color);
#endif
@@ -117,6 +113,13 @@ meta_tile_preview_expose (GtkWidget *widget,
0.5, 0.5,
preview->tile_rect.width - 1,
preview->tile_rect.height - 1);
+
+#if GTK_CHECK_VERSION (3, 0, 0)
+ if (preview->has_alpha) {
+ cairo_fill_preserve (cr);
+ cairo_set_source_rgba (cr, preview->preview_color->red, preview->preview_color->green, preview->preview_color->blue, 1.0);
+ }
+#endif
cairo_stroke (cr);
#if !GTK_CHECK_VERSION (3, 0, 0)