summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2007-09-17 09:31:07 +0200
committerDanny Baumann <dannybaumann@web.de>2007-09-17 09:31:07 +0200
commit915f07e1f9b5993630f6daa9b4bf10eb24e3d781 (patch)
tree3459a031c7be4971c73b81fa58667cd4f2d1a388
parent63c5f37fbfd487d250a8f93af40ca520ab77dd16 (diff)
downloadwinrules-915f07e1f9b5993630f6daa9b4bf10eb24e3d781.tar.gz
winrules-915f07e1f9b5993630f6daa9b4bf10eb24e3d781.tar.bz2
Simplification. It should be sufficient to allocate the protocols on the stack.
-rw-r--r--winrules.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/winrules.c b/winrules.c
index ce16134..99c4060 100644
--- a/winrules.c
+++ b/winrules.c
@@ -102,35 +102,19 @@ winrulesSetProtocols (CompDisplay *display,
unsigned int protocols,
Window id)
{
- Atom *protocol = NULL;
+ Atom protocol[4];
int count = 0;
if (protocols & CompWindowProtocolDeleteMask)
- {
- protocol = realloc (protocol, (count + 1) * sizeof(Atom));
protocol[count++] = display->wmDeleteWindowAtom;
- }
if (protocols & CompWindowProtocolTakeFocusMask)
- {
- protocol = realloc (protocol, (count + 1) * sizeof(Atom));
protocol[count++] = display->wmTakeFocusAtom;
- }
if (protocols & CompWindowProtocolPingMask)
- {
- protocol = realloc (protocol, (count + 1) * sizeof(Atom));
protocol[count++] = display->wmPingAtom;
- }
if (protocols & CompWindowProtocolSyncRequestMask)
- {
- protocol = realloc (protocol, (count + 1) * sizeof(Atom));
- protocol[count] = display->wmSyncRequestAtom;
- }
- XSetWMProtocols (display->display,
- id,
- protocol,
- count);
+ protocol[count++] = display->wmSyncRequestAtom;
- XFree (protocol);
+ XSetWMProtocols (display->display, id, protocol, count);
}
/* FIXME? Directly set inputHint, not a problem for now */