summaryrefslogtreecommitdiff
path: root/src/screen.cpp
diff options
context:
space:
mode:
authorangel <angel@heaven.net>2010-07-29 18:31:46 +0300
committerangel <angel@heaven.net>2010-07-29 18:31:46 +0300
commita16fa16b718c57903033e534503e55cb21faaf11 (patch)
tree876b0f6c2fb9a1413dea5998ecd1a18180de9844 /src/screen.cpp
parent3cb3e313a9a24685a85d3004b845908a103259b4 (diff)
downloadzcomp-a16fa16b718c57903033e534503e55cb21faaf11.tar.gz
zcomp-a16fa16b718c57903033e534503e55cb21faaf11.tar.bz2
added --zcomp flag to disable wm, fixed border width calculation
Diffstat (limited to 'src/screen.cpp')
-rw-r--r--src/screen.cpp40
1 files changed, 29 insertions, 11 deletions
diff --git a/src/screen.cpp b/src/screen.cpp
index 86ca65a..aad1411 100644
--- a/src/screen.cpp
+++ b/src/screen.cpp
@@ -1191,6 +1191,9 @@ void
PrivateScreen::setWmState (int state, Window id)
{
unsigned long data[2];
+
+ if (zcomp)
+ return;
data[0] = state;
data[1] = None;
@@ -1291,11 +1294,15 @@ PrivateScreen::getWindowState (Window id)
return state;
}
+
void
PrivateScreen::setWindowState (unsigned int state, Window id)
{
Atom data[32];
int i = 0;
+
+ if (zcomp)
+ return;
if (state & CompWindowStateModalMask)
data[i++] = Atoms::winStateModal;
@@ -4100,6 +4107,7 @@ CompScreen::init (const char *name)
unsigned int nchildren;
int defaultDepth, nvisinfo;
XSetWindowAttributes attrib;
+ int inputMask;
CompOption::Value::Vector vList;
@@ -4196,6 +4204,11 @@ CompScreen::init (const char *name)
wmSnAtom = XInternAtom (dpy, buf, 0);
currentWmSnOwner = XGetSelectionOwner (dpy, wmSnAtom);
+
+ root = XRootWindow (dpy, DefaultScreen (dpy));
+
+ if (zcomp)
+ goto select_input;
if (currentWmSnOwner != None)
{
@@ -4214,8 +4227,6 @@ CompScreen::init (const char *name)
XSelectInput (dpy, currentWmSnOwner, StructureNotifyMask);
}
- root = XRootWindow (dpy, DefaultScreen (dpy));
-
attr.override_redirect = true;
attr.event_mask = PropertyChangeMask;
#define PACKAGE "compiz_aaaaaaaaaaaaaaaaa"
@@ -4268,24 +4279,31 @@ CompScreen::init (const char *name)
XWindowEvent (dpy, currentWmSnOwner, StructureNotifyMask, &event);
} while (event.type != DestroyNotify);
}
+
+select_input:
CompScreen::checkForError (dpy);
XGrabServer (dpy);
-
- XSelectInput (dpy, root,
- SubstructureRedirectMask |
- SubstructureNotifyMask |
+
+ inputMask = SubstructureNotifyMask |
StructureNotifyMask |
PropertyChangeMask |
LeaveWindowMask |
EnterWindowMask |
- KeyPressMask |
- KeyReleaseMask |
- ButtonPressMask |
- ButtonReleaseMask |
FocusChangeMask |
- ExposureMask);
+ ExposureMask;
+
+ if (!zcomp)
+ {
+ inputMask |= SubstructureRedirectMask;
+ inputMask |= KeyPressMask;
+ inputMask |= KeyReleaseMask;
+ inputMask |= ButtonPressMask;
+ inputMask |= ButtonReleaseMask;
+ }
+
+ XSelectInput (dpy, root, inputMask);
if (CompScreen::checkForError (dpy))
{