summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDenis Gorodnichev <[email protected]>2015-01-07 15:13:43 +0300
committerinfirit <[email protected]>2015-01-14 19:06:47 +0100
commitbe94f8e1788788920c7473ecefe2ee28526f8388 (patch)
treeb985efd7bff5c608bbd4251e4864f78261e1fcda /src
parent3e695af4ef435949d9a1f13c6de17bb005406250 (diff)
downloadmarco-be94f8e1788788920c7473ecefe2ee28526f8388.tar.bz2
marco-be94f8e1788788920c7473ecefe2ee28526f8388.tar.xz
show tile preview with external compositor
Diffstat (limited to 'src')
-rw-r--r--src/core/screen.c4
-rw-r--r--src/include/tile-preview.h5
-rw-r--r--src/ui/tile-preview.c7
3 files changed, 6 insertions, 10 deletions
diff --git a/src/core/screen.c b/src/core/screen.c
index bd3667e8..6c555126 100644
--- a/src/core/screen.c
+++ b/src/core/screen.c
@@ -1475,14 +1475,12 @@ 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;
if (!screen->tile_preview)
- screen->tile_preview = meta_tile_preview_new (screen->number,
- composited);
+ screen->tile_preview = meta_tile_preview_new (screen->number);
if (window)
{
diff --git a/src/include/tile-preview.h b/src/include/tile-preview.h
index b0ca3b01..88af4f49 100644
--- a/src/include/tile-preview.h
+++ b/src/include/tile-preview.h
@@ -27,11 +27,10 @@
typedef struct _MetaTilePreview MetaTilePreview;
-MetaTilePreview *meta_tile_preview_new (int screen_number,
- gboolean composited);
+MetaTilePreview *meta_tile_preview_new (int screen_number);
void meta_tile_preview_free (MetaTilePreview *preview);
void meta_tile_preview_show (MetaTilePreview *preview,
MetaRectangle *rect);
void meta_tile_preview_hide (MetaTilePreview *preview);
-#endif /* META_TILE_PREVIEW_H */ \ No newline at end of file
+#endif /* META_TILE_PREVIEW_H */
diff --git a/src/ui/tile-preview.c b/src/ui/tile-preview.c
index 71b2e297..75eba055 100644
--- a/src/ui/tile-preview.c
+++ b/src/ui/tile-preview.c
@@ -177,8 +177,7 @@ on_preview_window_style_set (GtkWidget *widget,
}
MetaTilePreview *
-meta_tile_preview_new (int screen_number,
- gboolean composited)
+meta_tile_preview_new (int screen_number)
{
MetaTilePreview *preview;
#if !GTK_CHECK_VERSION (3, 0, 0)
@@ -207,9 +206,9 @@ meta_tile_preview_new (int screen_number,
preview->tile_rect.width = preview->tile_rect.height = 0;
#if GTK_CHECK_VERSION (3, 0, 0)
- preview->has_alpha = composited && (gdk_screen_get_rgba_visual (screen) != NULL);
+ preview->has_alpha = gdk_screen_is_composited (screen) && (gdk_screen_get_rgba_visual (screen) != NULL);
#else
- preview->has_alpha = rgba_colormap && composited;
+ preview->has_alpha = rgba_colormap && gdk_screen_is_composited (screen);
#endif
if (preview->has_alpha)