本文整理汇总了Python中gi.repository.GdkX11.x11_set_sm_client_id方法的典型用法代码示例。如果您正苦于以下问题:Python GdkX11.x11_set_sm_client_id方法的具体用法?Python GdkX11.x11_set_sm_client_id怎么用?Python GdkX11.x11_set_sm_client_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gi.repository.GdkX11
的用法示例。
在下文中一共展示了GdkX11.x11_set_sm_client_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: open
# 需要导入模块: from gi.repository import GdkX11 [as 别名]
# 或者: from gi.repository.GdkX11 import x11_set_sm_client_id [as 别名]
def open(self, app):
try:
from ._xsmp import XSMPClient, XSMPError
except ImportError as e:
raise SessionError(e)
print_d("Connecting with XSMP")
client = XSMPClient()
try:
client.open()
except XSMPError as e:
raise SessionError(e)
try:
from gi.repository import GdkX11
except ImportError:
pass
else:
GdkX11.x11_set_sm_client_id(client.client_id)
print_d("Connected. Client ID: %s" % client.client_id)
def save_yourself(client, *args):
print_d("xsmp: save_yourself %r" % (args,))
client.save_yourself_done(True)
def die(client, *args):
print_d("xsmp: die")
app.quit()
def save_complete(client):
print_d("xsmp: save_complete")
def shutdown_cancelled(client):
print_d("xsmp: shutdown_cancelled")
client.connect("save-yourself", save_yourself)
client.connect("die", die)
client.connect("save-complete", save_complete)
client.connect("shutdown-cancelled", shutdown_cancelled)
self._client = client