Author: olivier
Date: 2008-05-19 18:24:11 +0000 (Mon, 19 May 2008)
New Revision: 26978
Modified:
xfwm4/branches/xfce_4_4/src/compositor.c
Log:
Make sure to count only the fullscreen overlays to be extra safe
Modified: xfwm4/branches/xfce_4_4/src/compositor.c
===================================================================
--- xfwm4/branches/xfce_4_4/src/compositor.c 2008-05-19 12:20:14 UTC (rev
26977)
+++ xfwm4/branches/xfce_4_4/src/compositor.c 2008-05-19 18:24:11 UTC (rev
26978)
@@ -77,8 +77,8 @@
#define WIN_IS_NATIVE_OPAQUE(cw) ((cw->native_opacity) &&
!WIN_IS_ARGB(cw))
#define WIN_IS_FULLSCREEN(cw) ((cw->attr.x <= 0) && \
(cw->attr.y <= 0) && \
- (cw->attr.width >=
cw->screen_info->width) && \
- (cw->attr.height >=
cw->screen_info->height))
+ (cw->attr.width + 2 *
cw->attr.border_width >= cw->screen_info->width) && \
+ (cw->attr.height + 2 *
cw->attr.border_width >= cw->screen_info->height))
#define WIN_IS_SHAPED(cw) ((WIN_HAS_CLIENT(cw) && FLAG_TEST
(cw->c->flags, CLIENT_FLAG_HAS_SHAPE)) || \
(WIN_IS_OVERRIDE(cw) &&
(cw->shaped)))
#define WIN_IS_VIEWABLE(cw) (cw->viewable)
@@ -101,6 +101,7 @@
gboolean viewable;
gboolean shaped;
gboolean redirected;
+ gboolean fulloverlay;
gboolean argb;
gboolean skipped;
gboolean native_opacity;
@@ -1764,8 +1765,19 @@
if (!WIN_IS_REDIRECTED(cw))
{
- screen_info->wins_unredirected++;
- TRACE ("Mapping unredirected window 0x%lx, wins_unredirected increased
to %i", cw->id, screen_info->wins_unredirected);
+ cw->fulloverlay = WIN_IS_FULLSCREEN(cw);
+ if (cw->fulloverlay)
+ {
+ /*
+ * To be safe, we only count the fullscreen un-redirected windows.
+ * We do not want a smaller override redirect such as a tooltip
+ * for example to prevent the overlay to be remapped and leave
+ * a black screen until the tooltip is unmapped...
+ */
+ screen_info->wins_unredirected++;
+ TRACE ("Mapping fullscreen window 0x%lx, wins_unredirected
increased to %i", cw->id, screen_info->wins_unredirected);
+ }
+ TRACE ("Mapping unredirected window 0x%lx, wins_unredirected is now
%i", cw->id, screen_info->wins_unredirected);
#if HAVE_OVERLAYS
if ((screen_info->wins_unredirected == 1) &&
(display_info->have_overlays))
{
@@ -1797,7 +1809,7 @@
if (cw == top)
{
- TRACE ("Toplevel window 0x%lx is fullscreen, unredirecting",
cw->id);
+ TRACE ("Unredirecting toplevel window 0x%lx", cw->id);
unredirect_win (cw);
}
}
@@ -1817,8 +1829,12 @@
if (!WIN_IS_REDIRECTED(cw) && (screen_info->wins_unredirected > 0))
{
- screen_info->wins_unredirected--;
- TRACE ("Unmapped window 0x%lx, wins_unredirected decreased to %i",
cw->id, screen_info->wins_unredirected);
+ if (cw->fulloverlay)
+ {
+ screen_info->wins_unredirected--;
+ TRACE ("Unmapping fullscreen window 0x%lx, wins_unredirected
decreased to %i", cw->id, screen_info->wins_unredirected);
+ }
+ TRACE ("Unmapped window 0x%lx, wins_unredirected is now %i", cw->id,
screen_info->wins_unredirected);
if (!screen_info->wins_unredirected)
{
/* Restore the overlay if that was the last unredirected window */
@@ -1841,6 +1857,7 @@
cw->viewable = FALSE;
cw->damaged = FALSE;
cw->redirected = TRUE;
+ cw->fulloverlay = FALSE;
free_win_data (cw, FALSE);
}
@@ -1940,6 +1957,7 @@
new->id = id;
new->damaged = FALSE;
new->redirected = TRUE;
+ new->fulloverlay = FALSE;
new->shaped = is_shaped (display_info, id);
new->viewable = (new->attr.map_state == IsViewable);
_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits