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 041d96fc..9e602a91 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -2321,7 +2321,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) @@ -2350,7 +2350,7 @@ error_on_command (int command_index, meta_show_dialog ("--error", text, NULL, - screen_number, + screen_name, NULL, NULL, 0, NULL, NULL); @@ -2362,7 +2362,7 @@ error_on_command (int command_index, meta_show_dialog ("--error", message, NULL, - screen_number, + screen_name, NULL, NULL, 0, NULL, NULL); } @@ -2433,7 +2433,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; @@ -2442,7 +2442,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); } @@ -3050,7 +3050,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, @@ -3063,14 +3062,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)) { @@ -3082,6 +3087,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); } @@ -3431,7 +3443,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; @@ -3440,7 +3452,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); |