From 693e822b3779d695677d5bdc55a6b87e359285a9 Mon Sep 17 00:00:00 2001 From: imarom Date: Wed, 1 Feb 2017 17:01:47 +0200 Subject: added tests for capture few tweaks Signed-off-by: imarom --- .../stl/trex_stl_lib/utils/common.py | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py') diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py index 72d3fa9f..7cb94b28 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py @@ -124,6 +124,32 @@ def bitfield_to_list (bf): return rc +def set_window_always_on_top (title): + # we need the GDK module, if not available - ignroe this command + try: + if sys.version_info < (3,0): + from gtk import gdk + else: + #from gi.repository import Gdk as gdk + return + + except ImportError: + return + + # search the window and set it as above + root = gdk.get_default_root_window() + + for id in root.property_get('_NET_CLIENT_LIST')[2]: + w = gdk.window_foreign_new(id) + if w: + name = w.property_get('WM_NAME')[2] + if title in name: + w.set_keep_above(True) + gdk.window_process_all_updates() + break + + def bitfield_to_str (bf): lst = bitfield_to_list(bf) return "-" if not lst else ', '.join([str(x) for x in lst]) + -- cgit 1.2.3-korg