summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAbdiel Janulgue <abdiel.janulgue@nokia.com>2010-07-21 01:08:23 +0300
committerAbdiel Janulgue <abdiel.janulgue@nokia.com>2010-07-21 01:08:23 +0300
commitf5007f30eb96a256b5ef0b2a13473e01d1b33f8e (patch)
tree95dea31d4fddf4dc5dacf97839d38b81d0b491a1 /tests
parentea02111b212af964e7d67ae4cb30d09367c1afcf (diff)
Changes: merged merge req#9 with improvements and conflict resolution
RevBy: TrustMe
Diffstat (limited to 'tests')
-rwxr-xr-xtests/functional/test1.py3
-rwxr-xr-xtests/functional/test10.py3
-rwxr-xr-xtests/functional/test11.py3
-rwxr-xr-xtests/functional/test12.py3
-rwxr-xr-xtests/functional/test13.py3
-rwxr-xr-xtests/functional/test14.py3
-rwxr-xr-xtests/functional/test15.py3
-rwxr-xr-xtests/functional/test2.py3
-rwxr-xr-xtests/functional/test3.py3
-rwxr-xr-xtests/functional/test4.py3
-rwxr-xr-xtests/functional/test5.py3
-rwxr-xr-xtests/functional/test6.py3
-rwxr-xr-xtests/functional/test7.py3
-rwxr-xr-xtests/functional/test8.py3
-rwxr-xr-xtests/functional/test9.py3
-rw-r--r--tests/windowctl/windowctl.cpp30
16 files changed, 70 insertions, 5 deletions
diff --git a/tests/functional/test1.py b/tests/functional/test1.py
index 8eed625..344c1ba 100755
--- a/tests/functional/test1.py
+++ b/tests/functional/test1.py
@@ -10,6 +10,9 @@
import os, re, sys, time
+if os.system('/sbin/mcetool --unblank-screen --set-inhibit-mode=stay-on'):
+ print 'mcetool is missing!'
+
if os.system('pidof mcompositor'):
print 'mcompositor is not running'
sys.exit(1)
diff --git a/tests/functional/test10.py b/tests/functional/test10.py
index 7b7da05..9e3a7ca 100755
--- a/tests/functional/test10.py
+++ b/tests/functional/test10.py
@@ -14,6 +14,9 @@
import os, re, sys, time
+if os.system('/sbin/mcetool --unblank-screen --set-inhibit-mode=stay-on'):
+ print 'mcetool is missing!'
+
if os.system('pidof mcompositor'):
print 'mcompositor is not running'
sys.exit(1)
diff --git a/tests/functional/test11.py b/tests/functional/test11.py
index 93948bb..1b476e4 100755
--- a/tests/functional/test11.py
+++ b/tests/functional/test11.py
@@ -13,6 +13,9 @@
import os, re, sys, time
+if os.system('/sbin/mcetool --unblank-screen --set-inhibit-mode=stay-on'):
+ print 'mcetool is missing!'
+
if os.system('pidof mcompositor'):
print 'mcompositor is not running'
sys.exit(1)
diff --git a/tests/functional/test12.py b/tests/functional/test12.py
index 74b83f3..fdbda93 100755
--- a/tests/functional/test12.py
+++ b/tests/functional/test12.py
@@ -15,6 +15,9 @@
import os, re, sys, time
+if os.system('/sbin/mcetool --unblank-screen --set-inhibit-mode=stay-on'):
+ print 'mcetool is missing!'
+
if os.system('pidof mcompositor'):
print 'mcompositor is not running'
sys.exit(1)
diff --git a/tests/functional/test13.py b/tests/functional/test13.py
index 0a08995..607e4ef 100755
--- a/tests/functional/test13.py
+++ b/tests/functional/test13.py
@@ -10,6 +10,9 @@
import os, re, sys, time
+if os.system('/sbin/mcetool --unblank-screen --set-inhibit-mode=stay-on'):
+ print 'mcetool is missing!'
+
if os.system('pidof mcompositor'):
print 'mcompositor is not running'
sys.exit(1)
diff --git a/tests/functional/test14.py b/tests/functional/test14.py
index 9549c0c..8f003ab 100755
--- a/tests/functional/test14.py
+++ b/tests/functional/test14.py
@@ -11,6 +11,9 @@
import os, re, sys, time
+if os.system('/sbin/mcetool --unblank-screen --set-inhibit-mode=stay-on'):
+ print 'mcetool is missing!'
+
if os.system('pidof mcompositor'):
print 'mcompositor is not running'
sys.exit(1)
diff --git a/tests/functional/test15.py b/tests/functional/test15.py
index bd41c69..d9b3ecf 100755
--- a/tests/functional/test15.py
+++ b/tests/functional/test15.py
@@ -17,6 +17,9 @@
import os, re, sys, time
+if os.system('/sbin/mcetool --unblank-screen --set-inhibit-mode=stay-on'):
+ print 'mcetool is missing!'
+
if os.system('pidof mcompositor'):
print 'mcompositor is not running'
sys.exit(1)
diff --git a/tests/functional/test2.py b/tests/functional/test2.py
index 8c7e28b..9ca8ae6 100755
--- a/tests/functional/test2.py
+++ b/tests/functional/test2.py
@@ -10,6 +10,9 @@
import os, re, sys, time
+if os.system('/sbin/mcetool --unblank-screen --set-inhibit-mode=stay-on'):
+ print 'mcetool is missing!'
+
if os.system('pidof mcompositor'):
print 'mcompositor is not running'
sys.exit(1)
diff --git a/tests/functional/test3.py b/tests/functional/test3.py
index 394b2be..4f87487 100755
--- a/tests/functional/test3.py
+++ b/tests/functional/test3.py
@@ -10,6 +10,9 @@
import os, re, sys, time
+if os.system('/sbin/mcetool --unblank-screen --set-inhibit-mode=stay-on'):
+ print 'mcetool is missing!'
+
if os.system('pidof mcompositor'):
print 'mcompositor is not running'
sys.exit(1)
diff --git a/tests/functional/test4.py b/tests/functional/test4.py
index 8396f85..bfbf1af 100755
--- a/tests/functional/test4.py
+++ b/tests/functional/test4.py
@@ -10,6 +10,9 @@
import os, re, sys, time
+if os.system('/sbin/mcetool --unblank-screen --set-inhibit-mode=stay-on'):
+ print 'mcetool is missing!'
+
if os.system('pidof mcompositor'):
print 'mcompositor is not running'
sys.exit(1)
diff --git a/tests/functional/test5.py b/tests/functional/test5.py
index 1ac701c..86e4e9e 100755
--- a/tests/functional/test5.py
+++ b/tests/functional/test5.py
@@ -11,6 +11,9 @@
import os, re, sys, time
+if os.system('/sbin/mcetool --unblank-screen --set-inhibit-mode=stay-on'):
+ print 'mcetool is missing!'
+
if os.system('pidof mcompositor'):
print 'mcompositor is not running'
sys.exit(1)
diff --git a/tests/functional/test6.py b/tests/functional/test6.py
index c2305a7..18a030b 100755
--- a/tests/functional/test6.py
+++ b/tests/functional/test6.py
@@ -12,6 +12,9 @@
import os, re, sys, time
+if os.system('/sbin/mcetool --unblank-screen --set-inhibit-mode=stay-on'):
+ print 'mcetool is missing!'
+
if os.system('pidof mcompositor'):
print 'mcompositor is not running'
sys.exit(1)
diff --git a/tests/functional/test7.py b/tests/functional/test7.py
index e37b524..983bc49 100755
--- a/tests/functional/test7.py
+++ b/tests/functional/test7.py
@@ -14,6 +14,9 @@
import os, re, sys, time
+if os.system('/sbin/mcetool --unblank-screen --set-inhibit-mode=stay-on'):
+ print 'mcetool is missing!'
+
if os.system('pidof mcompositor'):
print 'mcompositor is not running'
sys.exit(1)
diff --git a/tests/functional/test8.py b/tests/functional/test8.py
index 8bd8615..fc99b1b 100755
--- a/tests/functional/test8.py
+++ b/tests/functional/test8.py
@@ -13,6 +13,9 @@
import os, re, sys, time
+if os.system('/sbin/mcetool --unblank-screen --set-inhibit-mode=stay-on'):
+ print 'mcetool is missing!'
+
if os.system('pidof mcompositor'):
print 'mcompositor is not running'
sys.exit(1)
diff --git a/tests/functional/test9.py b/tests/functional/test9.py
index cefd56c..54ed4eb 100755
--- a/tests/functional/test9.py
+++ b/tests/functional/test9.py
@@ -13,6 +13,9 @@
import os, re, sys, time
+if os.system('/sbin/mcetool --unblank-screen --set-inhibit-mode=stay-on'):
+ print 'mcetool is missing!'
+
if os.system('pidof mcompositor'):
print 'mcompositor is not running'
sys.exit(1)
diff --git a/tests/windowctl/windowctl.cpp b/tests/windowctl/windowctl.cpp
index 992cd5f..b4d3ad6 100644
--- a/tests/windowctl/windowctl.cpp
+++ b/tests/windowctl/windowctl.cpp
@@ -18,6 +18,7 @@
#include <unistd.h>
#include <X11/extensions/Xrender.h>
#include <X11/extensions/Xdamage.h>
+#include <X11/extensions/shape.h>
#include <signal.h>
#include <sys/prctl.h>
@@ -169,6 +170,14 @@ static void set_decorator_buttons (Display *dpy, Window w)
XSync(dpy, False);
}
+static void set_shaped (Display *dpy, Window w)
+{
+ XRectangle rect = {250, 120, 300, 200};
+ XShapeCombineRectangles(dpy, w, ShapeBounding, 0, 0, &rect, 1,
+ ShapeSet, Unsorted);
+ XSync(dpy, False);
+}
+
static void activate_window (Display *dpy, Window window)
{
XClientMessageEvent xclient;
@@ -299,19 +308,20 @@ static void wait_for_mapnotify(Display *dpy, Window w)
static void print_usage_and_exit(QString& stdOut)
{
#define PROG "windowctl"
- stdOut = "Usage 1: " PROG " [afoemk](n|d|i|b) [transient for <XID>]\n"
+ stdOut = "Usage 1: " PROG " [afoemks](n|d|i|b) [transient for <XID>]\n"
"a - ARGB (32-bit) window, otherwise 16-bit is used\n"
"f - fullscreen window\n"
"o - override-redirect window\n"
"e - do not exit on unmapping of the window\n"
"m - set _NET_WM_STATE_MODAL (makes sense for dialogs only)\n"
"k - set _KDE_NET_WM_WINDOW_TYPE_OVERRIDE\n"
+ "s - make the window shaped\n"
"h - set _MEEGOTOUCH_DECORATOR_BUTTONS for home and close buttons\n"
"n - WM_TYPE_NORMAL window (if 'k' is given, that is the first type)\n"
"d - WM_TYPE_DIALOG window\n"
"i - WM_TYPE_INPUT window\n"
"b - WM_TYPE_NOTIFICATION window ('b' is for banner)\n\n"
- "Usage 2: " PROG " N|U|F|C|M|T|A|W|H <XID>\n"
+ "Usage 2: " PROG " N|U|F|C|M|T|A|W|H|S <XID>\n"
"N - unfullscreen the window with <XID>\n"
"U - unmap the window with <XID>\n"
"F - fullscreen the window with <XID>\n"
@@ -320,7 +330,8 @@ static void print_usage_and_exit(QString& stdOut)
"T - make the window with <XID> non-transient\n"
"A - activate (_NET_ACTIVE_WINDOW) the window with <XID>\n"
"W - wait for mapping of the window with <XID>\n"
- "H - set _MEEGOTOUCH_DECORATOR_BUTTONS to the window with <XID>\n\n"
+ "H - set _MEEGOTOUCH_DECORATOR_BUTTONS to the window with <XID>\n"
+ "S - make the window with <XID> a shaped window\n\n"
"Usage 3: " PROG " t|L|V|G <XID> (<XID>|'None')\n"
"t - make the first window transient for the second one\n"
"L - configure the first window beLow the second one\n"
@@ -405,6 +416,9 @@ static void do_command (Display *dpy, char command, Window window,
case 'H':
set_decorator_buttons(dpy, window);
break;
+ case 'S':
+ set_shaped(dpy, window);
+ break;
case 't':
XSetTransientForHint(dpy, window, target);
/*
@@ -531,7 +545,8 @@ static bool old_main(QStringList& args, QString& stdOut)
char green[] = "#00ff00";
time_t last_time;
int argb = 0, fullscreen = 0, override_redirect = 0, decor_buttons = 0,
- exit_on_unmap = 1, modal = 0, kde_override = 0, meego_layer = -1;
+ exit_on_unmap = 1, modal = 0, kde_override = 0, meego_layer = -1,
+ shaped = 0;
WindowType windowtype = TYPE_INVALID;
if (args.count() < 1 || args.count() > 4) {
@@ -575,6 +590,10 @@ static bool old_main(QStringList& args, QString& stdOut)
kde_override = 1;
continue;
}
+ if (*p == 's') {
+ shaped = 1;
+ continue;
+ }
if (*p == 'h') {
decor_buttons = 1;
continue;
@@ -667,7 +686,7 @@ static bool old_main(QStringList& args, QString& stdOut)
return false;
}
}
- if ((command = strchr("NUFCMTAWH", *p))) {
+ if ((command = strchr("NUFCMTAWHS", *p))) {
if (args.count() != 2) {
print_usage_and_exit(stdOut);
return false;
@@ -704,6 +723,7 @@ static bool old_main(QStringList& args, QString& stdOut)
set_meego_layer(dpy, w, meego_layer);
if (decor_buttons) set_decorator_buttons(dpy, w);
+ if (shaped) set_shaped(dpy, w);
green_gc = XCreateGC (dpy, w, 0, NULL);
XParseColor (dpy, colormap, green, &green_col);