diff options
Diffstat (limited to 'src/core/screen.c')
-rw-r--r-- | src/core/screen.c | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/src/core/screen.c b/src/core/screen.c index 998bd6e4..bd3667e8 100644 --- a/src/core/screen.c +++ b/src/core/screen.c @@ -1476,6 +1476,7 @@ meta_screen_tile_preview_update_timeout (gpointer data) MetaScreen *screen = data; MetaWindow *window = screen->display->grab_window; gboolean composited = screen->display->compositor != NULL; + gboolean needs_preview = FALSE; screen->tile_preview_timeout_id = 0; @@ -1483,9 +1484,28 @@ meta_screen_tile_preview_update_timeout (gpointer data) screen->tile_preview = meta_tile_preview_new (screen->number, composited); - if (window - && !META_WINDOW_TILED (window) - && window->tile_mode != META_TILE_NONE) + if (window) + { + switch (window->tile_mode) + { + case META_TILE_LEFT: + case META_TILE_RIGHT: + if (!META_WINDOW_TILED (window)) + needs_preview = TRUE; + break; + + case META_TILE_MAXIMIZED: + if (!META_WINDOW_MAXIMIZED (window)) + needs_preview = TRUE; + break; + + default: + needs_preview = FALSE; + break; + } + } + + if (needs_preview) { MetaRectangle tile_rect; @@ -1523,6 +1543,16 @@ meta_screen_tile_preview_update (MetaScreen *screen, } } +void +meta_screen_tile_preview_hide (MetaScreen *screen) +{ + if (screen->tile_preview_timeout_id > 0) + g_source_remove (screen->tile_preview_timeout_id); + + if (screen->tile_preview) + meta_tile_preview_hide (screen->tile_preview); +} + MetaWindow* meta_screen_get_mouse_window (MetaScreen *screen, MetaWindow *not_this_one) |