diff options
Diffstat (limited to 'src/core/keybindings.c')
-rw-r--r-- | src/core/keybindings.c | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/src/core/keybindings.c b/src/core/keybindings.c index 821d432a..068199b8 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -2329,7 +2329,7 @@ static void error_on_command (int command_index, const char *command, const char *message, - int screen_number, + const char *screen_name, guint32 timestamp) { if (command_index < 0) @@ -2358,7 +2358,7 @@ error_on_command (int command_index, meta_show_dialog ("--error", text, NULL, - screen_number, + screen_name, NULL, NULL, 0, NULL, NULL); @@ -2370,7 +2370,7 @@ error_on_command (int command_index, meta_show_dialog ("--error", message, NULL, - screen_number, + screen_name, NULL, NULL, 0, NULL, NULL); } @@ -2441,7 +2441,7 @@ handle_run_command (MetaDisplay *display, s = g_strdup_printf (_("No command %d has been defined.\n"), which + 1); - error_on_command (which, NULL, s, screen->number, event->xkey.time); + error_on_command (which, NULL, s, screen->screen_name, event->xkey.time); g_free (s); return; @@ -2450,7 +2450,7 @@ handle_run_command (MetaDisplay *display, err = NULL; if (!meta_spawn_command_line_async_on_screen (command, screen, &err)) { - error_on_command (which, command, err->message, screen->number, event->xkey.time); + error_on_command (which, command, err->message, screen->screen_name, event->xkey.time); g_error_free (err); } @@ -3058,7 +3058,6 @@ handle_toggle_above (MetaDisplay *display, meta_window_make_above (window); } -/* TODO: actually use this keybinding, without messing up the existing keybinding schema */ static void handle_toggle_tiled (MetaDisplay *display, MetaScreen *screen, @@ -3071,14 +3070,20 @@ handle_toggle_tiled (MetaDisplay *display, if ((META_WINDOW_TILED_LEFT (window) && mode == META_TILE_LEFT) || (META_WINDOW_TILED_RIGHT (window) && mode == META_TILE_RIGHT)) { - window->tile_mode = META_TILE_NONE; - if (window->saved_maximize) - meta_window_maximize (window, META_MAXIMIZE_VERTICAL | - META_MAXIMIZE_HORIZONTAL); - else - meta_window_unmaximize (window, META_MAXIMIZE_VERTICAL | + { + window->tile_mode = META_TILE_MAXIMIZED; + window->tile_monitor_number = meta_screen_get_xinerama_for_window (window->screen, window)->number; + meta_window_maximize (window, META_MAXIMIZE_VERTICAL | META_MAXIMIZE_HORIZONTAL); + } + else + { + window->tile_mode = META_TILE_NONE; + window->tile_monitor_number = -1; + meta_window_unmaximize (window, META_MAXIMIZE_VERTICAL | + META_MAXIMIZE_HORIZONTAL); + } } else if (meta_window_can_tile (window)) { @@ -3090,6 +3095,13 @@ handle_toggle_tiled (MetaDisplay *display, * we just set the flag and rely on meta_window_tile() syncing it to * save an additional roundtrip. */ + + /* If we skip meta_window_unmaximize we have to manually reset the + * window->saved_maximize flag. + */ + if (!META_WINDOW_MAXIMIZED (window)) + window->saved_maximize = FALSE; + window->maximized_horizontally = FALSE; meta_window_tile (window); } @@ -3439,7 +3451,7 @@ handle_run_terminal (MetaDisplay *display, "keybinding press\n"); s = g_strdup_printf (_("No terminal command has been defined.\n")); - error_on_command (-1, NULL, s, screen->number, event->xkey.time); + error_on_command (-1, NULL, s, screen->screen_name, event->xkey.time); g_free (s); return; @@ -3448,7 +3460,7 @@ handle_run_terminal (MetaDisplay *display, err = NULL; if (!meta_spawn_command_line_async_on_screen (command, screen, &err)) { - error_on_command (-1, command, err->message, screen->number, + error_on_command (-1, command, err->message, screen->screen_name, event->xkey.time); g_error_free (err); |