diff options
author | infirit <[email protected]> | 2014-10-24 21:59:58 +0200 |
---|---|---|
committer | infirit <[email protected]> | 2014-10-27 12:29:24 +0100 |
commit | bec068ef5ddc73f23ffd6298122bf818fd4d2084 (patch) | |
tree | d7db4682b85c601d069de72cf76dda77b8a5e8dc /src/core/screen.c | |
parent | f814451acc48aec6d2fa1c217468f74e57a84340 (diff) | |
download | marco-bec068ef5ddc73f23ffd6298122bf818fd4d2084.tar.bz2 marco-bec068ef5ddc73f23ffd6298122bf818fd4d2084.tar.xz |
Rework tiling code based off Consortium
Taken from
https://github.com/SolusOS-discontinued/consortium/commit/b463e03f5bdeab307ceee6b969c681f29537c76d
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) |