Skip to content

Commit

Permalink
#799 if we don't find a reference to use for the group leader, don't …
Browse files Browse the repository at this point in the history
…create a useless one - also fix the comments that claimed we used the wid (which was the transient-for wid)

git-svn-id: https://xpra.org/svn/Xpra/trunk@8628 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Feb 5, 2015
1 parent 846a1f1 commit bc1939f
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/xpra/client/gtk2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,10 @@ def window_ungrab(self):



def get_group_leader(self, metadata, override_redirect):
wid = metadata.intget("transient-for", -1)
if wid>0:
client_window = self._id_to_window.get(wid)
def get_group_leader(self, wid, metadata, override_redirect):
transient_for = metadata.intget("transient-for", -1)
if transient_for>0:
client_window = self._id_to_window.get(transient_for)
if client_window:
gdk_window = client_window.get_window()
if gdk_window:
Expand All @@ -374,11 +374,14 @@ def get_group_leader(self, metadata, override_redirect):
elif pid>0:
reftype = "pid"
ref = pid
elif transient_for>0:
#this should have matched a client window above..
#but try to use it anyway:
reftype = "transient-for"
ref = transient_for
else:
#no reference to use! invent a unique one for this window:
#(use its wid)
reftype = "wid"
ref = wid
#no reference to use
return None
refkey = "%s:%s" % (reftype, ref)
group_leader_window = self._ref_to_group_leader.get(refkey)
if group_leader_window:
Expand Down

0 comments on commit bc1939f

Please sign in to comment.