本文整理匯總了Python中xpra.client.ui_client_base.UIXpraClient.destroy_window方法的典型用法代碼示例。如果您正苦於以下問題:Python UIXpraClient.destroy_window方法的具體用法?Python UIXpraClient.destroy_window怎麽用?Python UIXpraClient.destroy_window使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類xpra.client.ui_client_base.UIXpraClient
的用法示例。
在下文中一共展示了UIXpraClient.destroy_window方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: destroy_window
# 需要導入模塊: from xpra.client.ui_client_base import UIXpraClient [as 別名]
# 或者: from xpra.client.ui_client_base.UIXpraClient import destroy_window [as 別名]
def destroy_window(self, wid, window):
#override so we can cleanup the group-leader if needed,
UIXpraClient.destroy_window(self, wid, window)
group_leader = window.group_leader
if group_leader is None or len(self._group_leader_wids)==0:
return
wids = self._group_leader_wids.get(group_leader)
if wids is None:
#not recorded any window ids on this group leader
#means it is another managed window, leave it alone
return
if wid in wids:
wids.remove(wid)
if len(wids)>0:
#still has another window pointing to it
return
#the last window has gone, we can remove the group leader,
#find all the references to this group leader:
del self._group_leader_wids[group_leader]
refs = []
for ref, gl in self._ref_to_group_leader.items():
if gl==group_leader:
refs.append(ref)
for ref in refs:
del self._ref_to_group_leader[ref]
log("last window for refs %s is gone, destroying the group leader %s", refs, group_leader)
group_leader.destroy()