diff --git a/src/sugar/wm.py b/src/sugar/wm.py
index d813d94..23310c3 100644
a
|
b
|
import gtk |
23 | 23 | |
24 | 24 | |
25 | 25 | def get_activity_id(wnck_window): |
| 26 | gtk.gdk.error_trap_push() |
| 27 | |
26 | 28 | window = gtk.gdk.window_foreign_new(wnck_window.get_xid()) |
27 | 29 | prop_info = window.property_get('_SUGAR_ACTIVITY_ID', 'STRING') |
| 30 | |
| 31 | if gtk.gdk.error_trap_pop(): |
| 32 | raise "X Error while retrieving the _SUGAR_ACTIVITY_ID from window %i" \ |
| 33 | % wnck_window.get_xid() |
| 34 | |
28 | 35 | if prop_info is None: |
29 | 36 | return None |
30 | 37 | else: |
… |
… |
def get_activity_id(wnck_window): |
32 | 39 | |
33 | 40 | |
34 | 41 | def get_bundle_id(wnck_window): |
| 42 | gtk.gdk.error_trap_push() |
| 43 | |
35 | 44 | window = gtk.gdk.window_foreign_new(wnck_window.get_xid()) |
36 | 45 | prop_info = window.property_get('_SUGAR_BUNDLE_ID', 'STRING') |
| 46 | |
| 47 | if gtk.gdk.error_trap_pop(): |
| 48 | raise "X Error while retrieving the _SUGAR_BOUNDLE_ID from window %i" \ |
| 49 | % wnck_window.get_xid() |
| 50 | |
37 | 51 | if prop_info is None: |
38 | 52 | return None |
39 | 53 | else: |
… |
… |
def get_bundle_id(wnck_window): |
41 | 55 | |
42 | 56 | |
43 | 57 | def set_activity_id(window, activity_id): |
| 58 | gtk.gdk.error_trap_push() |
| 59 | |
44 | 60 | window.property_change('_SUGAR_ACTIVITY_ID', 'STRING', 8, |
45 | 61 | gtk.gdk.PROP_MODE_REPLACE, activity_id) |
46 | 62 | |
| 63 | if gtk.gdk.error_trap_pop(): |
| 64 | raise "Could not set the _SUGAR_ACTIVITY_ID on the window to %s" \ |
| 65 | % activity_id |
| 66 | |
47 | 67 | |
48 | 68 | def set_bundle_id(window, bundle_id): |
| 69 | gtk.gdk.error_trap_push() |
| 70 | |
49 | 71 | window.property_change('_SUGAR_BUNDLE_ID', 'STRING', 8, |
50 | 72 | gtk.gdk.PROP_MODE_REPLACE, bundle_id) |
| 73 | |
| 74 | if gtk.gdk.error_trap_pop(): |
| 75 | raise "Could not set the _SUGAR_BOUNDLE_ID on the window to %s" \ |
| 76 | % activity_id |
| 77 | |