[orca] Add some debugging information
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Add some debugging information
- Date: Wed, 21 Mar 2018 14:00:15 +0000 (UTC)
commit c0326753fed88f3f0bb602341981c1d677593c7d
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Wed Mar 21 09:59:33 2018 -0400
Add some debugging information
src/orca/script_utilities.py | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 0ede8d9..e2ffecd 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -34,6 +34,7 @@ import locale
import math
import pyatspi
import re
+import subprocess
import time
from gi.repository import Gdk
from gi.repository import Gtk
@@ -120,10 +121,32 @@ class Utilities:
return state.contains(pyatspi.STATE_SHOWING)
+ @staticmethod
+ def _getAppCommandLine(app):
+ if not app:
+ return ""
+
+ pid = app.get_process_id()
+
+ try:
+ cmdline = subprocess.getoutput("cat /proc/%s/cmdline" % pid)
+ except:
+ return ""
+
+ return cmdline.replace("\x00", " ")
+
def canBeActiveWindow(self, window):
if not window:
return False
+ try:
+ app = window.getApplication()
+ except:
+ app = None
+
+ msg = "INFO: Looking at %s from %s %s" % (window, app, self._getAppCommandLine(app))
+ debug.println(debug.LEVEL_INFO, msg, True)
+
window.clearCache()
if not self._isActiveAndShowingAndNotIconified(window):
msg = "INFO: %s is not active and showing, or is iconified" % window
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]