[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[firstboot rhel5-branch] Fixed hiding of a dialog window when user clicked on the main window (#511984)
- From: Martin Gracik <mgracik redhat com>
- To: anaconda-devel-list redhat com
- Subject: [firstboot rhel5-branch] Fixed hiding of a dialog window when user clicked on the main window (#511984)
- Date: Tue, 5 Jan 2010 16:48:21 +0100
---
src/modules/networking.py | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/src/modules/networking.py b/src/modules/networking.py
index 438b738..6699792 100644
--- a/src/modules/networking.py
+++ b/src/modules/networking.py
@@ -26,6 +26,8 @@ import time
import gtk
import gobject
import sys
+import commands
+import re
import functions
import libuser
import kudzu
@@ -43,6 +45,11 @@ class childWindow:
moduleName = (_("Network Setup"))
moduleClass = "reconfig"
+ needsparent = 1
+
+ def passInParent(self, parent):
+ self.parent = parent
+
def launch(self, doDebug = None):
self.doDebug = doDebug
self.admin = libuser.admin()
@@ -166,6 +173,30 @@ class childWindow:
#Run rhn_register so they can register with RHN
pid = start_process("/usr/bin/system-config-network")
+ # get the x window id
+ xid = None
+ start = time.time()
+
+ # keep trying for 3 seconds
+ while xid is None and (time.time() - start < 3):
+ rc, out = commands.getstatusoutput('xwininfo -name' \
+ ' "Network Configuration" -int')
+ pattern = re.compile("xwininfo:\sWindow\sid:\s(?P<xid>\d+)\s.*")
+ for line in out.splitlines():
+ m = pattern.match(line)
+ if m:
+ xid = long(m.group("xid"))
+
+ # if we have the xid, embed the window
+ if xid is not None:
+ network_dlg = gtk.gdk.window_foreign_new(xid)
+ self.parent.win.realize()
+ network_dlg.set_transient_for(self.parent.win.window)
+ network_dlg.set_modal_hint(True)
+ # XXX if we keep the main window fullscreen,
+ # and use alt+tab, the network window is gone forever
+ self.parent.win.unfullscreen()
+
flag = None
while not flag:
while gtk.events_pending():
@@ -178,5 +209,8 @@ class childWindow:
else:
time.sleep(0.1)
+ # make the main window fullscreen again
+ self.parent.win.fullscreen()
+
i.grab_remove ()
self.updateLabels()
--
1.6.5.2
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]