summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2007-09-14 11:35:52 +0200
committerDanny Baumann <dannybaumann@web.de>2007-09-14 11:35:52 +0200
commite2df962ef16849c371a281035f443b2e1d09d6ef (patch)
tree79bd2236f77b15250c81c83bc85049737c3e0c4b
parentddea8b07cf3046e2bb72dd5bc5161a6d24ef9f16 (diff)
downloadworkarounds-e2df962ef16849c371a281035f443b2e1d09d6ef.tar.gz
workarounds-e2df962ef16849c371a281035f443b2e1d09d6ef.tar.bz2
Add fullscreen as allowed action for windows that actually _are_ fullscreen and just have their minimum size set to the same value as the maximum size.
-rw-r--r--workarounds.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/workarounds.c b/workarounds.c
index b486585..b27e087 100644
--- a/workarounds.c
+++ b/workarounds.c
@@ -40,7 +40,8 @@ typedef struct _WorkaroundsDisplay {
typedef struct _WorkaroundsScreen {
int windowPrivateIndex;
- WindowResizeNotifyProc windowResizeNotify;
+ WindowResizeNotifyProc windowResizeNotify;
+ GetAllowedActionsForWindowProc getAllowedActionsForWindow;
} WorkaroundsScreen;
typedef struct _WorkaroundsWindow {
@@ -48,6 +49,7 @@ typedef struct _WorkaroundsWindow {
Bool adjustedWinType;
Bool madeSticky;
+ Bool isFullscreen;
} WorkaroundsWindow;
#define GET_WORKAROUNDS_DISPLAY(d) \
@@ -139,12 +141,33 @@ workaroundsUpdateSticky (CompWindow *w)
}
static void
+workaroundsGetAllowedActionsForWindow (CompWindow *w,
+ unsigned int *setActions,
+ unsigned int *clearActions)
+{
+ CompScreen *s = w->screen;
+
+ WORKAROUNDS_SCREEN (s);
+ WORKAROUNDS_WINDOW (w);
+
+ UNWRAP (ws, s, getAllowedActionsForWindow);
+ (*s->getAllowedActionsForWindow) (w, setActions, clearActions);
+ WRAP (ws, s, getAllowedActionsForWindow,
+ workaroundsGetAllowedActionsForWindow);
+
+ if (ww->isFullscreen)
+ *setActions |= CompWindowActionFullscreenMask;
+}
+
+static void
workaroundsFixupFullscreen (CompWindow *w)
{
Bool isFullSize;
int output;
BoxPtr box;
+ WORKAROUNDS_WINDOW (w);
+
if (w->type & CompWindowTypeDesktopMask)
return;
@@ -168,6 +191,7 @@ workaroundsFixupFullscreen (CompWindow *w)
}
}
+ ww->isFullscreen = isFullSize;
if ((isFullSize && !(w->state & CompWindowStateFullscreenMask)) ||
(!isFullSize && (w->state & CompWindowStateFullscreenMask)))
{
@@ -418,6 +442,8 @@ workaroundsInitScreen (CompPlugin *plugin, CompScreen *s)
}
WRAP (ws, s, windowResizeNotify, workaroundsWindowResizeNotify);
+ WRAP (ws, s, getAllowedActionsForWindow,
+ workaroundsGetAllowedActionsForWindow);
s->base.privates[wd->screenPrivateIndex].ptr = ws;
@@ -432,6 +458,7 @@ workaroundsFiniScreen (CompPlugin *plugin, CompScreen *s)
freeWindowPrivateIndex (s, ws->windowPrivateIndex);
UNWRAP (ws, s, windowResizeNotify);
+ UNWRAP (ws, s, getAllowedActionsForWindow);
free (ws);
}
@@ -449,6 +476,7 @@ workaroundsInitWindow (CompPlugin *plugin, CompWindow *w)
ww->madeSticky = FALSE;
ww->adjustedWinType = FALSE;
+ ww->isFullscreen = FALSE;
w->base.privates[ws->windowPrivateIndex].ptr = ww;