diff options
-rw-r--r-- | meson.build | 1 | ||||
-rw-r--r-- | tests/gsdtestcase.py | 6 | ||||
-rw-r--r-- | tests/meson.build | 11 | ||||
-rw-r--r-- | tests/shiftkey.c | 57 |
4 files changed, 5 insertions, 70 deletions
diff --git a/meson.build b/meson.build index a6e676f5..aa57f833 100644 --- a/meson.build +++ b/meson.build @@ -201,7 +201,6 @@ po_dir = join_paths(meson.source_root(), 'po') top_inc = include_directories('.') -subdir('tests') subdir('gnome-settings-daemon') subdir('data') subdir('plugins') diff --git a/tests/gsdtestcase.py b/tests/gsdtestcase.py index ffb4a2b4..fb821d38 100644 --- a/tests/gsdtestcase.py +++ b/tests/gsdtestcase.py @@ -184,6 +184,7 @@ class GSDTestCase(X11SessionTestCase): def start_mutter(klass): ''' start mutter ''' + os.environ['MUTTER_DEBUG_RESET_IDLETIME']='1' klass.mutter_log = open(os.path.join(klass.workdir, 'mutter.log'), 'wb', buffering=0) # See https://gitlab.gnome.org/GNOME/mutter/merge_requests/15 klass.mutter = subprocess.Popen(['mutter', '--x11'], @@ -204,4 +205,7 @@ class GSDTestCase(X11SessionTestCase): def reset_idle_timer(klass): '''trigger activity to reset idle timer''' - subprocess.check_call([os.path.join(top_builddir, 'tests', 'shiftkey')]) + obj_mutter_idlemonitor = klass.session_bus_con.get_object( + 'org.gnome.Mutter.IdleMonitor', '/org/gnome/Mutter/IdleMonitor/Core') + + obj_mutter_idlemonitor.ResetIdletime(dbus_interface='org.gnome.Mutter.IdleMonitor') diff --git a/tests/meson.build b/tests/meson.build deleted file mode 100644 index 1c29c48e..00000000 --- a/tests/meson.build +++ /dev/null @@ -1,11 +0,0 @@ -deps = [ - x11_dep, - xtst_dep -] - -exe = executable( - 'shiftkey', - 'shiftkey.c', - include_directories: top_inc, - dependencies: deps -) diff --git a/tests/shiftkey.c b/tests/shiftkey.c deleted file mode 100644 index cd5a1c8e..00000000 --- a/tests/shiftkey.c +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- - * - * Test helper program to send a "left shift key" event via XTest, to reset the - * idle timer. - * - * Copyright (C) 2013 Canonical Ltd. - * Author: Martin Pitt <martin.pitt@ubuntu.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see <http://www.gnu.org/licenses/>. - * - */ - -#include "config.h" - -#include <stdio.h> - -#include <X11/extensions/XTest.h> -#include <X11/keysym.h> - -int -main() -{ - Display *display = NULL; - int event_base, error_base, major_version, minor_version; - KeyCode keycode; - - display = XOpenDisplay (NULL); - - if (display == NULL) { - fputs ("Error: Cannot open display\n", stderr); - return 1; - } - - if (!XTestQueryExtension (display, &event_base, &error_base, &major_version, &minor_version)) { - fputs ("Error: No XTest extension\n", stderr); - return 1; - } - - /* send a left shift key; first press, then release */ - keycode = XKeysymToKeycode (display, XK_Shift_L); - XTestFakeKeyEvent (display, keycode, True, 0); - XTestFakeKeyEvent (display, keycode, False, 0); - - XCloseDisplay (display); - return 0; -} |