summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpolkit-efl-authentication-agent-118
1 files changed, 12 insertions, 6 deletions
diff --git a/polkit-efl-authentication-agent-1 b/polkit-efl-authentication-agent-1
index 5fc1f0b..3e435fe 100755
--- a/polkit-efl-authentication-agent-1
+++ b/polkit-efl-authentication-agent-1
@@ -48,12 +48,18 @@ elementary.init()
48 48
49USE_ECORE_X = False 49USE_ECORE_X = False
50try: 50try:
51 import efl.ecore.x 51 import efl.ecore.x as ecore_x
52 USE_ECORE_X = True
52except ImportError: 53except ImportError:
53 pass 54 try:
54else: 55 import efl.ecore_x as ecore_x
55 if efl.ecore.x.init():
56 USE_ECORE_X = True 56 USE_ECORE_X = True
57 except ImportError:
58 pass
59
60if USE_ECORE_X:
61 if not ecore_x.init():
62 USE_ECORE_X = False
57 63
58from efl.elementary.window import Window, ELM_WIN_DOCK 64from efl.elementary.window import Window, ELM_WIN_DOCK
59from efl.elementary.button import Button 65from efl.elementary.button import Button
@@ -457,7 +463,7 @@ class AuthenticationDialog(Window):
457 log.debug("Dialog now visible") 463 log.debug("Dialog now visible")
458 if USE_ECORE_X: 464 if USE_ECORE_X:
459 xid = self.xwindow_xid 465 xid = self.xwindow_xid
460 xwin = efl.ecore.x.Window_from_xid(xid) 466 xwin = ecore_x.Window_from_xid(xid)
461 if not xwin.keyboard_grab(): 467 if not xwin.keyboard_grab():
462 pass # TODO: Cancel auth? Or just warn user 468 pass # TODO: Cancel auth? Or just warn user
463 self.activate() 469 self.activate()
@@ -465,7 +471,7 @@ class AuthenticationDialog(Window):
465 def hide_done_cb(*args): 471 def hide_done_cb(*args):
466 log.debug("Dialog now hidden, deleting") 472 log.debug("Dialog now hidden, deleting")
467 if USE_ECORE_X: 473 if USE_ECORE_X:
468 efl.ecore.x.keyboard_ungrab() 474 ecore_x.keyboard_ungrab()
469 self.hiding = False 475 self.hiding = False
470 dlg = agent.dialogs.pop(cookie) 476 dlg = agent.dialogs.pop(cookie)
471 dlg.delete() 477 dlg.delete()