[Xfce4-commits] [xfce/xfwm4] 01/05: compositor: Check if window pixmap are available
noreply at xfce.org
noreply at xfce.org
Sat Jan 24 22:41:05 CET 2015
This is an automated email from the git hooks/post-receive script.
olivier pushed a commit to branch master
in repository xfce/xfwm4.
commit f0869d25e23436a91612c7885206d87a3c2e9cea
Author: Olivier Fourdan <fourdan at xfce.org>
Date: Sat Jan 24 21:21:10 2015 +0100
compositor: Check if window pixmap are available
Add new API to check if window pixmaps are available.
Signed-off-by: Olivier Fourdan <fourdan at xfce.org>
---
src/compositor.c | 37 +++++++++++++++++++++++++++----------
src/compositor.h | 3 ++-
2 files changed, 29 insertions(+), 11 deletions(-)
diff --git a/src/compositor.c b/src/compositor.c
index c047ac6..8aafa30 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -2876,9 +2876,8 @@ compositorIsUsable (DisplayInfo *display_info)
return FALSE;
}
return TRUE;
-#else
- return FALSE;
#endif /* HAVE_COMPOSITOR */
+ return FALSE;
}
void
@@ -2994,6 +2993,29 @@ compositorResizeWindow (DisplayInfo *display_info, Window id, int x, int y, int
#endif /* HAVE_COMPOSITOR */
}
+gboolean
+compositorWindowPixmapAvailable (ScreenInfo *screen_info)
+{
+#ifdef HAVE_NAME_WINDOW_PIXMAP
+#ifdef HAVE_COMPOSITOR
+ if (!screen_info->compositor_active)
+ {
+ return FALSE;
+ }
+ if (!compositorIsUsable (screen_info->display_info))
+ {
+ return FALSE;
+ }
+ else if (!screen_info->display_info->have_name_window_pixmap)
+ {
+ return FALSE;
+ }
+ return TRUE;
+#endif /* HAVE_COMPOSITOR */
+#endif /* HAVE_NAME_WINDOW_PIXMAP */
+ return FALSE;
+}
+
/* May return None if:
* - The xserver does not support name window pixmaps
* - The compositor is disabled at run time
@@ -3002,7 +3024,7 @@ compositorResizeWindow (DisplayInfo *display_info, Window id, int x, int y, int
* if the window is unmapped.
*/
Pixmap
-compositorGetWindowPixmap (DisplayInfo *display_info, Window id)
+compositorGetWindowPixmap (ScreenInfo *screen_info, Window id)
{
#ifdef HAVE_NAME_WINDOW_PIXMAP
#ifdef HAVE_COMPOSITOR
@@ -3011,17 +3033,12 @@ compositorGetWindowPixmap (DisplayInfo *display_info, Window id)
g_return_val_if_fail (id != None, None);
TRACE ("entering compositorGetPixmap: 0x%lx", id);
- if (!compositorIsUsable (display_info))
+ if (!compositorWindowPixmapAvailable (screen_info))
{
return None;
}
- if (!display_info->have_name_window_pixmap)
- {
- return None;
- }
-
- cw = find_cwindow_in_display (display_info, id);
+ cw = find_cwindow_in_screen (screen_info, id);
if (cw)
{
if (cw->name_window_pixmap != None)
diff --git a/src/compositor.h b/src/compositor.h
index 91a2b39..b5818ea 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -51,7 +51,8 @@ void compositorResizeWindow (DisplayInfo *,
int,
int,
int);
-Pixmap compositorGetWindowPixmap (DisplayInfo *,
+gboolean compositorWindowPixmapAvailable (ScreenInfo *);
+Pixmap compositorGetWindowPixmap (ScreenInfo *,
Window);
void compositorHandleEvent (DisplayInfo *,
XEvent *);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list