Handle missing TakeScreenshot method gracefully
This commit is contained in:
parent
335e5c89d0
commit
ca3c990dc1
1
NEWS
1
NEWS
@ -1,3 +1,4 @@
|
|||||||
|
* #4517 Do not require a TakeScreenshot method on the dbus service (marco)
|
||||||
* Add wep type combo. (dcbw)
|
* Add wep type combo. (dcbw)
|
||||||
|
|
||||||
Snapshot 8c89bfaed7
|
Snapshot 8c89bfaed7
|
||||||
|
@ -172,7 +172,10 @@ class Shell(gobject.GObject):
|
|||||||
home_model = self._model.get_home()
|
home_model = self._model.get_home()
|
||||||
activity = home_model.get_active_activity()
|
activity = home_model.get_active_activity()
|
||||||
if activity:
|
if activity:
|
||||||
activity.get_service().TakeScreenshot()
|
try:
|
||||||
|
activity.get_service().TakeScreenshot(timeout=1.0)
|
||||||
|
except dbus.DBusException, e:
|
||||||
|
logging.debug('ignoring error raised by TakeScreenshot(): %s', e)
|
||||||
|
|
||||||
def set_zoom_level(self, level):
|
def set_zoom_level(self, level):
|
||||||
if level == self._zoom_level:
|
if level == self._zoom_level:
|
||||||
|
@ -71,8 +71,6 @@ class KeyHandler(object):
|
|||||||
self._key_grabber = KeyGrabber()
|
self._key_grabber = KeyGrabber()
|
||||||
self._key_grabber.connect('key-pressed',
|
self._key_grabber.connect('key-pressed',
|
||||||
self._key_pressed_cb)
|
self._key_pressed_cb)
|
||||||
self._key_grabber.connect('key-released',
|
|
||||||
self._key_released_cb)
|
|
||||||
|
|
||||||
for key in _actions_table.keys():
|
for key in _actions_table.keys():
|
||||||
self._key_grabber.grab(key)
|
self._key_grabber.grab(key)
|
||||||
@ -197,23 +195,3 @@ class KeyHandler(object):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _key_released_cb(self, grabber, keycode, state):
|
|
||||||
if self._keycode_pressed == keycode:
|
|
||||||
self._keycode_pressed = 0
|
|
||||||
|
|
||||||
if self._keystate_pressed == state:
|
|
||||||
self._keystate_pressed = 0
|
|
||||||
|
|
||||||
if not self._keycode_pressed and not self._keystate_pressed and \
|
|
||||||
self._key_pressed:
|
|
||||||
gtk.gdk.keyboard_ungrab(time=0L)
|
|
||||||
|
|
||||||
if self._key_pressed == '<alt>f':
|
|
||||||
self._shell.get_frame().notify_key_release()
|
|
||||||
elif self._key_pressed == '0x93':
|
|
||||||
self._shell.get_frame().notify_key_release()
|
|
||||||
|
|
||||||
return True
|
|
||||||
|
|
||||||
return False
|
|
||||||
|
Loading…
Reference in New Issue
Block a user