summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2008-08-29 11:14:21 +0200
committerDanny Baumann <dannybaumann@web.de>2008-08-29 11:14:21 +0200
commitcac5e5220174bd3a41f9185279b606ccfded176a (patch)
tree86e5c48cc117448ea47049d4990b859e7a986e71
parent00020bc4b2d3c573c73d172416a91e0a0f6debba (diff)
downloadwinrules-cac5e5220174bd3a41f9185279b606ccfded176a.tar.gz
winrules-cac5e5220174bd3a41f9185279b606ccfded176a.tar.bz2
Added a match to open window maximized initially.
-rw-r--r--winrules.c35
-rw-r--r--winrules.xml.in5
2 files changed, 29 insertions, 11 deletions
diff --git a/winrules.c b/winrules.c
index 1330865..8f10998 100644
--- a/winrules.c
+++ b/winrules.c
@@ -36,17 +36,18 @@
#define WINRULES_SCREEN_OPTION_BELOW_MATCH 3
#define WINRULES_SCREEN_OPTION_STICKY_MATCH 4
#define WINRULES_SCREEN_OPTION_FULLSCREEN_MATCH 5
-#define WINRULES_SCREEN_OPTION_NOARGB_MATCH 6
-#define WINRULES_SCREEN_OPTION_NOMOVE_MATCH 7
-#define WINRULES_SCREEN_OPTION_NORESIZE_MATCH 8
-#define WINRULES_SCREEN_OPTION_NOMINIMIZE_MATCH 9
-#define WINRULES_SCREEN_OPTION_NOMAXIMIZE_MATCH 10
-#define WINRULES_SCREEN_OPTION_NOCLOSE_MATCH 11
-#define WINRULES_SCREEN_OPTION_NOFOCUS_MATCH 12
-#define WINRULES_SCREEN_OPTION_SIZE_MATCHES 13
-#define WINRULES_SCREEN_OPTION_SIZE_WIDTH_VALUES 14
-#define WINRULES_SCREEN_OPTION_SIZE_HEIGHT_VALUES 15
-#define WINRULES_SCREEN_OPTION_NUM 16
+#define WINRULES_SCREEN_OPTION_MAXIMIZE_MATCH 6
+#define WINRULES_SCREEN_OPTION_NOARGB_MATCH 7
+#define WINRULES_SCREEN_OPTION_NOMOVE_MATCH 8
+#define WINRULES_SCREEN_OPTION_NORESIZE_MATCH 9
+#define WINRULES_SCREEN_OPTION_NOMINIMIZE_MATCH 10
+#define WINRULES_SCREEN_OPTION_NOMAXIMIZE_MATCH 11
+#define WINRULES_SCREEN_OPTION_NOCLOSE_MATCH 12
+#define WINRULES_SCREEN_OPTION_NOFOCUS_MATCH 13
+#define WINRULES_SCREEN_OPTION_SIZE_MATCHES 14
+#define WINRULES_SCREEN_OPTION_SIZE_WIDTH_VALUES 15
+#define WINRULES_SCREEN_OPTION_SIZE_HEIGHT_VALUES 16
+#define WINRULES_SCREEN_OPTION_NUM 17
static CompMetadata winrulesMetadata;
@@ -373,6 +374,12 @@ winrulesSetScreenOption (CompPlugin *plugin,
updateStateMask = CompWindowStateFullscreenMask;
break;
+ case WINRULES_SCREEN_OPTION_MAXIMIZE_MATCH:
+ if (compSetMatchOption (o, value))
+ updateStateMask = CompWindowStateMaximizedHorzMask |
+ CompWindowStateMaximizedVertMask;
+ break;
+
case WINRULES_SCREEN_OPTION_NOMOVE_MATCH:
if (compSetMatchOption (o, value))
updateActionsMask = CompWindowActionMoveMask;
@@ -526,6 +533,11 @@ winrulesApplyRules (void *closure)
WINRULES_SCREEN_OPTION_FULLSCREEN_MATCH,
CompWindowStateFullscreenMask);
+ winrulesUpdateState (w,
+ WINRULES_SCREEN_OPTION_MAXIMIZE_MATCH,
+ CompWindowStateMaximizedHorzMask |
+ CompWindowStateMaximizedVertMask);
+
winrulesSetAllowedActions (w,
WINRULES_SCREEN_OPTION_NOMOVE_MATCH,
CompWindowActionMoveMask);
@@ -638,6 +650,7 @@ static const CompMetadataOptionInfo winrulesScreenOptionInfo[] = {
{ "below_match", "match", 0, 0, 0 },
{ "sticky_match", "match", 0, 0, 0 },
{ "fullscreen_match", "match", 0, 0, 0 },
+ { "maximize_match", "match", 0, 0, 0 },
{ "no_argb_match", "match", 0, 0, 0 },
{ "no_move_match", "match", 0, 0, 0 },
{ "no_resize_match", "match", 0, 0, 0 },
diff --git a/winrules.xml.in b/winrules.xml.in
index 5c9046f..89f3dc7 100644
--- a/winrules.xml.in
+++ b/winrules.xml.in
@@ -36,6 +36,11 @@
<_short>Fullscreen</_short>
<_long>Fullscreen windows</_long>
<default/>
+ </option>
+ <option name="maximize_match" type="match">
+ <_short>Maximized</_short>
+ <_long>Maximized windows</_long>
+ <default/>
</option>
<option name="no_argb_match" type="match">
<_short>No ARGB visuals</_short>